xunge/DecIR huggingface dataset:
/* Variables and functions */
void free(void *);
void sys_free_wrapper(void *ptr, void *pvt) { return free(ptr); }


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

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

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

LLVM IR (-O2):
define void @sys_free_wrapper(i8* nocapture %0, i8* nocapture readnone %1) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA(int, int);
void IniIop(void) { RegWriteA(0x0231, 0x00); }


x86 assembly (clang, -O0):
<IniIop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x231,%edi
xor    %esi,%esi
call   1030 <RegWriteA@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniIop>:
mov    $0x231,%edi
xor    %esi,%esi
jmp    1030 <RegWriteA@plt>

LLVM IR (-O0):
define void @IniIop() {
%1 = call i32 @RegWriteA(i32 561, i32 0)
ret void
}

LLVM IR (-O2):
define void @IniIop() {
%1 = tail call i32 @RegWriteA(i32 561, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt();
void opcode_76() { halt(); }


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

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

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

LLVM IR (-O2):
define void @opcode_76() {
%1 = tail call i32 (...) @halt()
ret void
}
/* Variables and functions */
scalar_t__ gen_is_chv(int);
scalar_t__ gen_is_vlv(int);
bool gen_is_atom(int devid) { return (gen_is_vlv(devid) || gen_is_chv(devid)); }


x86 assembly (clang, -O0):
<gen_is_atom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <gen_is_vlv@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <gen_is_atom+0x37>
mov    -0x4(%rbp),%edi
call   1030 <gen_is_chv@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_is_atom>:
push   %rbx
mov    %edi,%ebx
call   1040 <gen_is_vlv@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <gen_is_atom+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <gen_is_chv@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_is_atom(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @gen_is_vlv(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @gen_is_chv(i32 %7)
%9 = icmp ne i64 %8, 0
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 @gen_is_atom(i32 %0) {
%2 = tail call i64 @gen_is_vlv(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @gen_is_chv(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int funcB(int, int);
int /*<<< orphan*/ printf(char *);
int funcA(int a, int b) {
  printf("hello from funcA\n");
  return funcB(a, b);
}


x86 assembly (clang, -O0):
<funcA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <funcB@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcA>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <funcB@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"hello from funcA\0A\00"
define i32 @funcA(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @funcB(i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@str = [17 x i8] c"hello from funcA\00"
define i32 @funcA(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @funcB(i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num1, end;
  scanf("%d", &num1);
  end = is_prime(num1);
  printf("%d\n", end);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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
%6 = call i32 @is_prime(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\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 = call i32 @is_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
void normvideo(void) {}


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

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

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

LLVM IR (-O2):
define void @normvideo() {
ret void
}
setupline(type) char type;
{}


x86 assembly (clang, -O0):
<setupline>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @setupline(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char *name) {
  fprintf(stderr, "Usage: %s -e | -d [input_file [output_file]]\n", name);
  return 2;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s -e | -d [input_file [output_file]]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Usage: %s -e | -d [input_file [output_file]]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 2
}
/* Variables and functions */
double gsl_cdf_gamma_Q(double const, double const, double);
double chisq_Q(const double x, const double nu) {
  return gsl_cdf_gamma_Q(x, nu / 2, 2.0);
}


x86 assembly (clang, -O0):
<chisq_Q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xecc(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xec0(%rip),%xmm2
call   1030 <gsl_cdf_gamma_Q@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chisq_Q>:
mulsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
jmp    1030 <gsl_cdf_gamma_Q@plt>

LLVM IR (-O0):
define double @chisq_Q(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %6, 2.000000e+00
%8 = call double @gsl_cdf_gamma_Q(double %5, double %7, double 2.000000e+00)
ret double %8
}

LLVM IR (-O2):
define double @chisq_Q(double %0, double %1) {
%3 = fmul double %1, 5.000000e-01
%4 = tail call double @gsl_cdf_gamma_Q(double %0, double %3, double 2.000000e+00)
ret double %4
}
int main(void) {
  __builtin_printf("%s %s\n", "Mar 16 2022", "20:40:12");
  __builtin_printf("%s %s\n", "Mar 16 2022", "20:40:12");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xedf(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0xebe(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xee4(%rip),%rbx
lea    0xee4(%rip),%r14
lea    0xee9(%rip),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
@.str.2 = [9 x i8] c"20:40:12\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [12 x i8] c"Mar 16 2022\00"
@.str.2 = [9 x i8] c"20:40:12\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_kvlist_basic();
int /*<<< orphan*/ test_kvlist_insert_many();
int /*<<< orphan*/ test_kvlist_removing();
int /*<<< orphan*/ tests_show_summary();
int main(void) {
  test_kvlist_basic();
  test_kvlist_removing();
  test_kvlist_insert_many();
  tests_show_summary();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_kvlist_basic@plt>
mov    $0x0,%al
call   1060 <test_kvlist_removing@plt>
mov    $0x0,%al
call   1050 <test_kvlist_insert_many@plt>
mov    $0x0,%al
call   1040 <tests_show_summary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_kvlist_basic@plt>
xor    %eax,%eax
call   1060 <test_kvlist_removing@plt>
xor    %eax,%eax
call   1050 <test_kvlist_insert_many@plt>
xor    %eax,%eax
call   1040 <tests_show_summary@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_kvlist_basic()
%3 = call i32 (...) @test_kvlist_removing()
%4 = call i32 (...) @test_kvlist_insert_many()
%5 = call i32 (...) @tests_show_summary()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_kvlist_basic()
%2 = tail call i32 (...) @test_kvlist_removing()
%3 = tail call i32 (...) @test_kvlist_insert_many()
%4 = tail call i32 (...) @tests_show_summary()
ret i32 0
}
/* Variables and functions */
int __TBB_machine_fetchadd4(long volatile *, int);
int __itt_interlocked_increment(volatile long *ptr) {
  return __TBB_machine_fetchadd4(ptr, 1) + 1;
}


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

x86 assembly (clang, -O2):
<__itt_interlocked_increment>:
push   %rax
mov    $0x1,%esi
call   1030 <__TBB_machine_fetchadd4@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__itt_interlocked_increment(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = call i32 @__TBB_machine_fetchadd4(i64* %3, i32 1)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @__itt_interlocked_increment(i64* %0) {
%2 = tail call i32 @__TBB_machine_fetchadd4(i64* %0, i32 1)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ tiling(int);
int main() {
  int n;
  printf("Enter Number of tiles: ");
  scanf("%d", &n);
  printf("Number of ways to arrange tiles is %lli \n", tiling(n));
  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    0xec4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <tiling@plt>
mov    %eax,%esi
lea    0xead(%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    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <tiling@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Enter Number of tiles: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"Number of ways to arrange tiles is %lli \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 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* %2)
%5 = load i32, i32* %2
%6 = call i32 @tiling(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Enter Number of tiles: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [42 x i8] c"Number of ways to arrange tiles is %lli \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 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 @tiling(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int __crow_closeFile(int fd) {
  close(fd);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @__crow_closeFile(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 0
}
void testAllUnreachable(int arg) {
  if (arg < 0) {
    switch (arg) {
    case 0 ... 9:
      clang_analyzer_warnIfReached();
      break;
    case 20 ... 0x7fffffff:
      clang_analyzer_warnIfReached();
      break;
    case 16:
      clang_analyzer_warnIfReached();
    }
    clang_analyzer_warnIfReached();
  }
}


x86 assembly (clang, -O0):
<testAllUnreachable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1186 <testAllUnreachable+0x76>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xa,%eax
jb     114a <testAllUnreachable+0x3a>
jmp    1139 <testAllUnreachable+0x29>
mov    -0x8(%rbp),%eax
sub    $0x10,%eax
je     1178 <testAllUnreachable+0x68>
jmp    1162 <testAllUnreachable+0x52>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    117f <testAllUnreachable+0x6f>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
jmp    117f <testAllUnreachable+0x6f>
mov    -0x8(%rbp),%eax
sub    $0x14,%eax
cmp    $0x7fffffeb,%eax
jbe    1156 <testAllUnreachable+0x46>
jmp    117f <testAllUnreachable+0x6f>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
mov    $0x0,%al
call   1030 <clang_analyzer_warnIfReached@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testAllUnreachable>:
test   %edi,%edi
js     1115 <testAllUnreachable+0x5>
ret
xor    %eax,%eax
jmp    1030 <clang_analyzer_warnIfReached@plt>

LLVM IR (-O0):
define void @testAllUnreachable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %18
5: ; preds = %1
%6 = load i32, i32* %2
switch i32 %6, label %11 [
i32 0, label %7
i32 1, label %7
i32 2, label %7
i32 3, label %7
i32 4, label %7
i32 5, label %7
i32 6, label %7
i32 7, label %7
i32 8, label %7
i32 9, label %7
i32 16, label %14
]
7: ; preds = %5, %5, %5, %5, %5, %5, %5, %5, %5, %5
%8 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
9: ; preds = %11
%10 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
11: ; preds = %5
%12 = sub i32 %6, 20
%13 = icmp ule i32 %12, 2147483627
br i1 %13, label %9, label %16
14: ; preds = %5
%15 = call i32 (...) @clang_analyzer_warnIfReached()
br label %16
16: ; preds = %14, %11, %9, %7
%17 = call i32 (...) @clang_analyzer_warnIfReached()
br label %18
18: ; preds = %16, %1
ret void
}

LLVM IR (-O2):
define void @testAllUnreachable(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (...) @clang_analyzer_warnIfReached()
br label %5
5: ; preds = %3, %1
ret void
}
void foo_1_1_2_1_2_1_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_1_2_2_2() {
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  long rem;
};
typedef TYPE_1__ ldiv_t;

/* Variables and functions */
TYPE_1__ ldiv(long, long);
long gcd(long a, long b) {
  ldiv_t d;
  while (b != 0) {
    d = ldiv(a, b);
    a = b;
    b = d.rem;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1159 <gcd+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ldiv@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1120 <gcd+0x10>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rbx
test   %rsi,%rsi
je     1135 <gcd+0x25>
mov    %rsi,%rax
nopl   0x0(%rax)
mov    %rax,%rbx
mov    %rax,%rsi
call   1030 <ldiv@plt>
mov    %rbx,%rdi
test   %rax,%rax
jne    1120 <gcd+0x10>
jmp    1138 <gcd+0x28>
mov    %rdi,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca %struct.TYPE_3__
%6 = alloca %struct.TYPE_3__
store i64 %0, i64* %3
store i64 %1, i64* %4
br label %7
7: ; preds = %10, %2
%8 = load i64, i64* %4
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i64 @ldiv(i64 %11, i64 %12)
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %6, i32 0, i32 0
store i64 %13, i64* %14
%15 = bitcast %struct.TYPE_3__* %5 to i8*
%16 = bitcast %struct.TYPE_3__* %6 to i8*
%17 = load i64, i64* %4
store i64 %17, i64* %3
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%19 = load i64, i64* %18
store i64 %19, i64* %4
br label %7
20: ; preds = %7
%21 = load i64, i64* %3
ret i64 %21
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = tail call i64 @ldiv(i64 %5, i64 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
int __C_iscntrl(int);
int iscntrl(int c) { return __C_iscntrl(c); }


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

x86 assembly (clang, -O2):
<iscntrl>:
jmp    1030 <__C_iscntrl@plt>

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

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = tail call i32 @__C_iscntrl(i32 %0)
ret i32 %2
}
int gethostid(void) { return 0x10227410; }


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

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

LLVM IR (-O0):
define i32 @gethostid() {
ret i32 270693392
}

LLVM IR (-O2):
define i32 @gethostid() {
ret i32 270693392
}
/* Variables and functions */
int re_match(char const *, char *);
int validate_macaddr(const char *str) {
  if (!str)
    return 0;
  return re_match(str, "^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$");
}


x86 assembly (clang, -O0):
<validate_macaddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <validate_macaddr+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1146 <validate_macaddr+0x36>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <re_match@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_macaddr>:
test   %rdi,%rdi
je     1121 <validate_macaddr+0x11>
lea    0xee4(%rip),%rsi
jmp    1030 <re_match@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$\00"
define i32 @validate_macaddr(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @re_match(i8* %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [37 x i8] c"^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}$\00"
define i32 @validate_macaddr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @re_match(i8* %0, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Type definitions */
struct timespec {
  unsigned long long tv_nsec;
  unsigned long long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void nsleep(unsigned long long nsecs) {
  struct timespec ts;
  ts.tv_nsec = nsecs % 1000000000;
  ts.tv_sec = nsecs / 1000000000;
  nanosleep(&ts, NULL);
}


x86 assembly (clang, -O0):
<nsleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsleep>:
sub    $0x18,%rsp
mov    %rdi,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rcx
mul    %rcx
shr    $0xb,%rdx
imul   $0x3b9aca00,%rdx,%rax
sub    %rax,%rdi
mov    %rdi,0x8(%rsp)
mov    %rdx,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @nsleep(i64 %0) {
%2 = alloca i64
%3 = alloca %struct.timespec
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = urem i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %5, i64* %6
%7 = load i64, i64* %2
%8 = udiv i64 %7, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @nsleep(i64 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = urem i64 %0, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %4, i64* %5
%6 = udiv i64 %0, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %6, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int *alloc_ivec(long first, long last) {
  int *v;
  v = (int *)malloc((size_t)((last - first + 1 + 0) * sizeof(int)));
  return v - first + 0;
}


x86 assembly (clang, -O0):
<alloc_ivec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x0,%rdi
shl    $0x2,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_ivec>:
push   %rbx
mov    %rdi,%rbx
sub    %rdi,%rsi
lea    0x4(,%rsi,4),%rdi
call   1030 <malloc@plt>
shl    $0x2,%rbx
sub    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @alloc_ivec(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 0
%11 = mul i64 %10, 4
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to i32*
store i32* %13, i32** %5
%14 = load i32*, i32** %5
%15 = load i64, i64* %3
%16 = sub i64 0, %15
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = getelementptr inbounds i32, i32* %17, i64 0
ret i32* %18
}

LLVM IR (-O2):
define i32* @alloc_ivec(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 2
%5 = add i64 %4, 4
%6 = tail call i64 @malloc(i64 %5)
%7 = inttoptr i64 %6 to i32*
%8 = sub i64 0, %0
%9 = getelementptr inbounds i32, i32* %7, i64 %8
ret i32* %9
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *const, unsigned int);
void sprintf_handler(const char *const buf, unsigned int size, void *param) {
  char **str = (char **)param;
  memcpy(*str, buf, size);
  *str += size;
}


x86 assembly (clang, -O0):
<sprintf_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
mov    %edx,%edx
add    %rdx,%rcx
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintf_handler>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%rsi
mov    (%rdx),%rdi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %ebp,%eax
add    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @sprintf_handler(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8**
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to i8**
store i8** %9, i8*** %7
%10 = load i8**, i8*** %7
%11 = load i8*, i8** %10
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
%15 = load i32, i32* %5
%16 = load i8**, i8*** %7
%17 = load i8*, i8** %16
%18 = zext i32 %15 to i64
%19 = getelementptr inbounds i8, i8* %17, i64 %18
store i8* %19, i8** %16
ret void
}

LLVM IR (-O2):
define void @sprintf_handler(i8* %0, i32 %1, i8* nocapture %2) {
%4 = bitcast i8* %2 to i8**
%5 = load i8*, i8** %4
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %1)
%7 = load i8*, i8** %4
%8 = zext i32 %1 to i64
%9 = getelementptr inbounds i8, i8* %7, i64 %8
store i8* %9, i8** %4
ret void
}
unsigned int gm_eod_cost(unsigned int state[], const int k) {
  static const unsigned int eod_costs[6] = {13 * 6, 10 * 6, 5 * 6,
                                            5 * 6,  10 * 6, 4 * 6};
  (void)state;
  return eod_costs[k];
}


x86 assembly (clang, -O0):
<gm_eod_cost>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0xeea(%rip),%rax
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gm_eod_cost>:
movslq %esi,%rax
lea    0xef6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@gm_eod_cost.eod_costs = internal constant [6 x i32] [i32 78, i32 60, i32 30, i32 30, i32 60, i32 24]
define i32 @gm_eod_cost(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds [6 x i32], [6 x i32]* @gm_eod_cost.eod_costs, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
@gm_eod_cost.eod_costs = internal unnamed_addr constant [6 x i32] [i32 78, i32 60, i32 30, i32 30, i32 60, i32 24]
define i32 @gm_eod_cost(i32* nocapture readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [6 x i32], [6 x i32]* @gm_eod_cost.eod_costs, i64 0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int main(int argc, char **argv) { return EXIT_SUCCESS; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int log2(int x) {
  int res = 0;
  while (x >>= 1)
    res++;
  return res;
}


x86 assembly (clang, -O0):
<log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <log2+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <log2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ FlipEndian(void *, int);
unsigned long FLIP_ULONG(unsigned long pVar) {
  return *(unsigned long *)FlipEndian((void *)&pVar, sizeof(unsigned long));
}


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

x86 assembly (clang, -O2):
<FLIP_ULONG>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1030 <FlipEndian@plt>
mov    (%rax),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @FLIP_ULONG(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = bitcast i64* %2 to i8*
%4 = call i64 @FlipEndian(i8* %3, i32 8)
%5 = inttoptr i64 %4 to i64*
%6 = load i64, i64* %5
ret i64 %6
}
unsigned int uint_max(unsigned int x, unsigned int y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<uint_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1121 <uint_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <uint_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @uint_max(i32 %0, i32 %1) {
%3 = icmp ugt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ pthread_self();
unsigned long thread_id() { return (unsigned long)pthread_self(); }


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

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

LLVM IR (-O0):
define i64 @thread_id() {
%1 = call i64 (...) @pthread_self()
ret i64 %1
}

LLVM IR (-O2):
define i64 @thread_id() {
%1 = tail call i64 (...) @pthread_self()
ret i64 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ check_backtrace();
int /*<<< orphan*/ puts(char *);
void handler(uint64_t registers[32]) {
  puts("Exception!");
  check_backtrace();
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <check_backtrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <check_backtrace@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Exception!\00"
define void @handler(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @check_backtrace()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Exception!\00"
define void @handler(i32* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @check_backtrace()
ret void
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_reassociate(struct wpa_ctrl *ctrl, int argc, char *argv[]) {
  return wpa_ctrl_command(ctrl, "REASSOCIATE");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_reassociate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_reassociate>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"REASSOCIATE\00"
define i32 @wpa_cli_cmd_reassociate(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [12 x i8] c"REASSOCIATE\00"
define i32 @wpa_cli_cmd_reassociate(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
void uDMAIntClear(unsigned long ulChanMask) {
  (*((volatile unsigned long *)(0x400FF504))) = ulChanMask;
}


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

x86 assembly (clang, -O2):
<uDMAIntClear>:
mov    %rdi,0x400ff504
40
ret

LLVM IR (-O0):
define void @uDMAIntClear(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
store volatile i64 %3, i64* inttoptr (i64 1074787588 to i64*)
ret void
}

LLVM IR (-O2):
define void @uDMAIntClear(i64 %0) {
store volatile i64 %0, i64* inttoptr (i64 1074787588 to i64*)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, ...);
int main(void) {
  typedef union {
    uint32_t a;
    uint8_t b[4];
    float f;
  } quad;
  quad q;
  q.a = 0x01020304;
  printf("%d %d %d %d\n", q.b[0], q.b[1], q.b[2], q.b[3]);
  q.a = 987654321;
  printf("%f\n", q.f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1020304,-0x18(%rbp)
cvtsi2ssl -0x18(%rbp),%xmm0
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x3ade68b1,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
movss  0xece(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.quad = type { [4 x i32] }
@.str = [13 x i8] c"%d %d %d %d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %union.quad
store i32 0, i32* %1
%3 = bitcast %union.quad* %2 to i32*
store i32 16909060, i32* %3
%4 = bitcast %union.quad* %2 to [4 x i32]*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to float
%8 = bitcast %union.quad* %2 to [4 x i32]*
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 1
%10 = load i32, i32* %9
%11 = bitcast %union.quad* %2 to [4 x i32]*
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 2
%13 = load i32, i32* %12
%14 = bitcast %union.quad* %2 to [4 x i32]*
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %14, i64 0, i64 3
%16 = load i32, i32* %15
%17 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float %7, i32 %10, i32 %13, i32 %16)
%18 = bitcast %union.quad* %2 to i32*
store i32 987654321, i32* %18
%19 = bitcast %union.quad* %2 to float*
%20 = load float, float* %19
%21 = call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d %d %d %d\0A\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), float 0x4170203040000000, i32 undef, i32 undef, i32 undef)
%2 = tail call i32 (i8*, float, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float 0x3F5BCD1620000000)
ret i32 0
}
void lan2_set_sol_data(int insize, int outsize, int port, void *handler,
                       char esc_char) {
  return;
}


x86 assembly (clang, -O0):
<lan2_set_sol_data>:
push   %rbp
mov    %rsp,%rbp
mov    %r8b,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @lan2_set_sol_data(i32 %0, i32 %1, i32 %2, i8* %3, i8 signext %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8 %4, i8* %10
ret void
}

LLVM IR (-O2):
define void @lan2_set_sol_data(i32 %0, i32 %1, i32 %2, i8* nocapture %3, i8 signext %4) {
ret void
}
void fff() {}


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

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

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

LLVM IR (-O2):
define void @fff() {
ret void
}
int test(void *d) {
  struct toChild *data = d;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.toChild = type opaque
define i32 @test(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.toChild*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.toChild*
store %struct.toChild* %5, %struct.toChild** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @test(i8* nocapture readnone %0) {
ret i32 0
}
void show_regs(struct pt_regs *regs) { return; }


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

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

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

LLVM IR (-O2):
%struct.pt_regs = type opaque
define void @show_regs(%struct.pt_regs* nocapture %0) {
ret void
}
__typeof__(isspace("")) test_isspace_56(void) { return isspace(""); }


x86 assembly (clang, -O0):
<test_isspace_56>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rax
mov    %eax,%edi
call   1030 <isspace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isspace_56>:
lea    0xee9(%rip),%rdi
jmp    1030 <isspace@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @test_isspace_56() {
%1 = call i32 @isspace(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @test_isspace_56() {
%1 = tail call i32 @isspace(i32 ptrtoint ([1 x i8]* @.str to i32))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int log_trace(char *, char const *, char *, int);
char *str_path_basename(char const *);
int log_traceme(const char *file, const char *func, int line) {
  char *base = str_path_basename(file);
  int rc = log_trace("@%s() in %s:%d", func, base, line);
  free(base);
  return rc;
}


x86 assembly (clang, -O0):
<log_traceme>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <str_path_basename@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    0xe9e(%rip),%rdi
call   1050 <log_trace@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_traceme>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
call   1030 <str_path_basename@plt>
mov    %rax,%rbp
lea    0xeb7(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r14d,%ecx
call   1050 <log_trace@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1040 <free@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"@%s() in %s:%d\00"
define i32 @log_traceme(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i8* @str_path_basename(i8* %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %5
%12 = load i8*, i8** %7
%13 = load i32, i32* %6
%14 = call i32 @log_trace(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12, i32 %13)
store i32 %14, i32* %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
@.str = [15 x i8] c"@%s() in %s:%d\00"
define i32 @log_traceme(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @str_path_basename(i8* %0)
%5 = tail call i32 @log_trace(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %4, i32 %2)
%6 = tail call i32 @free(i8* %4)
ret i32 %5
}