xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sum(int);
int main() {
  int num, res;
  printf("\nEnter a number : ");
  scanf("%d", &num);
  res = sum(num);
  printf("\n1 + ... + %d = %d\n\n", num, res);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <sum@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <sum@plt>
mov    0x4(%rsp),%esi
lea    0xeb2(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"\0A1 + ... + %d = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = call i32 @sum(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\0AEnter a number : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"\0A1 + ... + %d = %d\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t ri32(const uint8_t a[4]) {
  uint32_t x;
  x = (uint32_t)a[0] << 0;
  x |= (uint32_t)a[1] << 8;
  x |= (uint32_t)a[2] << 16;
  x |= (uint32_t)a[3] << 24;
  return x;
}


x86 assembly (clang, -O0):
<ri32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ri32>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ri32(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
%4 = load i64*, i64** %2
%5 = getelementptr inbounds i64, i64* %4, i64 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 0
store i32 %8, i32* %3
%9 = load i64*, i64** %2
%10 = getelementptr inbounds i64, i64* %9, i64 1
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = shl i32 %12, 8
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i64*, i64** %2
%17 = getelementptr inbounds i64, i64* %16, i64 2
%18 = load i64, i64* %17
%19 = trunc i64 %18 to i32
%20 = shl i32 %19, 16
%21 = load i32, i32* %3
%22 = or i32 %21, %20
store i32 %22, i32* %3
%23 = load i64*, i64** %2
%24 = getelementptr inbounds i64, i64* %23, i64 3
%25 = load i64, i64* %24
%26 = trunc i64 %25 to i32
%27 = shl i32 %26, 24
%28 = load i32, i32* %3
%29 = or i32 %28, %27
store i32 %29, i32* %3
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @ri32(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
neg(float f, double d) {
  f = -f;
  d = -d;
}


x86 assembly (clang, -O0):
<neg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg>:
ret

LLVM IR (-O0):
define i32 @neg(float %0, double %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca double
store float %0, float* %4
store double %1, double* %5
%6 = load float, float* %4
%7 = fneg float %6
store float %7, float* %4
%8 = load double, double* %5
%9 = fneg double %8
store double %9, double* %5
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @neg(float %0, double %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void helloworld(void) { fprintf(stdout, "this is just a test for openwrt\n"); }


x86 assembly (clang, -O0):
<helloworld>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<helloworld>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [33 x i8] c"this is just a test for openwrt\0A\00"
define void @helloworld() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [33 x i8] c"this is just a test for openwrt\0A\00"
define void @helloworld() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ catch_sig();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ set_timer();
int /*<<< orphan*/ sleep(int);
int main(int ac, char **av) {
  catch_sig();
  set_timer();
  while (1) {
    printf("Sleep in main\n");
    sleep(10);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <catch_sig@plt>
mov    $0x0,%al
call   1050 <set_timer@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
jmp    1164 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <catch_sig@plt>
xor    %eax,%eax
call   1050 <set_timer@plt>
lea    0xeaa(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xa,%edi
call   1060 <sleep@plt>
jmp    1160 <main+0x20>

LLVM IR (-O0):
@.str = [15 x i8] c"Sleep in main\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @catch_sig()
%7 = call i32 (...) @set_timer()
br label %8
8: ; preds = %2, %8
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @sleep(i32 10)
br label %8
}

LLVM IR (-O2):
@str = [14 x i8] c"Sleep in main\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @catch_sig()
%4 = tail call i32 (...) @set_timer()
br label %5
5: ; preds = %2, %5
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @sleep(i32 10)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ intercala(int *, int, int, int);
void Merge(int *vet, int p, int r) {
  int q;
  if (p < r) {
    q = (p + r) / 2;
    Merge(vet, p, q);
    Merge(vet, q + 1, r);
    intercala(vet, p, q, r);
  }
}


x86 assembly (clang, -O0):
<Merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1182 <Merge+0x62>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <Merge@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <Merge@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <intercala@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Merge>:
cmp    %edx,%esi
jge    1172 <Merge+0x52>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r15
lea    (%r14,%r12,1),%eax
mov    %eax,%ebx
shr    $0x1f,%ebx
add    %eax,%ebx
sar    %ebx
mov    %ebx,%edx
call   1030 <Merge@plt>
lea    0x1(%rbx),%esi
mov    %r15,%rdi
mov    %r14d,%edx
call   1030 <Merge@plt>
mov    %r15,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <intercala@plt>
ret

LLVM IR (-O0):
define void @Merge(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %3
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = sdiv i32 %14, 2
store i32 %15, i32* %7
%16 = load i32*, i32** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %6
%23 = load i32*, i32** %4
%24 = load i32, i32* %5
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = call i32 @intercala(i32* %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @Merge(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %6, label %5
5: ; preds = %3, %6
ret void
6: ; preds = %3
%7 = add nsw i32 %2, %1
%8 = sdiv i32 %7, 2
tail call void @Merge(i32* %0, i32 %1, i32 %8)
%9 = add nsw i32 %8, 1
tail call void @Merge(i32* %0, i32 %9, i32 %2)
%10 = tail call i32 @intercala(i32* %0, i32 %1, i32 %8, i32 %2)
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a, b, c;
  a = 5;
  b = 6;
  printf("Before Interchange a= %d    b=%d\n", a, b);
  c = a;
  a = b;
  b = c;
  printf("After Interchange a= %d    b=%d\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x6,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0x6,%edx
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x6,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Before Interchange a= %d b=%d\0A\00"
@.str.1 = [33 x i8] c"After Interchange a= %d b=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 6, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"Before Interchange a= %d b=%d\0A\00"
@.str.1 = [33 x i8] c"After Interchange a= %d b=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 5, i32 6)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 6, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fun(int, double, char);
int main() {
  fun(23, 3.14, 'a');
  fun(24, 2.78, 'b');
  fun(42, 1.414, 'c');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x17,%edi
movsd  0xeef(%rip),%xmm0
mov    $0x61,%esi
call   1030 <fun@plt>
mov    $0x18,%edi
movsd  0xed0(%rip),%xmm0
mov    $0x62,%esi
call   1030 <fun@plt>
mov    $0x2a,%edi
movsd  0xeb1(%rip),%xmm0
mov    $0x63,%esi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
mov    $0x17,%edi
mov    $0x61,%esi
call   1030 <fun@plt>
movsd  0xed8(%rip),%xmm0
mov    $0x18,%edi
mov    $0x62,%esi
call   1030 <fun@plt>
movsd  0xec9(%rip),%xmm0
mov    $0x2a,%edi
mov    $0x63,%esi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @fun(i32 23, double 3.140000e+00, i8 signext 97)
%2 = call i32 @fun(i32 24, double 2.780000e+00, i8 signext 98)
%3 = call i32 @fun(i32 42, double 1.414000e+00, i8 signext 99)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(i32 23, double 3.140000e+00, i8 signext 97)
%2 = tail call i32 @fun(i32 24, double 2.780000e+00, i8 signext 98)
%3 = tail call i32 @fun(i32 42, double 1.414000e+00, i8 signext 99)
ret i32 0
}
/* Type definitions */
typedef scalar_t__ Atom;

/* Variables and functions */
int array_length(Atom *a) {
  int n;
  for (n = 0; a[n]; n++)
    ;
  return n;
}


x86 assembly (clang, -O0):
<array_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <array_length+0x35>
jmp    1127 <array_length+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <array_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_length>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <array_length+0x10>
ret

LLVM IR (-O0):
define i32 @array_length(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i64*, i64** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %5, i64 %7
%9 = load i64, i64* %8
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %4
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @array_length(i64* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i64, i64* %0, i64 %3
%5 = load i64, i64* %4
%6 = icmp eq i64 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
unsigned int _mulsuchar(signed char x, signed char y) {
  return ((int)((unsigned char)x) * (int)y);
}


x86 assembly (clang, -O0):
<_mulsuchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mulsuchar>:
movzbl %dil,%eax
imul   %esi,%eax
ret

LLVM IR (-O0):
define i32 @_mulsuchar(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = mul nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @_mulsuchar(i8 signext %0, i8 signext %1) {
%3 = zext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = mul nsw i32 %4, %3
ret i32 %5
}
int otoi(str)
unsigned char str[];
{
  unsigned int result;
  (void)sscanf((char *)str, "%o", &result);
  return result;
}


x86 assembly (clang, -O0):
<otoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
mov    $0x0,%al
call   1030 <sscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<otoi>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
xor    %eax,%eax
call   1030 <sscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%o\00"
define i32 @otoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
@.str = [3 x i8] c"%o\00"
define i32 @otoi(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
ret i32 %5
}
int $Sub$$_sys_close(int fh) { return -1; }


x86 assembly (clang, -O0):
<$Sub$$_sys_close>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<$Sub$$_sys_close>:
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @"$Sub$$_sys_close"(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 -1
}

LLVM IR (-O2):
define i32 @"$Sub$$_sys_close"(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ SSL_library_init();
int /*<<< orphan*/ SSL_load_error_strings();
void kore_server_sslstart(void) {
  ;
  SSL_library_init();
  SSL_load_error_strings();
}


x86 assembly (clang, -O0):
<kore_server_sslstart>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SSL_library_init@plt>
mov    $0x0,%al
call   1040 <SSL_load_error_strings@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kore_server_sslstart>:
push   %rax
xor    %eax,%eax
call   1030 <SSL_library_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <SSL_load_error_strings@plt>

LLVM IR (-O0):
define void @kore_server_sslstart() {
%1 = call i32 (...) @SSL_library_init()
%2 = call i32 (...) @SSL_load_error_strings()
ret void
}

LLVM IR (-O2):
define void @kore_server_sslstart() {
%1 = tail call i32 (...) @SSL_library_init()
%2 = tail call i32 (...) @SSL_load_error_strings()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ read(int, char *, int);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void cat(int fd) {
  ssize_t n;
  char buf[2048];
  while ((n = read(fd, buf, sizeof(buf))) > 0)
    write(STDOUT_FILENO, buf, n);
}


x86 assembly (clang, -O0):
<cat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x810(%rbp),%rsi
mov    $0x800,%edx
call   1040 <read@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    116b <cat+0x4b>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    -0x810(%rbp),%rsi
mov    -0x8(%rbp),%edx
call   1030 <write@plt>
jmp    112e <cat+0xe>
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cat>:
push   %rbp
push   %r14
push   %rbx
sub    $0x800,%rsp
mov    %edi,%ebp
mov    %rsp,%rsi
mov    $0x800,%edx
call   1040 <read@plt>
test   %eax,%eax
jle    1170 <cat+0x50>
mov    0x2eab(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x800,%edx
call   1040 <read@plt>
test   %eax,%eax
jg     1150 <cat+0x30>
add    $0x800,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @cat(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2048 x i8]
store i32 %0, i32* %2
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %2
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%8 = call i32 @read(i32 %6, i8* %7, i32 2048)
store i32 %8, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %5
%11 = load i32, i32* @STDOUT_FILENO
%12 = getelementptr inbounds [2048 x i8], [2048 x i8]* %4, i64 0, i64 0
%13 = load i32, i32* %3
%14 = call i32 @write(i32 %11, i8* %12, i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @cat(i32 %0) {
%2 = alloca [2048 x i8]
%3 = getelementptr inbounds [2048 x i8], [2048 x i8]* %2, i64 0, i64 0
%4 = call i32 @read(i32 %0, i8* %3, i32 2048)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %4, %1 ]
%8 = load i32, i32* @STDOUT_FILENO
%9 = call i32 @write(i32 %8, i8* %3, i32 %7)
%10 = call i32 @read(i32 %0, i8* %3, i32 2048)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %6, label %12
12: ; preds = %6, %1
ret void
}
unsigned short FindSpace(char *str, unsigned short StartPos) {
  int i;
  for (i = StartPos; (str[i] != '\t') && (str[i] != ' ') && (str[i] != '\0');
       i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<FindSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x9,%ecx
mov    %al,-0x11(%rbp)
je     115f <FindSpace+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     115f <FindSpace+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116f <FindSpace+0x6f>
jmp    1182 <FindSpace+0x82>
jmp    1174 <FindSpace+0x74>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <FindSpace+0x16>
mov    -0x10(%rbp),%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<FindSpace>:
mov    %esi,%eax
movabs $0x100000201,%rcx
jmp    1114 <FindSpace+0x14>
xchg   %ax,%ax
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x20,%rdx
ja     1110 <FindSpace+0x10>
bt     %rdx,%rcx
jae    1110 <FindSpace+0x10>
ret

LLVM IR (-O0):
define zeroext i16 @FindSpace(i8* %0, i16 zeroext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i32
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
store i32 %7, i32* %5
br label %8
8: ; preds = %35, %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 9
br i1 %15, label %16, label %32
16: ; preds = %8
%17 = load i8*, i8** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %22, 32
br i1 %23, label %24, label %32
24: ; preds = %16
%25 = load i8*, i8** %3
%26 = load i32, i32* %5
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 0
br label %32
32: ; preds = %24, %16, %8
%33 = phi i1 [ false, %16 ], [ false, %8 ], [ %31, %24 ]
br i1 %33, label %34, label %38
34: ; preds = %32
br label %35
35: ; preds = %34
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 1
store i32 %37, i32* %5
br label %8
38: ; preds = %32
%39 = load i32, i32* %5
%40 = trunc i32 %39 to i16
ret i16 %40
}

LLVM IR (-O2):
define zeroext i16 @FindSpace(i8* nocapture %0, i16 zeroext %1) {
%3 = zext i16 %1 to i64
br label %4
4: ; preds = %8, %2
%5 = phi i64 [ %9, %8 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %8 [
i8 9, label %10
i8 32, label %10
i8 0, label %10
]
8: ; preds = %4
%9 = add nuw i64 %5, 1
br label %4
10: ; preds = %4, %4, %4
%11 = trunc i64 %5 to i16
ret i16 %11
}
/* Variables and functions */
float floorl(float);
float floorf(float x) { return floorl(x); }


x86 assembly (clang, -O0):
<floorf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <floorl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floorf>:
jmp    1030 <floorl@plt>

LLVM IR (-O0):
define float @floorf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @floorl(float %3)
ret float %4
}

LLVM IR (-O2):
define float @floorf(float %0) {
%2 = tail call float @floorl(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ fprint_double(double, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void print_double(double f) { fprint_double(f, stdout); }


x86 assembly (clang, -O0):
<print_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
call   1030 <fprint_double@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_double>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprint_double@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load i32, i32* @stdout
%5 = call i32 @fprint_double(double %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_double(double %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprint_double(double %0, i32 %2)
ret void
}
__attribute__((always_)) void *read_cr2(void) {
  void *ret;
  asm volatile("mov %%cr2, %0" : "=r"(ret));
  return ret;
}


x86 assembly (clang, -O0):
<read_cr2>:
push   %rbp
mov    %rsp,%rbp
mov    %cr2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_cr2>:
mov    %cr2,%rax
ret

LLVM IR (-O0):
define i8* @read_cr2() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "mov %cr2, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @read_cr2() {
%1 = tail call i8* asm sideeffect "mov %cr2, $0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
int isnodata(unsigned char *bmp60) {
  int i;
  unsigned char data = 0;
  for (i = 0; i < 16; i++) {
    data |= bmp60[i];
  }
  return !data;
}


x86 assembly (clang, -O0):
<isnodata>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0xd(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1140 <isnodata+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%ecx
movzbl -0xd(%rbp),%eax
or     %ecx,%eax
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1113 <isnodata+0x13>
cmpb   $0x0,-0xd(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isnodata>:
movdqu (%rdi),%xmm0
pxor   %xmm1,%xmm1
pcmpeqb %xmm0,%xmm1
pmovmskb %xmm1,%ecx
xor    %eax,%eax
cmp    $0xffff,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @isnodata(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %4
store i32 0, i32* %3
br label %5
5: ; preds = %19, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
br label %19
19: ; preds = %8
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %5
22: ; preds = %5
%23 = load i8, i8* %4
%24 = icmp ne i8 %23, 0
%25 = xor i1 %24, true
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @isnodata(i8* nocapture %0) {
%2 = bitcast i8* %0 to <16 x i8>*
%3 = load <16 x i8>, <16 x i8>* %2
%4 = call i8 @llvm.vector.reduce.or.v16i8(<16 x i8> %3)
%5 = icmp eq i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
void main(void) {
  float f = 0.1f;
  float sum = 0;
  float product = f * 10;
  int i;
  for (i = 0; i < 10; ++i)
    sum += f;
  printf("sum = %1.15f, mul = %1.15f, mul2 = %1.15f\n", sum, product, f * 10);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    116d <main+0x5d>
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x36>
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  0xe81(%rip),%xmm2
mulss  -0x4(%rbp),%xmm2
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef1(%rip),%rdi
movss  0xee1(%rip),%xmm0
movss  0xedd(%rip),%xmm1
movaps %xmm1,%xmm2
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"sum = %1.15f, mul = %1.15f, mul2 = %1.15f\0A\00"
define void @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float 0x3FB99999A0000000, float* %1
store float 0.000000e+00, float* %2
%5 = load float, float* %1
%6 = fmul float %5, 1.000000e+01
store float %6, float* %3
store i32 0, i32* %4
br label %7
7: ; preds = %14, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = load float, float* %1
%12 = load float, float* %2
%13 = fadd float %12, %11
store float %13, float* %2
br label %14
14: ; preds = %10
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
br label %7
17: ; preds = %7
%18 = load float, float* %2
%19 = load float, float* %3
%20 = load float, float* %1
%21 = fmul float %20, 1.000000e+01
%22 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float %18, float %19, float %21)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"sum = %1.15f, mul = %1.15f, mul2 = %1.15f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), float 0x3FF0000020000000, float 1.000000e+00, float 1.000000e+00)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void test_print(const char *msg) { printf("%s", msg); }


x86 assembly (clang, -O0):
<test_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @test_print(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @test_print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int tegra_core_speedo_mv(void) { return 1100; }


x86 assembly (clang, -O0):
<tegra_core_speedo_mv>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44c,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tegra_core_speedo_mv>:
mov    $0x44c,%eax
ret

LLVM IR (-O0):
define i32 @tegra_core_speedo_mv() {
ret i32 1100
}

LLVM IR (-O2):
define i32 @tegra_core_speedo_mv() {
ret i32 1100
}
void caller_1_1_2_2_2_2_2() {}


x86 assembly (clang, -O0):
<caller_1_1_2_2_2_2_2>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<caller_1_1_2_2_2_2_2>:
ret

LLVM IR (-O0):
define void @caller_1_1_2_2_2_2_2() {
ret void
}

LLVM IR (-O2):
define void @caller_1_1_2_2_2_2_2() {
ret void
}
int HAL_core_subsystem_version(char *patchstr, int bufLen) {
  *patchstr = 0;
  return 0;
}


x86 assembly (clang, -O0):
<HAL_core_subsystem_version>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HAL_core_subsystem_version>:
movb   $0x0,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @HAL_core_subsystem_version(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
store i8 0, i8* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @HAL_core_subsystem_version(i8* nocapture writeonly %0, i32 %1) {
store i8 0, i8* %0
ret i32 0
}
int mult_ab(int a, int b) {
  if (a == 1) {
    return b;
  }
  a--;
  return b + (mult_ab(a, b));
}


x86 assembly (clang, -O0):
<mult_ab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1133 <mult_ab+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <mult_ab+0x47>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mult_ab@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_ab>:
lea    -0x1(%rdi),%ecx
imul   %esi,%ecx
xor    %eax,%eax
cmp    $0x1,%edi
cmovne %ecx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @mult_ab(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %5
store i32 %9, i32* %3
br label %18
10: ; preds = %2
%11 = load i32, i32* %4
%12 = add nsw i32 %11, -1
store i32 %12, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @mult_ab(i32 %14, i32 %15)
%17 = add nsw i32 %13, %16
store i32 %17, i32* %3
br label %18
18: ; preds = %10, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @mult_ab(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 1
%4 = add i32 %0, -1
%5 = mul i32 %4, %1
%6 = select i1 %3, i32 0, i32 %5
%7 = add nsw i32 %6, %1
ret i32 %7
}
f() { int x[] = {[0 ... 9] = 3}; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xedd(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
ret

LLVM IR (-O0):
@__const.f.x = [10 x i32] [i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3]
define i32 @f() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %2 to i8*
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @f() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char a;
  puts("enter");
  scanf("%c", &a);
  printf("%d", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
lea    0xebb(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"enter\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"enter\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SYS_close;
int syscall(int /*<<< orphan*/, int);
int close(int fd) { return syscall(SYS_close, fd); }


x86 assembly (clang, -O0):
<close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close>:
mov    %edi,%esi
mov    0x2ecf(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_close = global i32 0
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @SYS_close
%4 = load i32, i32* %2
%5 = call i32 @syscall(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@SYS_close = global i32 0
define i32 @close(i32 %0) {
%2 = load i32, i32* @SYS_close
%3 = tail call i32 @syscall(i32 %2, i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Puzzle();
int main(void) {
  int i;
  for (i = 0; i < 100; i++)
    Puzzle();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <Puzzle@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <Puzzle@plt>
add    $0xffffffff,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @Puzzle()
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 (...) @Puzzle()
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 100
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ absolutex();
int /*<<< orphan*/ readmem65816(int /*<<< orphan*/);
int /*<<< orphan*/ sbc8(int /*<<< orphan*/);
void sbcAbsx8(void) { sbc8(readmem65816(absolutex())); }


x86 assembly (clang, -O0):
<sbcAbsx8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <absolutex@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
call   1030 <sbc8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbcAbsx8>:
push   %rax
xor    %eax,%eax
call   1040 <absolutex@plt>
mov    %eax,%edi
call   1050 <readmem65816@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <sbc8@plt>

LLVM IR (-O0):
define void @sbcAbsx8() {
%1 = call i32 (...) @absolutex()
%2 = call i32 @readmem65816(i32 %1)
%3 = call i32 @sbc8(i32 %2)
ret void
}

LLVM IR (-O2):
define void @sbcAbsx8() {
%1 = tail call i32 (...) @absolutex()
%2 = tail call i32 @readmem65816(i32 %1)
%3 = tail call i32 @sbc8(i32 %2)
ret void
}
void rop3_53_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = *D ^ S;
  stk3 = ~stk3;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_53_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0xd(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_53_1_0>:
mov    (%rdi),%al
mov    %eax,%ecx
xor    %sil,%cl
not    %cl
or     %dl,%cl
xor    %cl,%al
and    %sil,%al
xor    %cl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_53_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = xor i32 %12, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = xor i32 %18, -1
%20 = trunc i32 %19 to i8
store i8 %20, i8* %9
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %8
%27 = load i8, i8* %5
%28 = zext i8 %27 to i32
%29 = load i8, i8* %8
%30 = zext i8 %29 to i32
%31 = xor i32 %28, %30
%32 = trunc i32 %31 to i8
store i8 %32, i8* %7
%33 = load i8, i8* %7
%34 = zext i8 %33 to i32
%35 = load i8, i8* %5
%36 = zext i8 %35 to i32
%37 = xor i32 %36, -1
%38 = and i32 %34, %37
%39 = load i8*, i8** %4
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = load i8, i8* %5
%43 = zext i8 %42 to i32
%44 = and i32 %41, %43
%45 = or i32 %38, %44
%46 = trunc i32 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
ret void
}

LLVM IR (-O2):
define void @rop3_53_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, %1
%6 = xor i8 %5, -1
%7 = or i8 %6, %2
%8 = xor i8 %1, -1
%9 = and i8 %7, %8
%10 = and i8 %4, %1
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
reg0reg1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (r0 <= r1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<reg0reg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1130 <reg0reg1+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <reg0reg1+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reg0reg1>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @reg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32* %4, i32** %12
store i32* %5, i32** %13
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 1, i32* %7
br label %19
18: ; preds = %6
store i32 0, i32* %7
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %7
ret i32 %20
}

LLVM IR (-O2):
define i32 @reg0reg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = icmp sle i32 %0, %1
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int gca_cmp2_uint64(const void *aa, const void *bb, void *p) {
  (void)p;
  const uint64_t a = *(const uint64_t *)aa;
  const uint64_t b = *(const uint64_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp2_uint64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
cmp    -0x20(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp2_uint64>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp2_uint64(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %7
%13 = load i8*, i8** %5
%14 = bitcast i8* %13 to i64*
%15 = load i64, i64* %14
store i64 %15, i64* %8
%16 = load i64, i64* %7
%17 = load i64, i64* %8
%18 = icmp sgt i64 %16, %17
%19 = zext i1 %18 to i32
%20 = load i64, i64* %8
%21 = load i64, i64* %7
%22 = icmp sgt i64 %20, %21
%23 = zext i1 %22 to i32
%24 = sub nsw i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @gca_cmp2_uint64(i8* nocapture %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to i64*
%5 = load i64, i64* %4
%6 = bitcast i8* %1 to i64*
%7 = load i64, i64* %6
%8 = icmp sgt i64 %5, %7
%9 = zext i1 %8 to i32
%10 = icmp sgt i64 %7, %5
%11 = sext i1 %10 to i32
%12 = add nsw i32 %11, %9
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ entry_export();
int main(int argc, char **argv) {
  entry_export();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <entry_export@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <entry_export@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @entry_export()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @entry_export()
ret i32 0
}