xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  int m = a;
  a = a * a;
  m = a * m;
  printf("\n%d", a);
  printf("\n%d", m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%esi
imul   %ebx,%esi
mov    %esi,0x4(%rsp)
imul   %esi,%ebx
lea    0xeb4(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
store i32 %5, i32* %1
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
int event_del(struct event *x) {
  (void)x;
  return 0;
}


x86 assembly (clang, -O0):
<event_del>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<event_del>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.event = type opaque
define i32 @event_del(%struct.event* %0) {
%2 = alloca %struct.event*
store %struct.event* %0, %struct.event** %2
%3 = load %struct.event*, %struct.event** %2
ret i32 0
}

LLVM IR (-O2):
%struct.event = type opaque
define i32 @event_del(%struct.event* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ expected_pk_fault(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ pkey_access_deny(int /*<<< orphan*/);
int /*<<< orphan*/ sigsafe_printf(char *, int /*<<< orphan*/);
void test_write_of_access_disabled_region(int *ptr, uint16_t pkey) {
  do {
    if (1 <= 0)
      sigsafe_printf("disabling access to PKEY[%02d], doing write\n", pkey);
    fflush(NULL);
  } while (0);
  pkey_access_deny(pkey);
  *ptr = 1035;
  expected_pk_fault(pkey);
}


x86 assembly (clang, -O0):
<test_write_of_access_disabled_region>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <fflush@plt>
mov    -0xc(%rbp),%edi
call   1040 <pkey_access_deny@plt>
mov    -0x8(%rbp),%rax
movl   $0x40b,(%rax)
mov    -0xc(%rbp),%edi
call   1050 <expected_pk_fault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_write_of_access_disabled_region>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
xor    %edi,%edi
call   1030 <fflush@plt>
mov    %ebx,%edi
call   1040 <pkey_access_deny@plt>
movl   $0x40b,(%r14)
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <expected_pk_fault@plt>

LLVM IR (-O0):
define void @test_write_of_access_disabled_region(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = call i32 @fflush(i32* null)
br label %7
7: ; preds = %5
%8 = load i32, i32* %4
%9 = call i32 @pkey_access_deny(i32 %8)
%10 = load i32*, i32** %3
store i32 1035, i32* %10
%11 = load i32, i32* %4
%12 = call i32 @expected_pk_fault(i32 %11)
ret void
}

LLVM IR (-O2):
define void @test_write_of_access_disabled_region(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @fflush(i32* null)
%4 = tail call i32 @pkey_access_deny(i32 %1)
store i32 1035, i32* %0
%5 = tail call i32 @expected_pk_fault(i32 %1)
ret void
}
void uDMAChannelSelectSecondary(unsigned long ulSecPeriphs) {
  (*((volatile unsigned long *)(0x400FF500))) |= ulSecPeriphs;
}


x86 assembly (clang, -O0):
<uDMAChannelSelectSecondary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x400ff500,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0x400ff500,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelSelectSecondary>:
or     %rdi,0x400ff500
40
ret

LLVM IR (-O0):
define void @uDMAChannelSelectSecondary(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load volatile i64, i64* inttoptr (i64 1074787584 to i64*)
%5 = or i64 %4, %3
store volatile i64 %5, i64* inttoptr (i64 1074787584 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelSelectSecondary(i64 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074787584 to i64*)
%3 = or i64 %2, %0
store volatile i64 %3, i64* inttoptr (i64 1074787584 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int strend(char *, char *);
int main(int argc, char **argv) {
  if (argc < 3)
    return 0;
  printf("%d\n", strend(argv[1], argv[2]));
}


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)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    116f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <strend@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jl     1145 <main+0x25>
push   %rax
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
call   1040 <strend@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\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 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 0, i32* %3
br label %18
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 2
%15 = load i8*, i8** %14
%16 = call i32 @strend(i8* %12, i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %9, %8
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8*, i8** %1, i64 2
%8 = load i8*, i8** %7
%9 = tail call i32 @strend(i8* %6, i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %2, %4
ret i32 0
}
int myFunction2() { return 10; }


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

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

LLVM IR (-O0):
define i32 @myFunction2() {
ret i32 10
}

LLVM IR (-O2):
define i32 @myFunction2() {
ret i32 10
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ printf(char *);
double sin(double);
int main(int argc, char **argv) {
  double x;
  if (argc > 1)
    x = atof(argv[1]);
  else
    x = 3;
  x = sin(x);
  if (x > 0)
    printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1167 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
jmp    1174 <main+0x44>
movsd  0xe91(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1050 <sin@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    11a1 <main+0x71>
lea    0xe6c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     1141 <main+0x11>
mov    0x8(%rsi),%rdi
call   1040 <atof@plt>
jmp    1149 <main+0x19>
movsd  0xeb7(%rip),%xmm0
call   1050 <sin@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1164 <main+0x34>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"OK\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call double @atof(i8* %12)
store double %13, double* %6
br label %15
14: ; preds = %2
store double 3.000000e+00, double* %6
br label %15
15: ; preds = %14, %9
%16 = load double, double* %6
%17 = call double @sin(double %16)
store double %17, double* %6
%18 = load double, double* %6
%19 = fcmp ogt double %18, 0.000000e+00
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %20, %15
ret i32 0
}

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call double @atof(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi double [ %7, %4 ], [ 3.000000e+00, %2 ]
%10 = tail call double @sin(double %9)
%11 = fcmp ogt double %10, 0.000000e+00
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %14
14: ; preds = %12, %8
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ *bar(int);
int /*<<< orphan*/ foo(int);
int main(void) {
  if (bar(20) == NULL) {
    foo(100);
    bar(200);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x14,%edi
call   1030 <bar@plt>
cmp    $0x0,%rax
jne    1157 <main+0x37>
mov    $0x64,%edi
call   1040 <foo@plt>
mov    $0xc8,%edi
call   1030 <bar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x14,%edi
call   1030 <bar@plt>
test   %rax,%rax
jne    1144 <main+0x24>
mov    $0x64,%edi
call   1040 <foo@plt>
mov    $0xc8,%edi
call   1030 <bar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32* @bar(i32 20)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 @foo(i32 100)
%6 = call i32* @bar(i32 200)
br label %7
7: ; preds = %4, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @bar(i32 20)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @foo(i32 100)
%5 = tail call i32* @bar(i32 200)
br label %6
6: ; preds = %3, %0
ret i32 0
}
int baud_down(int baud) {
  if (baud > 115200)
    baud = 115200;
  else if (baud == 57600)
    baud = 38400;
  else
    baud = baud / 2;
  if (baud < 300)
    baud = 300;
  return baud;
}


x86 assembly (clang, -O0):
<baud_down>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1c200,-0x4(%rbp)
jle    1120 <baud_down+0x20>
movl   $0x1c200,-0x4(%rbp)
jmp    114c <baud_down+0x4c>
cmpl   $0xe100,-0x4(%rbp)
jne    1139 <baud_down+0x39>
movl   $0x9600,-0x4(%rbp)
jmp    1147 <baud_down+0x47>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    114c <baud_down+0x4c>
cmpl   $0x12c,-0x4(%rbp)
jge    1160 <baud_down+0x60>
movl   $0x12c,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<baud_down>:
mov    $0x1c200,%eax
cmp    $0x1c200,%edi
jg     1130 <baud_down+0x30>
mov    $0x9600,%eax
cmp    $0xe100,%edi
je     1130 <baud_down+0x30>
mov    $0x12c,%eax
cmp    $0x25a,%edi
jl     1130 <baud_down+0x30>
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @baud_down(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 115200
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 115200, i32* %2
br label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 57600
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 38400, i32* %2
br label %13
10: ; preds = %6
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 2
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %9
br label %14
14: ; preds = %13, %5
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 300
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 300, i32* %2
br label %18
18: ; preds = %17, %14
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @baud_down(i32 %0) {
%2 = icmp sgt i32 %0, 115200
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 57600
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = sdiv i32 %0, 2
%7 = icmp sgt i32 %0, 601
br i1 %7, label %8, label %10
8: ; preds = %3, %1, %5
%9 = phi i32 [ %6, %5 ], [ 38400, %3 ], [ 115200, %1 ]
br label %10
10: ; preds = %5, %8
%11 = phi i32 [ %9, %8 ], [ 300, %5 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ strcmp(void *, void *);
int string_equal(void *s1, void *s2) {
  if (strcmp(s1, s2) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<string_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1143 <string_equal+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <string_equal+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_equal>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @string_equal(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @string_equal(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ hello;

/* Variables and functions */
int /*<<< orphan*/ syscall_write(int, char *, int);
int main() {
  char hello[] = "Hello world!\n";
  syscall_write(1, hello, sizeof(hello) - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x12(%rbp),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <syscall_write@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0xa21646c726f77,%rax
mov    %rax,0xe(%rsp)
movabs $0x6f77206f6c6c6548,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0xd,%edx
call   1030 <syscall_write@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.hello = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i8]
store i32 0, i32* %1
%3 = bitcast [14 x i8]* %2 to i8*
%4 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%5 = call i32 @syscall_write(i32 1, i8* %4, i32 13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.hello = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @syscall_write(i32 1, i8* %2, i32 13)
ret i32 0
}
/* Variables and functions */
int julian_get_month_number(double);
double julian_increment_month(double current) {
  int month_number;
  month_number = julian_get_month_number(current);
  while (month_number == julian_get_month_number(current))
    current++;
  return current;
}


x86 assembly (clang, -O0):
<julian_increment_month>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <julian_get_month_number@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <julian_get_month_number@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jne    115e <julian_increment_month+0x4e>
movsd  0xeb1(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    112a <julian_increment_month+0x1a>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_increment_month>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
call   1030 <julian_get_month_number@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <julian_get_month_number@plt>
cmp    %eax,%ebx
jne    1165 <julian_increment_month+0x55>
movsd  0x8(%rsp),%xmm0
nopw   0x0(%rax,%rax,1)
addsd  0xeb8(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x8(%rsp),%xmm0
call   1030 <julian_get_month_number@plt>
movsd  0x8(%rsp),%xmm0
cmp    %eax,%ebx
je     1140 <julian_increment_month+0x30>
jmp    116b <julian_increment_month+0x5b>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @julian_increment_month(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 @julian_get_month_number(double %4)
store i32 %5, i32* %3
br label %6
6: ; preds = %11, %1
%7 = load i32, i32* %3
%8 = load double, double* %2
%9 = call i32 @julian_get_month_number(double %8)
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = load double, double* %2
%13 = fadd double %12, 1.000000e+00
store double %13, double* %2
br label %6
14: ; preds = %6
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @julian_increment_month(double %0) {
%2 = tail call i32 @julian_get_month_number(double %0)
%3 = tail call i32 @julian_get_month_number(double %0)
%4 = icmp eq i32 %2, %3
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = phi double [ %7, %5 ], [ %0, %1 ]
%7 = fadd double %6, 1.000000e+00
%8 = tail call i32 @julian_get_month_number(double %7)
%9 = icmp eq i32 %2, %8
br i1 %9, label %5, label %10
10: ; preds = %5, %1
%11 = phi double [ %0, %1 ], [ %7, %5 ]
ret double %11
}
/* Variables and functions */
char tolower(char);
char *string_tolower(char *buf, char *buf1) {
  char *c = buf;
  char *c1 = buf1;
  while (*c) {
    *c1 = tolower(*c);
    c++;
    c1++;
  }
  return buf;
}


x86 assembly (clang, -O0):
<string_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     116e <string_tolower+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <string_tolower+0x20>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_tolower>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    (%rdi),%al
test   %al,%al
je     114a <string_tolower+0x3a>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,(%r14,%rbx,1)
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <string_tolower+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @string_tolower(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
%8 = load i8*, i8** %4
store i8* %8, i8** %6
br label %9
9: ; preds = %13, %2
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = call signext i8 @tolower(i8 signext %15)
%17 = load i8*, i8** %6
store i8 %16, i8* %17
%18 = load i8*, i8** %5
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %5
%20 = load i8*, i8** %6
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %6
br label %9
22: ; preds = %9
%23 = load i8*, i8** %3
ret i8* %23
}

LLVM IR (-O2):
define i8* @string_tolower(i8* returned %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %12, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = tail call signext i8 @tolower(i8 signext %6)
store i8 %9, i8* %7
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %10
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %2
ret i8* %0
}
void do_stack_fault(void *x) {
  do {
    kprintf("Unsupport Now...[%s]\n", __FUNCTION__);
    while (1)
      ;
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<do_stack_fault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <kprintf@plt>
jmp    1131 <do_stack_fault+0x21>

x86 assembly (clang, -O2):
<do_stack_fault>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef7(%rip),%rsi
xor    %eax,%eax
call   1030 <kprintf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1130 <do_stack_fault+0x20>

LLVM IR (-O0):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_stack_fault = [15 x i8] c"do_stack_fault\00"
define void @do_stack_fault(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.do_stack_fault, i64 0, i64 0))
br label %5
5: ; preds = %3, %5
br label %5
6: ; No predecessors!
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unsupport Now...[%s]\0A\00"
@__FUNCTION__.do_stack_fault = [15 x i8] c"do_stack_fault\00"
define void @do_stack_fault(i8* nocapture readnone %0) {
%2 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__FUNCTION__.do_stack_fault, i64 0, i64 0))
br label %3
3: ; preds = %1, %3
br label %3
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int32_t;
typedef int /*<<< orphan*/ tmp;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
u_int32_t untoh32(void *network) {
  char *unaligned = (char *)network;
  u_int32_t tmp;
  memcpy(&tmp, unaligned, sizeof(tmp));
  return ntohl(tmp);
}


x86 assembly (clang, -O0):
<untoh32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%edi
call   1040 <ntohl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<untoh32>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <ntohl@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @untoh32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @memcpy(i32* %4, i8* %6, i32 4)
%8 = load i32, i32* %4
%9 = call i32 @ntohl(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @untoh32(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @ntohl(i32 %5)
ret i32 %6
}
double half(int a) { return a / 2.0; }


x86 assembly (clang, -O0):
<half>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<half>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @half(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fdiv double %4, 2.000000e+00
ret double %5
}

LLVM IR (-O2):
define double @half(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 5.000000e-01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned long f6(unsigned long x) {
  unsigned long r = x + -2UL;
  if (r <= x)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
ja     113d <f6+0x2d>
xor    %edi,%edi
call   1030 <foo@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f6>:
push   %rbx
mov    %rdi,%rbx
cmp    $0x2,%rdi
jb     1121 <f6+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
add    $0xfffffffffffffffe,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @f6(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 %4, -2
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %2
%8 = icmp ule i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @foo(i32 0)
br label %11
11: ; preds = %9, %1
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @f6(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @foo(i32 0)
br label %5
5: ; preds = %3, %1
%6 = add i64 %0, -2
ret i64 %6
}
int ht_debug_info() { return 0; }


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

x86 assembly (clang, -O2):
<ht_debug_info>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ht_debug_info() {
ret i32 0
}

LLVM IR (-O2):
define i32 @ht_debug_info() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
void itoa(int v, char *s, int b) { sprintf(s, "%d", v); }


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed0(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
mov    %rsi,%rax
mov    %edi,%edx
lea    0xee4(%rip),%rsi
mov    %rax,%rdi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @itoa(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @itoa(i32 %0, i8* nocapture writeonly %1, i32 %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct dualtimer_cmsdk_dev_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
dualtimer_cmsdk_disable_timer1(struct dualtimer_cmsdk_dev_t const *);
int /*<<< orphan*/
dualtimer_cmsdk_disable_timer2(struct dualtimer_cmsdk_dev_t const *);
void dualtimer_cmsdk_disable_both_timers(
    const struct dualtimer_cmsdk_dev_t *dev) {
  dualtimer_cmsdk_disable_timer1(dev);
  dualtimer_cmsdk_disable_timer2(dev);
}


x86 assembly (clang, -O0):
<dualtimer_cmsdk_disable_both_timers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dualtimer_cmsdk_disable_timer1@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dualtimer_cmsdk_disable_timer2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dualtimer_cmsdk_disable_both_timers>:
push   %rbx
mov    %rdi,%rbx
call   1040 <dualtimer_cmsdk_disable_timer1@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dualtimer_cmsdk_disable_timer2@plt>

LLVM IR (-O0):
%struct.dualtimer_cmsdk_dev_t = type { i32 }
define void @dualtimer_cmsdk_disable_both_timers(%struct.dualtimer_cmsdk_dev_t* %0) {
%2 = alloca %struct.dualtimer_cmsdk_dev_t*
store %struct.dualtimer_cmsdk_dev_t* %0, %struct.dualtimer_cmsdk_dev_t** %2
%3 = load %struct.dualtimer_cmsdk_dev_t*, %struct.dualtimer_cmsdk_dev_t** %2
%4 = call i32 @dualtimer_cmsdk_disable_timer1(%struct.dualtimer_cmsdk_dev_t* %3)
%5 = load %struct.dualtimer_cmsdk_dev_t*, %struct.dualtimer_cmsdk_dev_t** %2
%6 = call i32 @dualtimer_cmsdk_disable_timer2(%struct.dualtimer_cmsdk_dev_t* %5)
ret void
}

LLVM IR (-O2):
%struct.dualtimer_cmsdk_dev_t = type { i32 }
define void @dualtimer_cmsdk_disable_both_timers(%struct.dualtimer_cmsdk_dev_t* %0) {
%2 = tail call i32 @dualtimer_cmsdk_disable_timer1(%struct.dualtimer_cmsdk_dev_t* %0)
%3 = tail call i32 @dualtimer_cmsdk_disable_timer2(%struct.dualtimer_cmsdk_dev_t* %0)
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t result = 0;
  while (s[result])
    result++;
  return result;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
unsigned int _dictNextPower(unsigned int size) {
  unsigned int i = 16;
  if (size >= 2147483648U)
    return 2147483648U;
  while (1) {
    if (i >= size)
      return i;
    i *= 2;
  }
}


x86 assembly (clang, -O0):
<_dictNextPower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x10,-0xc(%rbp)
cmpl   $0x80000000,-0x8(%rbp)
jb     1127 <_dictNextPower+0x27>
movl   $0x80000000,-0x4(%rbp)
jmp    1151 <_dictNextPower+0x51>
jmp    112c <_dictNextPower+0x2c>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1143 <_dictNextPower+0x43>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1151 <_dictNextPower+0x51>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112c <_dictNextPower+0x2c>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dictNextPower>:
test   %edi,%edi
js     111a <_dictNextPower+0x1a>
mov    $0x10,%ecx
nopl   0x0(%rax)
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <_dictNextPower+0x10>
ret
mov    $0x80000000,%eax
ret

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

LLVM IR (-O2):
define i32 @_dictNextPower(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 16, %1 ]
%5 = icmp ult i32 %4, %0
%6 = shl i32 %4, 1
br i1 %5, label %3, label %7
7: ; preds = %3, %1
%8 = phi i32 [ -2147483648, %1 ], [ %4, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ computed_goto();
int /*<<< orphan*/ hidden(int);
int /*<<< orphan*/ noinline();
int /*<<< orphan*/ old(int, int);
int /*<<< orphan*/ print(char *, ...);
int /*<<< orphan*/ rec(int /*<<< orphan*/);
int /*<<< orphan*/ should_inline();
main() {
  should_inline();
  rec(0);
  hidden(3);
  noinline();
  print("hi", 3);
  print("hi");
  old(3, 1);
  computed_goto();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <should_inline@plt>
xor    %edi,%edi
call   1070 <rec@plt>
mov    $0x3,%edi
call   1090 <hidden@plt>
mov    $0x0,%al
call   1080 <noinline@plt>
lea    0xe66(%rip),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1040 <print@plt>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1050 <old@plt>
mov    $0x0,%al
call   1060 <computed_goto@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <should_inline@plt>
xor    %edi,%edi
call   1070 <rec@plt>
mov    $0x3,%edi
call   1090 <hidden@plt>
xor    %eax,%eax
call   1080 <noinline@plt>
lea    0xe69(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <print@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <print@plt>
mov    $0x3,%edi
mov    $0x1,%esi
call   1050 <old@plt>
xor    %eax,%eax
call   1060 <computed_goto@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = call i32 (...) @should_inline()
%2 = call i32 @rec(i32 0)
%3 = call i32 @hidden(i32 3)
%4 = call i32 (...) @noinline()
%5 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @old(i32 3, i32 1)
%8 = call i32 (...) @computed_goto()
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"hi\00"
define i32 @main() {
%1 = tail call i32 (...) @should_inline()
%2 = tail call i32 @rec(i32 0)
%3 = tail call i32 @hidden(i32 3)
%4 = tail call i32 (...) @noinline()
%5 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 3)
%6 = tail call i32 (i8*, ...) @print(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @old(i32 3, i32 1)
%8 = tail call i32 (...) @computed_goto()
ret i32 0
}
void mmtree64_mutex_lock(void *x, int id) {
  if (x) {
  }
  return;
}


x86 assembly (clang, -O0):
<mmtree64_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     111b <mmtree64_mutex_lock+0x1b>
jmp    111b <mmtree64_mutex_lock+0x1b>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @mmtree64_mutex_lock(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
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %2
br label %8
8: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @mmtree64_mutex_lock(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num, fact;
  printf("Enter the number to find its factorial: ");
  scanf("%d", &num);
  fact = factorial(num);
  printf("%d! = %d", num, fact);
  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   1040 <printf@plt>
lea    0xedb(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1040 <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   1040 <printf@plt>
lea    0xee9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <factorial@plt>
mov    0x4(%rsp),%esi
lea    0xec5(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Enter the number to find its factorial: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"%d! = %d\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 ([41 x i8], [41 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 @factorial(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 ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Enter the number to find its factorial: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"%d! = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 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 @factorial(i32 %5)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %6)
ret i32 0
}
void XmbLookupString() {}


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

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

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

LLVM IR (-O2):
define void @XmbLookupString() {
ret void
}
void g_scanner_scope_lookup_symbol() {}


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

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

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

LLVM IR (-O2):
define void @g_scanner_scope_lookup_symbol() {
ret void
}
char *strrchr(char *str, int ch) {
  char *sp = (char *)0;
  for (; *str; str++)
    if (*str == (char)ch)
      sp = str;
  return sp;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <strrchr+0x53>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    113d <strrchr+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1142 <strrchr+0x42>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <strrchr+0x26>
movsbl %sil,%edx
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %ecx,%edx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %18, label %5
5: ; preds = %2
%6 = shl i32 %1, 24
%7 = ashr exact i32 %6, 24
br label %8
8: ; preds = %5, %8
%9 = phi i8 [ %3, %5 ], [ %16, %8 ]
%10 = phi i8* [ null, %5 ], [ %14, %8 ]
%11 = phi i8* [ %0, %5 ], [ %15, %8 ]
%12 = sext i8 %9 to i32
%13 = icmp eq i32 %7, %12
%14 = select i1 %13, i8* %11, i8* %10
%15 = getelementptr inbounds i8, i8* %11, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %2
%19 = phi i8* [ null, %2 ], [ %14, %8 ]
ret i8* %19
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char const *, char const *);
int room_cmp(const char *room, const char *smallr) {
  if (!strcmp(room, smallr))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<room_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1142 <room_cmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1149 <room_cmp+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<room_cmp>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @room_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %2
store i32 0, i32* %3
br label %12
11: ; preds = %2
store i32 1, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @room_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int foo(int x) { return x + x * 2; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    (%rdi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %4, 2
%6 = add nsw i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
int int_clamp(int a, int min, int max) {
  if (a < min) {
    return min;
  }
  if (a > max) {
    return max;
  }
  return a;
}


x86 assembly (clang, -O0):
<int_clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <int_clamp+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <int_clamp+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <int_clamp+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <int_clamp+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_clamp>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @int_clamp(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ xmalloc(int);
int *allouer_element(int val) {
  int *result = (int *)xmalloc(sizeof(int));
  (*result) = val;
  return result;
}


x86 assembly (clang, -O0):
<allouer_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x4,%edi
call   1030 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allouer_element>:
push   %rbx
mov    %edi,%ebx
mov    $0x4,%edi
call   1030 <xmalloc@plt>
mov    %ebx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i32* @allouer_element(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = call i64 @xmalloc(i32 4)
%5 = inttoptr i64 %4 to i32*
store i32* %5, i32** %3
%6 = load i32, i32* %2
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = load i32*, i32** %3
ret i32* %8
}

LLVM IR (-O2):
define i32* @allouer_element(i32 %0) {
%2 = tail call i64 @xmalloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32 %0, i32* %3
ret i32* %3
}