xunge/DecIR huggingface dataset:
long int g(int month) {
  if (month < 3)
    return month + 13;
  else
    return month + 1;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    1122 <g+0x22>
mov    -0xc(%rbp),%eax
add    $0xd,%eax
cltq
mov    %rax,-0x8(%rbp)
jmp    112e <g+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    0x1(%rdi),%eax
lea    0xd(%rdi),%ecx
cmp    $0x3,%edi
cmovge %eax,%ecx
movslq %ecx,%rax
ret

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

LLVM IR (-O2):
define i64 @g(i32 %0) {
%2 = icmp slt i32 %0, 3
%3 = select i1 %2, i32 13, i32 1
%4 = add nsw i32 %3, %0
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned long);
void udelay(unsigned long delay) { usleep(delay); }


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

x86 assembly (clang, -O2):
<udelay>:
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @udelay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @usleep(i64 %3)
ret void
}

LLVM IR (-O2):
define void @udelay(i64 %0) {
%2 = tail call i32 @usleep(i64 %0)
ret void
}
unsigned calc_sum(char *str) {
  unsigned sum = 0;
  while (*str != '\0') {
    sum += *str - '0';
    str++;
  }
  return sum;
}


x86 assembly (clang, -O0):
<calc_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <calc_sum+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <calc_sum+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sum>:
mov    (%rdi),%cl
test   %cl,%cl
je     1124 <calc_sum+0x24>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <calc_sum+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_sum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add i32 %6, -48
%10 = add i32 %9, %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_args(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; i++) {
    printf("%s\n", argv[i]);
  }
}


