xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fail_test(int);
scalar_t__ mem_cmp(unsigned char *, unsigned char *, int);
void test_cmp() {
  unsigned char i[sizeof(int)] = {0, 0, 1, 89};
  unsigned char j[sizeof(int)] = {0, 0, 1, 91};
  if (mem_cmp(i, j, sizeof(int)) >= 0)
    fail_test(43);
  ;
}


x86 assembly (clang, -O0):
<test_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1040 <mem_cmp@plt>
cmp    $0x0,%rax
jl     1160 <test_cmp+0x40>
mov    $0x2b,%edi
call   1030 <fail_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cmp>:
push   %rax
movl   $0x59010000,0x4(%rsp)
59
movl   $0x5b010000,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1040 <mem_cmp@plt>
test   %rax,%rax
js     1151 <test_cmp+0x31>
mov    $0x2b,%edi
call   1030 <fail_test@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.test_cmp.i = [4 x i8] c"\00\00\01Y"
@__const.test_cmp.j = [4 x i8] c"\00\00\01["
define void @test_cmp() {
%1 = alloca [4 x i8]
%2 = alloca [4 x i8]
%3 = bitcast [4 x i8]* %1 to i8*
%4 = bitcast [4 x i8]* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%7 = call i64 @mem_cmp(i8* %5, i8* %6, i32 4)
%8 = icmp sge i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @fail_test(i32 43)
br label %11
11: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
define void @test_cmp() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1493237760, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1526792192, i32* %2
%5 = call i64 @mem_cmp(i8* %3, i8* %4, i32 4)
%6 = icmp sgt i64 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @fail_test(i32 43)
br label %9
9: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DrawBox(double, double, double, double);
int /*<<< orphan*/ DrawCenteredCircle(double, double, double);
void DrawDoor(double x, double y) {
  DrawBox(x, y, 0.4, 0.7);
  DrawCenteredCircle(x + 0.4 - 0.07, y + 0.7 / 2, 0.03);
}


x86 assembly (clang, -O0):
<DrawDoor>:
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  0xed4(%rip),%xmm2
movsd  0xed4(%rip),%xmm3
call   1040 <DrawBox@plt>
movsd  0xebf(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xeaa(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xe96(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
movsd  0xe81(%rip),%xmm2
call   1030 <DrawCenteredCircle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawDoor>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xec8(%rip),%xmm2
movsd  0xec8(%rip),%xmm3
call   1040 <DrawBox@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xead(%rip),%xmm0
addsd  0xeb5(%rip),%xmm0
movsd  0x10(%rsp),%xmm1
addsd  0xeaf(%rip),%xmm1
movsd  0xeaf(%rip),%xmm2
add    $0x18,%rsp
jmp    1030 <DrawCenteredCircle@plt>

LLVM IR (-O0):
define void @DrawDoor(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 = call i32 @DrawBox(double %5, double %6, double 4.000000e-01, double 0x3FE6666666666666)
%8 = load double, double* %3
%9 = fadd double %8, 4.000000e-01
%10 = fsub double %9, 7.000000e-02
%11 = load double, double* %4
%12 = fadd double %11, 3.500000e-01
%13 = call i32 @DrawCenteredCircle(double %10, double %12, double 3.000000e-02)
ret void
}

LLVM IR (-O2):
define void @DrawDoor(double %0, double %1) {
%3 = tail call i32 @DrawBox(double %0, double %1, double 4.000000e-01, double 0x3FE6666666666666)
%4 = fadd double %0, 4.000000e-01
%5 = fadd double %4, -7.000000e-02
%6 = fadd double %1, 3.500000e-01
%7 = tail call i32 @DrawCenteredCircle(double %5, double %6, double 3.000000e-02)
ret void
}
/* Variables and functions */
char *config_get_option(char const *);
unsigned long conv_char2ulong(char const *, unsigned long);
unsigned long config_get_uloption(const char *key, unsigned long err_return) {
  const char *optstr = config_get_option(key);
  return conv_char2ulong(optstr, err_return);
}


x86 assembly (clang, -O0):
<config_get_uloption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <config_get_option@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <conv_char2ulong@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<config_get_uloption>:
push   %rbx
mov    %rsi,%rbx
call   1040 <config_get_option@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <conv_char2ulong@plt>

LLVM IR (-O0):
define i64 @config_get_uloption(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = call i8* @config_get_option(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = load i64, i64* %4
%10 = call i64 @conv_char2ulong(i8* %8, i64 %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @config_get_uloption(i8* %0, i64 %1) {
%3 = tail call i8* @config_get_option(i8* %0)
%4 = tail call i64 @conv_char2ulong(i8* %3, i64 %1)
ret i64 %4
}
int addTable(int element1, int element2) { return element1 ^ element2; }


x86 assembly (clang, -O0):
<addTable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addTable>:
mov    %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @addTable(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 = xor i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @addTable(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
ret i32 %3
}
/* Variables and functions */
double abs_v(double);
double calc_sqrt(double x) {
  double guess = 1.0;
  do {
    guess = (x / guess + guess) / 2;
  } while (abs_v(x) / abs_v((guess * guess)) < 1.00);
  return guess;
}


x86 assembly (clang, -O0):
<calc_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xec7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <abs_v@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <abs_v@plt>
movsd  -0x18(%rbp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe87(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     112a <calc_sqrt+0x1a>
movsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_sqrt>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
movapd %xmm0,%xmm1
movsd  (%rsp),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm2
mulsd  0xeb9(%rip),%xmm2
movsd  %xmm2,(%rsp)
call   1030 <abs_v@plt>
movsd  %xmm0,0x10(%rsp)
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
call   1030 <abs_v@plt>
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1130 <calc_sqrt+0x20>
movsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @calc_sqrt(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 1.000000e+00, double* %3
br label %4
4: ; preds = %11, %1
%5 = load double, double* %2
%6 = load double, double* %3
%7 = fdiv double %5, %6
%8 = load double, double* %3
%9 = fadd double %7, %8
%10 = fdiv double %9, 2.000000e+00
store double %10, double* %3
br label %11
11: ; preds = %4
%12 = load double, double* %2
%13 = call double @abs_v(double %12)
%14 = load double, double* %3
%15 = load double, double* %3
%16 = fmul double %14, %15
%17 = call double @abs_v(double %16)
%18 = fdiv double %13, %17
%19 = fcmp olt double %18, 1.000000e+00
br i1 %19, label %4, label %20
20: ; preds = %11
%21 = load double, double* %3
ret double %21
}

LLVM IR (-O2):
define double @calc_sqrt(double %0) {
br label %2
2: ; preds = %2, %1
%3 = phi double [ 1.000000e+00, %1 ], [ %6, %2 ]
%4 = fdiv double %0, %3
%5 = fadd double %3, %4
%6 = fmul double %5, 5.000000e-01
%7 = tail call double @abs_v(double %0)
%8 = fmul double %6, %6
%9 = tail call double @abs_v(double %8)
%10 = fdiv double %7, %9
%11 = fcmp olt double %10, 1.000000e+00
br i1 %11, label %2, label %12
12: ; preds = %2
ret double %6
}
void sendEmail(char subject[]) { return; }


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

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

LLVM IR (-O0):
define void @sendEmail(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @sendEmail(i8* nocapture %0) {
ret void
}
void exchange(int *p, int *q) {
  int temp;
  temp = *p;
  *p = *q;
  *q = temp;
}


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

x86 assembly (clang, -O2):
<exchange>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @exchange(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @exchange(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rl_beg_of_line();
int /*<<< orphan*/ rl_vi_insertion_mode();
rl_vi_insert_beg() {
  rl_beg_of_line();
  rl_vi_insertion_mode();
  return 0;
}


x86 assembly (clang, -O0):
<rl_vi_insert_beg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rl_beg_of_line@plt>
mov    $0x0,%al
call   1040 <rl_vi_insertion_mode@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_insert_beg>:
push   %rax
xor    %eax,%eax
call   1030 <rl_beg_of_line@plt>
xor    %eax,%eax
call   1040 <rl_vi_insertion_mode@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @rl_vi_insert_beg() {
%1 = call i32 (...) @rl_beg_of_line()
%2 = call i32 (...) @rl_vi_insertion_mode()
ret i32 0
}

LLVM IR (-O2):
define i32 @rl_vi_insert_beg() {
%1 = tail call i32 (...) @rl_beg_of_line()
%2 = tail call i32 (...) @rl_vi_insertion_mode()
ret i32 0
}
int getByte(int x, int n) {
  int mov = n << 3;
  int ret = x >> mov;
  ret = ret & 0xff;
  return ret;
}


x86 assembly (clang, -O0):
<getByte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getByte>:
lea    0x0(,%rsi,8),%ecx
sar    %cl,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @getByte(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 %7, 3
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = ashr i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = and i32 %12, 255
store i32 %13, i32* %6
%14 = load i32, i32* %6
ret i32 %14
}

LLVM IR (-O2):
define i32 @getByte(i32 %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = ashr i32 %0, %3
%5 = and i32 %4, 255
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) { printf("Hello, world!\nThis is CS50.\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Hello, world!\0AThis is CS50.\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"Hello, world!\0AThis is CS50.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
scalar_t__ sancus_time_cmp(struct timespec const *, struct timespec const *);
int sancus_time_is_gt(const struct timespec *a, const struct timespec *b) {
  return sancus_time_cmp(a, b) > 0;
}


x86 assembly (clang, -O0):
<sancus_time_is_gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sancus_time_cmp@plt>
cmp    $0x0,%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.timespec = type { i32 }
define i32 @sancus_time_is_gt(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i64 @sancus_time_cmp(%struct.timespec* %5, %struct.timespec* %6)
%8 = icmp sgt i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define i32 @sancus_time_is_gt(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i64 @sancus_time_cmp(%struct.timespec* %0, %struct.timespec* %1)
%4 = icmp sgt i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int mcpp_lib_main(int, char **);
int main(int argc, char *argv[]) { return mcpp_lib_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <mcpp_lib_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @mcpp_lib_main(i32 %0, i8** %1)
ret i32 %3
}
int is_big_endian(void) {
  union {
    long int l;
    char c[sizeof(long int)];
  } u;
  u.l = 42;
  if (u.c[sizeof(long int) - 1] == 42 && u.c[0] == 42)
    return 2;
  else if (u.c[sizeof(long int) - 1] == 42)
    return 1;
  else if (u.c[0] == 42)
    return 0;
  else
    return 3;
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movq   $0x2a,-0x10(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x2a,%eax
jne    1132 <is_big_endian+0x32>
movsbl -0x10(%rbp),%eax
cmp    $0x2a,%eax
jne    1132 <is_big_endian+0x32>
movl   $0x2,-0x4(%rbp)
jmp    116b <is_big_endian+0x6b>
movsbl -0x9(%rbp),%eax
cmp    $0x2a,%eax
jne    114b <is_big_endian+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    116b <is_big_endian+0x6b>
movsbl -0x10(%rbp),%eax
cmp    $0x2a,%eax
jne    1164 <is_big_endian+0x64>
movl   $0x0,-0x4(%rbp)
jmp    116b <is_big_endian+0x6b>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
/* Variables and functions */
int code_table_4_0(unsigned char **);
int /*<<< orphan*/ sprintf(char *, char *, int);
int f_pdt(int mode, unsigned char **sec, float *data, unsigned int ndata,
          char *inv_out, void **local) {
  if (mode < 0)
    return 0;
  sprintf(inv_out, "pdt=%d", code_table_4_0(sec));
  return 0;
}


x86 assembly (clang, -O0):
<f_pdt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1154 <f_pdt+0x34>
movl   $0x0,-0x4(%rbp)
jmp    117e <f_pdt+0x5e>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <code_table_4_0@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
lea    0xe8e(%rip),%rsi
call   1040 <sprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_pdt>:
test   %edi,%edi
js     1142 <f_pdt+0x22>
push   %rbx
mov    %r8,%rbx
mov    %rsi,%rdi
call   1030 <code_table_4_0@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1040 <sprintf@plt>
pop    %rbx
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"pdt=%d\00"
define i32 @f_pdt(i32 %0, i8** %1, float* nocapture readnone %2, i32 %3, i8* nocapture writeonly %4, i8** nocapture readnone %5) {
%7 = icmp slt i32 %0, 0
br i1 %7, label %11, label %8
8: ; preds = %6
%9 = tail call i32 @code_table_4_0(i8** %1)
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %6, %8
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ jmp_buf;

/* Variables and functions */
int main(int, char **);
int kitsune_init_inplace(jmp_buf *env, int argc, char **argv) {
  return main(argc, argv);
}


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

x86 assembly (clang, -O2):
<kitsune_init_inplace>:
mov    %esi,%edi
mov    %rdx,%rsi
jmp    1030 <main@plt>

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

LLVM IR (-O2):
define i32 @kitsune_init_inplace(i32* nocapture readnone %0, i32 %1, i8** %2) {
%4 = tail call i32 @main(i32 %1, i8** %2)
ret i32 %4
}
char *fndws(s)
char *s;
{
  while ((*s != ' ') && (*s != '\t'))
    if ((*s++ == '\n') || !*s)
      return (char *)0;
  return s;
}


x86 assembly (clang, -O0):
<fndws>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x11(%rbp)
je     112d <fndws+0x2d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113d <fndws+0x3d>
jmp    1177 <fndws+0x77>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0xa,%eax
je     1165 <fndws+0x65>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1172 <fndws+0x72>
movq   $0x0,-0x8(%rbp)
jmp    117f <fndws+0x7f>
jmp    1108 <fndws+0x8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fndws>:
mov    %rdi,%rax
mov    (%rdi),%cl
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x9,%cl
je     112d <fndws+0x2d>
cmp    $0x20,%cl
je     112d <fndws+0x2d>
cmp    $0xa,%cl
je     112b <fndws+0x2b>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <fndws+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @fndws(i8* %0) {
%2 = load i8, i8* %0
br label %3
3: ; preds = %9, %1
%4 = phi i8 [ %10, %9 ], [ %2, %1 ]
%5 = phi i8* [ %7, %9 ], [ %0, %1 ]
switch i8 %4, label %6 [
i8 32, label %12
i8 9, label %12
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = icmp eq i8 %4, 10
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %3, %6, %9
%13 = phi i8* [ null, %9 ], [ null, %6 ], [ %5, %3 ], [ %5, %3 ]
ret i8* %13
}
/* Variables and functions */
char *strrchr(char *, char);
char *extension(char *filename) {
  char *result = strrchr(filename, '.');
  return (result == NULL) ? "" : result;
}


x86 assembly (clang, -O0):
<extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1149 <extension+0x39>
lea    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1151 <extension+0x41>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension>:
push   %rax
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
lea    0xedb(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @extension(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 46)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %11
9: ; preds = %1
%10 = load i8*, i8** %3
br label %11
11: ; preds = %9, %8
%12 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %8 ], [ %10, %9 ]
ret i8* %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @extension(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %2
ret i8* %4
}
void logMessage(const char *name, int value, const char *unit) {
  ;
  char buf[33];
  sprintf(buf, "%i", value);
  logMessage(name, buf, unit);
  ;
  ;
}


x86 assembly (clang, -O0):
<logMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x40(%rbp),%rax
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1030 <logMessage@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logMessage>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdx,%r14
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xec8(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <logMessage@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
define void @logMessage(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca [33 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %5
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [33 x i8], [33 x i8]* %7, i64 0, i64 0
%13 = ptrtoint i8* %12 to i32
%14 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @logMessage(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = alloca [33 x i8]
%5 = getelementptr inbounds [33 x i8], [33 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%7 = ptrtoint [33 x i8]* %4 to i64
%8 = trunc i64 %7 to i32
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_wfd_discovery_usage(void) {
  printf("\nUsage : wfd_discovery_request/response [CONFIG_FILE]\n");
  printf("CONFIG_FILE contains WFD service discovery payload.\n");
  return;
}


x86 assembly (clang, -O0):
<print_wfd_discovery_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
lea    0xf10(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_wfd_discovery_usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"\0AUsage : wfd_discovery_request/response [CONFIG_FILE]\0A\00"
@.str.1 = [53 x i8] c"CONFIG_FILE contains WFD service discovery payload.\0A\00"
define void @print_wfd_discovery_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [54 x i8] c"\0AUsage : wfd_discovery_request/response [CONFIG_FILE]\00"
@str.2 = [52 x i8] c"CONFIG_FILE contains WFD service discovery payload.\00"
define void @print_wfd_discovery_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ bgen_die(char *);
int panic_add_uint32(int, int);
uint32_t ceildiv_uint32(uint32_t x, uint32_t y) {
  if (y == 0)
    bgen_die("y cannot be zero in ceildiv");
  return (panic_add_uint32(x, y - 1)) / y;
}


x86 assembly (clang, -O0):
<ceildiv_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1144 <ceildiv_uint32+0x24>
lea    0xec1(%rip),%rdi
call   1040 <bgen_die@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
call   1030 <panic_add_uint32@plt>
cltd
idivl  -0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceildiv_uint32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %esi,%esi
jne    1137 <ceildiv_uint32+0x17>
lea    0xece(%rip),%rdi
call   1040 <bgen_die@plt>
lea    -0x1(%rbx),%esi
mov    %ebp,%edi
call   1030 <panic_add_uint32@plt>
cltd
idiv   %ebx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"y cannot be zero in ceildiv\00"
define i32 @ceildiv_uint32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @bgen_die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = call i32 @panic_add_uint32(i32 %10, i32 %12)
%14 = load i32, i32* %4
%15 = sdiv i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
@.str = [28 x i8] c"y cannot be zero in ceildiv\00"
define i32 @ceildiv_uint32(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @bgen_die(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = add nsw i32 %1, -1
%8 = tail call i32 @panic_add_uint32(i32 %0, i32 %7)
%9 = sdiv i32 %8, %1
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ Input(char *, int *);
int main(int argc, char *argv[]) {
  char BUF_NAME[] = {'z', 'h', 'a', 'n', 'g', 's', 'a', 'n', '0', '0',
                     'l', 'i', 's', 'i', '0', '0', '0', '0', '0', '0',
                     'w', 'a', 'n', 'g', 'w', 'u', '0', '0', '0', '0',
                     'x', 'u', 'x', 'i', 'a', 'o', 'h', 'u', 'a', '0'};
  int BUF_SCORE[] = {100, 85, 80, 0, 80, 100, 70, 0,
                     70,  60, 80, 0, 40, 55,  61, 0};
  Input(BUF_NAME, BUF_SCORE);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <Input@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
movaps 0xef5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x306175686f616978,%rax
75 61 30
mov    %rax,0x20(%rsp)
movaps 0xf1f(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xee7(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
lea    0x30(%rsp),%rsi
call   1030 <Input@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.BUF_NAME = [40 x i8] c"zhangsan00lisi000000wangwu0000xuxiaohua0"
@__const.main.BUF_SCORE = [16 x i32] [i32 100, i32 85, i32 80, i32 0, i32 80, i32 100, i32 70, i32 0, i32 70, i32 60, i32 80, i32 0, i32 40, i32 55, i32 61, i32 0]
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [40 x i8]
%7 = alloca [16 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [40 x i8]* %6 to i8*
%9 = bitcast [16 x i32]* %7 to i8*
%10 = getelementptr inbounds [40 x i8], [40 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [16 x i32], [16 x i32]* %7, i64 0, i64 0
%12 = call i32 @Input(i8* %10, i32* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.BUF_NAME = [40 x i8] c"zhangsan00lisi000000wangwu0000xuxiaohua0"
@__const.main.BUF_SCORE = [16 x i32] [i32 100, i32 85, i32 80, i32 0, i32 80, i32 100, i32 70, i32 0, i32 70, i32 60, i32 80, i32 0, i32 40, i32 55, i32 61, i32 0]
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [40 x i8]
%4 = alloca [16 x i32]
%5 = getelementptr inbounds [40 x i8], [40 x i8]* %3, i64 0, i64 0
%6 = bitcast [16 x i32]* %4 to i8*
%7 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
%8 = call i32 @Input(i8* %5, i32* %7)
ret i32 0
}
/* Variables and functions */
unsigned int calc_gcd(unsigned int *, unsigned int *);
unsigned int gcd(unsigned int a, unsigned int b) {
  if (b > a)
    return calc_gcd(&b, &a);
  else
    return calc_gcd(&a, &b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    113f <gcd+0x2f>
lea    -0xc(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <calc_gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    114f <gcd+0x3f>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <calc_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
cmp    %edi,%esi
jbe    1126 <gcd+0x16>
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
jmp    112e <gcd+0x1e>
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <calc_gcd@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = icmp ugt i32 %1, %0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = call i32 @calc_gcd(i32* %4, i32* %3)
br label %10
8: ; preds = %2
%9 = call i32 @calc_gcd(i32* %3, i32* %4)
br label %10
10: ; preds = %8, %6
%11 = phi i32 [ %7, %6 ], [ %9, %8 ]
ret i32 %11
}
/* Type definitions */
struct filter_args_info {
  int dummy;
};

/* Variables and functions */
int EXIT_SUCCESS;
int filter_cmdline_parser_required(struct filter_args_info *args_info,
                                   const char *prog_name) {
  (void)(args_info);
  (void)(prog_name);
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
%struct.filter_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @filter_cmdline_parser_required(%struct.filter_args_info* %0, i8* %1) {
%3 = alloca %struct.filter_args_info*
%4 = alloca i8*
store %struct.filter_args_info* %0, %struct.filter_args_info** %3
store i8* %1, i8** %4
%5 = load %struct.filter_args_info*, %struct.filter_args_info** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.filter_args_info = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @filter_cmdline_parser_required(%struct.filter_args_info* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void signed_char_sub_signed_char(signed char *LHS, signed char RHS) {
  (*LHS) -= RHS;
}


x86 assembly (clang, -O0):
<signed_char_sub_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_sub_signed_char>:
sub    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_sub_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_sub_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = sub i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
int bset_l(int *, int *);
int intr_wrap_529(int p1, int p2) { return bset_l(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_529>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <bset_l@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_529>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <bset_l@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @intr_wrap_529(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @bset_l(i32* %3, i32* %4)
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ Atom;

/* Variables and functions */
int /*<<< orphan*/ XInternAtoms(int /*<<< orphan*/ *, char **, int,
                                int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void useXlibProperly(char **names, Display *display) {
  Atom atoms[500];
  if (!XInternAtoms(display, names, 500, 0, atoms)) {
    fprintf(stderr, "XInternAtoms failed\n");
  }
}


x86 assembly (clang, -O0):
<useXlibProperly>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7e0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    -0x7e0(%rbp),%r8
mov    $0x1f4,%edx
xor    %ecx,%ecx
call   1040 <XInternAtoms@plt>
cmp    $0x0,%eax
jne    116c <useXlibProperly+0x4c>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    0xe99(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x7e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<useXlibProperly>:
sub    $0x7d8,%rsp
mov    %rdi,%rax
mov    %rsp,%r8
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x1f4,%edx
xor    %ecx,%ecx
call   1040 <XInternAtoms@plt>
test   %eax,%eax
je     114b <useXlibProperly+0x2b>
add    $0x7d8,%rsp
ret
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x7d8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"XInternAtoms failed\0A\00"
define void @useXlibProperly(i8** %0, i32* %1) {
%3 = alloca i8**
%4 = alloca i32*
%5 = alloca [500 x i32]
store i8** %0, i8*** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i8**, i8*** %3
%8 = getelementptr inbounds [500 x i32], [500 x i32]* %5, i64 0, i64 0
%9 = call i32 @XInternAtoms(i32* %6, i8** %7, i32 500, i32 0, i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"XInternAtoms failed\0A\00"
define void @useXlibProperly(i8** %0, i32* %1) {
%3 = alloca [500 x i32]
%4 = bitcast [500 x i32]* %3 to i8*
%5 = getelementptr inbounds [500 x i32], [500 x i32]* %3, i64 0, i64 0
%6 = call i32 @XInternAtoms(i32* %1, i8** %0, i32 500, i32 0, i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ fatal_error_with_errno(char *);
scalar_t__ pthread_cond_init(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void init_cond(pthread_cond_t *cond) {
  if (pthread_cond_init(cond, NULL))
    fatal_error_with_errno("Failed to initialize condition variable");
}


x86 assembly (clang, -O0):
<init_cond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <pthread_cond_init@plt>
cmp    $0x0,%rax
je     114f <init_cond+0x2f>
lea    0xeb6(%rip),%rdi
call   1030 <fatal_error_with_errno@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_cond>:
push   %rax
xor    %esi,%esi
call   1040 <pthread_cond_init@plt>
test   %rax,%rax
je     113a <init_cond+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <fatal_error_with_errno@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Failed to initialize condition variable\00"
define void @init_cond(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_cond_init(i32* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Failed to initialize condition variable\00"
define void @init_cond(i32* %0) {
%2 = tail call i64 @pthread_cond_init(i32* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fatal_error_with_errno(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
int jfs_acl_chmod(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @jfs_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
double da_times(double value, int index, double x) { return value * x; }


x86 assembly (clang, -O0):
<da_times>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<da_times>:
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @da_times(double %0, i32 %1, double %2) {
%4 = alloca double
%5 = alloca i32
%6 = alloca double
store double %0, double* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fmul double %7, %8
ret double %9
}

LLVM IR (-O2):
define double @da_times(double %0, i32 %1, double %2) {
%4 = fmul double %0, %2
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ foo(double, double);
int main() {
  if (sizeof(long double) > sizeof(double))
    foo(-0.0, -1.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  0xed9(%rip),%xmm1
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
movsd  0xee7(%rip),%xmm1
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(double -0.000000e+00, double -1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(double -0.000000e+00, double -1.000000e+00)
ret i32 0
}
/* Variables and functions */
int sendCommit();
int game_commit() { return sendCommit(); }


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

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

LLVM IR (-O0):
define i32 @game_commit() {
%1 = call i32 (...) @sendCommit()
ret i32 %1
}

LLVM IR (-O2):
define i32 @game_commit() {
%1 = tail call i32 (...) @sendCommit()
ret i32 %1
}
void gtk_file_chooser_set_current_folder() {}


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

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

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

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