x86 assembly (clang, -O0):
<print_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1158 <print_args+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <print_args+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_args>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <print_args+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print_args+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @print_args(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i8**, i8*** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8*, i8** %11, i64 %13
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_args(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
void check_negative_sized_VLA_8() {
  signed char x = 1;
  int vla[x - 2];
}


x86 assembly (clang, -O0):
<check_negative_sized_VLA_8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x2,%eax
mov    %eax,%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @check_negative_sized_VLA_8() {
%1 = alloca i8
%2 = alloca i8*
%3 = alloca i64
store i8 1, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = sub nsw i32 %5, 2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %2
%9 = alloca i32, i64 %7
store i64 %7, i64* %3
%10 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @check_negative_sized_VLA_8() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double squareRoot(double);
int main(void) {
  printf("squareRoot(2.0) = %f\n", squareRoot(2.0));
  printf("squareRoot(144.0) = %f\n", squareRoot(144.0));
  printf("squareRoot(17.5) = %f\n", squareRoot(17.5));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb8(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe97(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
movsd  0xec6(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb5(%rip),%xmm0
call   1040 <squareRoot@plt>
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"squareRoot(2.0) = %f\0A\00"
@.str.1 = [24 x i8] c"squareRoot(144.0) = %f\0A\00"
@.str.2 = [23 x i8] c"squareRoot(17.5) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @squareRoot(double 2.000000e+00)
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %2)
%4 = call double @squareRoot(double 1.440000e+02)
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = call double @squareRoot(double 1.750000e+01)
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"squareRoot(2.0) = %f\0A\00"
@.str.1 = [24 x i8] c"squareRoot(144.0) = %f\0A\00"
@.str.2 = [23 x i8] c"squareRoot(17.5) = %f\0A\00"
define i32 @main() {
%1 = tail call double @squareRoot(double 2.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %1)
%3 = tail call double @squareRoot(double 1.440000e+02)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), double %3)
%5 = tail call double @squareRoot(double 1.750000e+01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ apic_init();
scalar_t__ apic_is_available();
int /*<<< orphan*/ i8042_init();
void arch_init() {
  i8042_init();
  if (apic_is_available()) {
    apic_init();
  } else {
  }
}


x86 assembly (clang, -O0):
<arch_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <i8042_init@plt>
mov    $0x0,%al
call   1030 <apic_is_available@plt>
cmp    $0x0,%rax
je     1158 <arch_init+0x28>
mov    $0x0,%al
call   1050 <apic_init@plt>
jmp    115d <arch_init+0x2d>
jmp    115d <arch_init+0x2d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arch_init>:
push   %rax
xor    %eax,%eax
call   1040 <i8042_init@plt>
xor    %eax,%eax
call   1030 <apic_is_available@plt>
test   %rax,%rax
je     114c <arch_init+0x1c>
xor    %eax,%eax
pop    %rcx
jmp    1050 <apic_init@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @arch_init() {
%1 = call i32 (...) @i8042_init()
%2 = call i64 (...) @apic_is_available()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @apic_init()
br label %7
6: ; preds = %0
br label %7
7: ; preds = %6, %4
ret void
}

LLVM IR (-O2):
define void @arch_init() {
%1 = tail call i32 (...) @i8042_init()
%2 = tail call i64 (...) @apic_is_available()
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 (...) @apic_init()
br label %6
6: ; preds = %0, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setsid();
int /*<<< orphan*/ sleep(int);
void set_deamon() {
  int pid = fork();
  if (pid < 0) {
    printf("%m\n");
    exit(-1);
  } else if (pid > 0) {
    exit(0);
  } else {
    setsid();
    while (1) {
      sleep(1);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<set_deamon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1182 <set_deamon+0x32>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
cmpl   $0x0,-0x4(%rbp)
jle    1193 <set_deamon+0x43>
xor    %edi,%edi
call   1050 <exit@plt>
mov    $0x0,%al
call   1040 <setsid@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    119a <set_deamon+0x4a>

x86 assembly (clang, -O2):
<set_deamon>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
js     117c <set_deamon+0x2c>
jne    1192 <set_deamon+0x42>
xor    %eax,%eax
call   1040 <setsid@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%edi
call   1060 <sleep@plt>
jmp    1170 <set_deamon+0x20>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%m\0A\00"
define void @set_deamon() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %8
%14 = call i32 (...) @setsid()
br label %15
15: ; preds = %13, %15
%16 = call i32 @sleep(i32 1)
br label %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"%m\0A\00"
define void @set_deamon() {
%1 = tail call i32 (...) @fork()
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 -1)
unreachable
6: ; preds = %0
%7 = icmp eq i32 %1, 0
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %6
%11 = tail call i32 (...) @setsid()
br label %12
12: ; preds = %12, %10
%13 = tail call i32 @sleep(i32 1)
br label %12
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(char *);
int main(void) {
  puts("hello lkmc_many_files");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"hello lkmc_many_files\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @puts(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [22 x i8] c"hello lkmc_many_files\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int check_starting_digits(char isbn[20]) {
  if (isbn[0] == '9' && isbn[1] == '7') {
    if (isbn[2] == '9' || isbn[2] == '8') {
      return 1;
    } else {
      return 0;
    }
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<check_starting_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jne    1163 <check_starting_digits+0x63>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x37,%eax
jne    1163 <check_starting_digits+0x63>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x39,%eax
je     114b <check_starting_digits+0x4b>
mov    -0x10(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x38,%eax
jne    1157 <check_starting_digits+0x57>
movl   $0x1,-0x4(%rbp)
jmp    116a <check_starting_digits+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    116a <check_starting_digits+0x6a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_starting_digits>:
xor    %eax,%eax
cmpb   $0x39,(%rdi)
jne    111b <check_starting_digits+0x1b>
cmpb   $0x37,0x1(%rdi)
jne    111b <check_starting_digits+0x1b>
mov    0x2(%rdi),%cl
and    $0xfe,%cl
xor    %eax,%eax
cmp    $0x38,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @check_starting_digits(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 57
br i1 %8, label %9, label %29
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 55
br i1 %14, label %15, label %29
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 57
br i1 %20, label %27, label %21
21: ; preds = %15
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 56
br i1 %26, label %27, label %28
27: ; preds = %21, %15
store i32 1, i32* %2
br label %30
28: ; preds = %21
store i32 0, i32* %2
br label %30
29: ; preds = %9, %1
store i32 0, i32* %2
br label %30
30: ; preds = %29, %28, %27
%31 = load i32, i32* %2
ret i32 %31
}

LLVM IR (-O2):
define i32 @check_starting_digits(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 57
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 55
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = and i8 %10, -2
%12 = icmp eq i8 %11, 56
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %1, %4
%15 = phi i32 [ 0, %4 ], [ 0, %1 ], [ %13, %8 ]
ret i32 %15
}
main() {
  typedef int T0;
  T0 a;
  if (0) {
    typedef int T1;
    T1 a;
  } else {
    typedef int T2;
    T2 a;
  }
  for (;;) {
    typedef int T3;
    T3 a;
  }
  do {
    typedef int T4;
    T4 a;
  } while (0);
  {
    typedef int T5;
    T5 a;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %6, %0
br label %6
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ l6480_send_cmd(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
void l6480_cmd_gohome(void) {
  l6480_send_cmd(0x70, 1, 0, 0);
  return;
}


x86 assembly (clang, -O0):
<l6480_cmd_gohome>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <l6480_send_cmd@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<l6480_cmd_gohome>:
mov    $0x70,%edi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <l6480_send_cmd@plt>

LLVM IR (-O0):
define void @l6480_cmd_gohome() {
%1 = call i32 @l6480_send_cmd(i32 112, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @l6480_cmd_gohome() {
%1 = tail call i32 @l6480_send_cmd(i32 112, i32 1, i32 0, i32 0)
ret void
}
void hw_keys_timer_callback(void) {}


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

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

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

LLVM IR (-O2):
define void @hw_keys_timer_callback() {
ret void
}
int isNumber(char c) {
  if (c >= 0 && c <= 9) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jl     1130 <isNumber+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jg     1130 <isNumber+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <isNumber+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @isNumber(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 9
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @isNumber(i8 signext %0) {
%2 = icmp ult i8 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
int IsDigit(char C) { return (C >= '0' && C <= '9'); }


x86 assembly (clang, -O0):
<IsDigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <IsDigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsDigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @IsDigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @IsDigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
double ProjX(double trs[3][3], double x, double y, double z, double f) {
  return (((trs)[0][0] * (x) + (trs)[0][1] * (y) + (trs)[0][2] * (f)) / (z));
}


x86 assembly (clang, -O0):
<ProjX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
divsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProjX>:
mulsd  0x8(%rdi),%xmm1
mulsd  (%rdi),%xmm0
addsd  %xmm1,%xmm0
mulsd  0x10(%rdi),%xmm3
addsd  %xmm3,%xmm0
divsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @ProjX([3 x double]* %0, double %1, double %2, double %3, double %4) {
%6 = alloca [3 x double]*
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store [3 x double]* %0, [3 x double]** %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load [3 x double]*, [3 x double]** %6
%12 = getelementptr inbounds [3 x double], [3 x double]* %11, i64 0
%13 = getelementptr inbounds [3 x double], [3 x double]* %12, i64 0, i64 0
%14 = load double, double* %13
%15 = load double, double* %7
%16 = load [3 x double]*, [3 x double]** %6
%17 = getelementptr inbounds [3 x double], [3 x double]* %16, i64 0
%18 = getelementptr inbounds [3 x double], [3 x double]* %17, i64 0, i64 1
%19 = load double, double* %18
%20 = load double, double* %8
%21 = fmul double %19, %20
%22 = call double @llvm.fmuladd.f64(double %14, double %15, double %21)
%23 = load [3 x double]*, [3 x double]** %6
%24 = getelementptr inbounds [3 x double], [3 x double]* %23, i64 0
%25 = getelementptr inbounds [3 x double], [3 x double]* %24, i64 0, i64 2
%26 = load double, double* %25
%27 = load double, double* %10
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double %22)
%29 = load double, double* %9
%30 = fdiv double %28, %29
ret double %30
}

LLVM IR (-O2):
define double @ProjX([3 x double]* nocapture %0, double %1, double %2, double %3, double %4) {
%6 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 0
%7 = load double, double* %6
%8 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 1
%9 = load double, double* %8
%10 = fmul double %9, %2
%11 = tail call double @llvm.fmuladd.f64(double %7, double %1, double %10)
%12 = getelementptr inbounds [3 x double], [3 x double]* %0, i64 0, i64 2
%13 = load double, double* %12
%14 = tail call double @llvm.fmuladd.f64(double %13, double %4, double %11)
%15 = fdiv double %14, %3
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
void *thread_main(void *arg) {
  int i;
  int cnt = *((int *)arg);
  for (i = 0; i < cnt; i++) {
    sleep(1);
    puts("running thread");
  }
  return NULL;
}


x86 assembly (clang, -O0):
<thread_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    116c <thread_main+0x4c>
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <thread_main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_main>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%ebp
test   %ebp,%ebp
jle    1147 <thread_main+0x27>
lea    0xed0(%rip),%rbx
mov    $0x1,%edi
call   1040 <sleep@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
add    $0xffffffff,%ebp
jne    1130 <thread_main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"running thread\00"
define i8* @thread_main(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
store i32 %7, i32* %4
store i32 0, i32* %3
br label %8
8: ; preds = %15, %1
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %18
12: ; preds = %8
%13 = call i32 @sleep(i32 1)
%14 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %12
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %8
18: ; preds = %8
ret i8* null
}

LLVM IR (-O2):
@.str = [15 x i8] c"running thread\00"
define noalias i8* @thread_main(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1, %5
%6 = phi i32 [ %9, %5 ], [ 0, %1 ]
%7 = tail call i32 @sleep(i32 1)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = add nuw nsw i32 %6, 1
%10 = icmp eq i32 %9, %3
br i1 %10, label %11, label %5
11: ; preds = %5, %1
ret i8* null
}
void ptrace_sandbox_permit_getcwd(struct pt_sandbox *p_sandbox) {
  (void)p_sandbox;
}


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

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

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

LLVM IR (-O2):
%struct.pt_sandbox = type opaque
define void @ptrace_sandbox_permit_getcwd(%struct.pt_sandbox* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ OSSwapConstInt32(int /*<<< orphan*/);
uint32_t _OSSwapInt32(uint32_t data) { return OSSwapConstInt32(data); }


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

x86 assembly (clang, -O2):
<_OSSwapInt32>:
jmp    1030 <OSSwapConstInt32@plt>

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

LLVM IR (-O2):
define i32 @_OSSwapInt32(i32 %0) {
%2 = tail call i32 @OSSwapConstInt32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct buffer_cursor {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct buffer_cursor *);
void buffer_cursor_free(struct buffer_cursor *cursor) { free(cursor); }


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

x86 assembly (clang, -O2):
<buffer_cursor_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.buffer_cursor = type { i32 }
define void @buffer_cursor_free(%struct.buffer_cursor* %0) {
%2 = alloca %struct.buffer_cursor*
store %struct.buffer_cursor* %0, %struct.buffer_cursor** %2
%3 = load %struct.buffer_cursor*, %struct.buffer_cursor** %2
%4 = call i32 @free(%struct.buffer_cursor* %3)
ret void
}

LLVM IR (-O2):
%struct.buffer_cursor = type { i32 }
define void @buffer_cursor_free(%struct.buffer_cursor* nocapture %0) {
%2 = tail call i32 @free(%struct.buffer_cursor* %0)
ret void
}
void ARGBGrayRow_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGBGrayRow_NEON() {
ret void
}
void gtk_tree_model_get_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_get_path() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a = 0, i = 1;
  while (i >= 1 && i <= 100) {
    a = a + 2;
    printf("%d\n", a);
    i = i + 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jl     1146 <main+0x36>
cmpl   $0x64,-0xc(%rbp)
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1156 <main+0x46>
jmp    117c <main+0x6c>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffff,%ebx
lea    0xee0(%rip),%r14
lea    0x3(%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x2,%ebx
cmp    $0x63,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 1
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 100
br label %10
10: ; preds = %7, %4
%11 = phi i1 [ false, %4 ], [ %9, %7 ]
br i1 %11, label %12, label %19
12: ; preds = %10
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 2
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 2
store i32 %18, i32* %3
br label %4
19: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %6, %1 ]
%3 = phi i32 [ 0, %0 ], [ %4, %1 ]
%4 = add nuw nsw i32 %3, 2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = add nuw nsw i32 %2, 2
%7 = icmp ult i32 %2, 99
br i1 %7, label %1, label %8
8: ; preds = %1
ret i32 0
}
void vtkParseHierarchy_FreeTemplateArgs(int n, const char *args[]) {
  int i;
  for (i = 0; i < n; i++) {
    free((char *)args[i]);
  }
  free((char **)args);
}


x86 assembly (clang, -O0):
<vtkParseHierarchy_FreeTemplateArgs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1151 <vtkParseHierarchy_FreeTemplateArgs+0x41>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <vtkParseHierarchy_FreeTemplateArgs+0x16>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vtkParseHierarchy_FreeTemplateArgs>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
test   %edi,%edi
jle    1142 <vtkParseHierarchy_FreeTemplateArgs+0x32>
mov    %edi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <vtkParseHierarchy_FreeTemplateArgs+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @vtkParseHierarchy_FreeTemplateArgs(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %1 to i8*
tail call void @free(i8* %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TakeOffLocationHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void TakeOffLocationLogging() { UAVObjLogging(TakeOffLocationHandle()); }


x86 assembly (clang, -O0):
<TakeOffLocationLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <TakeOffLocationHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeOffLocationLogging>:
push   %rax
xor    %eax,%eax
call   1040 <TakeOffLocationHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @TakeOffLocationLogging() {
%1 = call i32 (...) @TakeOffLocationHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TakeOffLocationLogging() {
%1 = tail call i32 (...) @TakeOffLocationHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int yaffs_fsync(int);
int yaffs_flush(int handle) { return yaffs_fsync(handle); }


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

x86 assembly (clang, -O2):
<yaffs_flush>:
jmp    1030 <yaffs_fsync@plt>

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

LLVM IR (-O2):
define i32 @yaffs_flush(i32 %0) {
%2 = tail call i32 @yaffs_fsync(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int tolower(int);
void test_tolower_symbolic(int x) {
  int ret = tolower(x);
  (void)ret;
  clang_analyzer_eval(-1 <= x && x <= 255);
}


x86 assembly (clang, -O0):
<test_tolower_symbolic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x9(%rbp)
jg     1156 <test_tolower_symbolic+0x36>
cmpl   $0xff,-0x4(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tolower_symbolic>:
add    $0x1,%edi
xor    %eax,%eax
cmp    $0x101,%edi
setb   %al
mov    %eax,%edi
jmp    1030 <clang_analyzer_eval@plt>

LLVM IR (-O0):
define void @test_tolower_symbolic(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @tolower(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp sle i32 -1, %7
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 255
br label %12
12: ; preds = %9, %1
%13 = phi i1 [ false, %1 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 @clang_analyzer_eval(i32 %14)
ret void
}

LLVM IR (-O2):
define void @test_tolower_symbolic(i32 %0) {
%2 = add i32 %0, 1
%3 = icmp ult i32 %2, 257
%4 = zext i1 %3 to i32
%5 = tail call i32 @clang_analyzer_eval(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stack_trace();
void main() { stack_trace(); }


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

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
jmp    1030 <stack_trace@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @stack_trace()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @stack_trace()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int x;
  for (x = 20; x; --x)
    if (x < 5 || x > 15)
      printf("x"
             " = [%d]\n",
             (x));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1166 <main+0x56>
cmpl   $0x5,-0x8(%rbp)
jl     1144 <main+0x34>
cmpl   $0xf,-0x8(%rbp)
jle    1153 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x48>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x14,%ebx
lea    0xee0(%rip),%r14
jmp    1135 <main+0x25>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xffffffff,%ebx
je     1149 <main+0x39>
lea    -0x10(%rbx),%eax
cmp    $0xfffffff4,%eax
ja     1130 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"x = [%d]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 20, i32* %2
br label %3
3: ; preds = %16, %0
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 5
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sgt i32 %10, 15
br i1 %11, label %12, label %15
12: ; preds = %9, %6
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
br label %16
16: ; preds = %15
%17 = load i32, i32* %2
%18 = add nsw i32 %17, -1
store i32 %18, i32* %2
br label %3
19: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"x = [%d]\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %7
%2 = phi i32 [ 20, %0 ], [ %8, %7 ]
%3 = add nsw i32 %2, -16
%4 = icmp ult i32 %3, -11
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nsw i32 %2, -1
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %1
10: ; preds = %7
ret i32 0
}
int test_bit(int nr, const volatile unsigned long *addr) {
  return 1UL & (addr[((nr) / 32)] >> (nr & (32 - 1)));
}


x86 assembly (clang, -O0):
<test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    %ecx,%ecx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bit>:
mov    %edi,%ecx
lea    0x1f(%rcx),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x5,%eax
cltq
mov    (%rsi,%rax,8),%rax
and    $0x1f,%cl
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32, i32* %3
%7 = sdiv i32 %6, 32
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i64, i64* %5, i64 %8
%10 = load volatile i64, i64* %9
%11 = load i32, i32* %3
%12 = and i32 %11, 31
%13 = zext i32 %12 to i64
%14 = lshr i64 %10, %13
%15 = and i64 1, %14
%16 = trunc i64 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @test_bit(i32 %0, i64* %1) {
%3 = sdiv i32 %0, 32
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i64, i64* %1, i64 %4
%6 = load volatile i64, i64* %5
%7 = and i32 %0, 31
%8 = zext i32 %7 to i64
%9 = lshr i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
ret i32 %11
}
void lmb_clear_nid(struct drmem_lmb *lmb) {}


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

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

LLVM IR (-O0):
%struct.drmem_lmb = type opaque
define void @lmb_clear_nid(%struct.drmem_lmb* %0) {
%2 = alloca %struct.drmem_lmb*
store %struct.drmem_lmb* %0, %struct.drmem_lmb** %2
ret void
}

LLVM IR (-O2):
%struct.drmem_lmb = type opaque
define void @lmb_clear_nid(%struct.drmem_lmb* nocapture %0) {
ret void
}
int find_msb(unsigned int val) {
  int ret;
  asm("bsrl %1,%0\n\t"
      "jnz 1f\n\t"
      "movl $-1,%0\n"
      "1:"
      : "=r"(ret)
      : "r"(val));
  return ret + 1;
}


x86 assembly (clang, -O0):
<find_msb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
jne    1118 <find_msb+0x18>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_msb>:
bsr    %edi,%eax
jne    110a <find_msb+0xa>
mov    $0xffffffff,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @find_msb(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @find_msb(i32 %0) {
%2 = tail call i32 asm "bsrl $1,$0\0A\09jnz 1f\0A\09movl $$-1,$0\0A1:", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
short h_dim(short *, short *);
short intr_wrap_164(short p1, short p2) { return h_dim(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_164>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <h_dim@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_164>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <h_dim@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_164(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @h_dim(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_164(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @h_dim(i16* %3, i16* %4)
ret i16 %5
}
/* Type definitions */
typedef char wint_t;

/* Variables and functions */
int __iswblank_ascii(wint_t c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<__iswblank_ascii>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <__iswblank_ascii+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__iswblank_ascii>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @__iswblank_ascii(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @__iswblank_ascii(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int printlock_regspace2_uniform_64k(struct flashrom_flashctx *);
int printlock_w39v040b(struct flashrom_flashctx *);
int printlock_w39v040fb(struct flashrom_flashctx *flash) {
  int ret = 0;
  ret = printlock_w39v040b(flash);
  ret |= printlock_regspace2_uniform_64k(flash);
  return ret;
}


x86 assembly (clang, -O0):
<printlock_w39v040fb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <printlock_w39v040b@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <printlock_regspace2_uniform_64k@plt>
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printlock_w39v040fb>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <printlock_w39v040b@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <printlock_regspace2_uniform_64k@plt>
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040fb(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
%3 = alloca i32
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
store i32 0, i32* %3
%4 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%5 = call i32 @printlock_w39v040b(%struct.flashrom_flashctx* %4)
store i32 %5, i32* %3
%6 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%7 = call i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %6)
%8 = load i32, i32* %3
%9 = or i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @printlock_w39v040fb(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @printlock_w39v040b(%struct.flashrom_flashctx* %0)
%3 = tail call i32 @printlock_regspace2_uniform_64k(%struct.flashrom_flashctx* %0)
%4 = or i32 %3, %2
ret i32 %4
}