xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ doCalcSpringMoving(double, double, double, double,
                                      unsigned int, unsigned int, unsigned int);
void calcSpringMoving(double k, double d, double l0, double l1,
                      unsigned int spr, unsigned int o1, unsigned int o2) {
  if (l1 > l0) {
    doCalcSpringMoving(k, d, l0, l1, spr, o1, o2);
  }
}


x86 assembly (clang, -O0):
<calcSpringMoving>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
mov    %edi,-0x24(%rbp)
mov    %esi,-0x28(%rbp)
mov    %edx,-0x2c(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1167 <calcSpringMoving+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edx
call   1030 <doCalcSpringMoving@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcSpringMoving>:
ucomisd %xmm2,%xmm3
jbe    111b <calcSpringMoving+0xb>
jmp    1030 <doCalcSpringMoving@plt>
ret

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

LLVM IR (-O2):
define void @calcSpringMoving(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6) {
%8 = fcmp ogt double %3, %2
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @doCalcSpringMoving(double %0, double %1, double %2, double %3, i32 %4, i32 %5, i32 %6)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
scalar_t__ _si7021_getReg(int);
float getTemp() {
  return 175.72 * (float)_si7021_getReg(0xF3) / 65536. - 46.85;
}


x86 assembly (clang, -O0):
<getTemp>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf3,%edi
call   1030 <_si7021_getReg@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee1(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xecd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTemp>:
push   %rax
mov    $0xf3,%edi
call   1030 <_si7021_getReg@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed4(%rip),%xmm0
mulsd  0xed4(%rip),%xmm0
addsd  0xed4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @getTemp() {
%1 = call i64 @_si7021_getReg(i32 243)
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fmul double 1.757200e+02, %3
%5 = fdiv double %4, 6.553600e+04
%6 = fsub double %5, 4.685000e+01
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @getTemp() {
%1 = tail call i64 @_si7021_getReg(i32 243)
%2 = sitofp i64 %1 to float
%3 = fpext float %2 to double
%4 = fmul double %3, 1.757200e+02
%5 = fmul double %4, 0x3EF0000000000000
%6 = fadd double %5, -4.685000e+01
%7 = fptrunc double %6 to float
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
long file_size(FILE *fp) {
  long current = ftell(fp);
  fseek(fp, 0L, SEEK_END);
  long size = ftell(fp);
  fseek(fp, current, SEEK_SET);
  return size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e6d(%rip),%rax
mov    (%rax),%edx
call   1040 <fseek@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1030 <ftell@plt>
mov    %rax,%r14
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <ftell@plt>
mov    %rax,%r15
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fseek@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @file_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = call i64 @ftell(i32* %5)
store i64 %6, i64* %3
%7 = load i32*, i32** %2
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %2
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i32*, i32** %2
%13 = load i64, i64* %3
%14 = load i32, i32* @SEEK_SET
%15 = call i32 @fseek(i32* %12, i64 %13, i32 %14)
%16 = load i64, i64* %4
ret i64 %16
}

LLVM IR (-O2):
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
define i64 @file_size(i32* nocapture %0) {
%2 = tail call i64 @ftell(i32* %0)
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %0, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %0)
%6 = load i32, i32* @SEEK_SET
%7 = tail call i32 @fseek(i32* %0, i64 %2, i32 %6)
ret i64 %5
}
/* Variables and functions */
void *memset(void *, int, size_t);
void *gcc_implicit_memset(void *dest, int character, size_t len) {
  return memset(dest, character, len);
}


x86 assembly (clang, -O0):
<gcc_implicit_memset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%rdx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcc_implicit_memset>:
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @gcc_implicit_memset(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = trunc i32 %8 to i8
%10 = load i64, i64* %6
ret i8* %7
}

LLVM IR (-O2):
define i8* @gcc_implicit_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 %4, i64 %2, i1 false)
ret i8* %0
}
void destruirConfigPlataforma() {}


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

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

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

LLVM IR (-O2):
define void @destruirConfigPlataforma() {
ret void
}
/* Variables and functions */
scalar_t__ setregid(int, int);
scalar_t__ setreuid(int, int);
int /*<<< orphan*/ xerror(char *);
void set_executor_creds(void) {
  if (setreuid(3, 3) != 0)
    xerror("setuid for executor");
  if (setregid(3, 3) != 0)
    xerror("setgid for executor");
}


x86 assembly (clang, -O0):
<set_executor_creds>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%esi
mov    %esi,%edi
call   1040 <setreuid@plt>
cmp    $0x0,%rax
je     1156 <set_executor_creds+0x26>
lea    0xeaf(%rip),%rdi
call   1030 <xerror@plt>
mov    $0x3,%esi
mov    %esi,%edi
call   1050 <setregid@plt>
cmp    $0x0,%rax
je     1178 <set_executor_creds+0x48>
lea    0xea1(%rip),%rdi
call   1030 <xerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_executor_creds>:
push   %rax
mov    $0x3,%edi
mov    $0x3,%esi
call   1040 <setreuid@plt>
test   %rax,%rax
je     1151 <set_executor_creds+0x21>
lea    0xeb4(%rip),%rdi
call   1030 <xerror@plt>
mov    $0x3,%edi
mov    $0x3,%esi
call   1050 <setregid@plt>
test   %rax,%rax
je     1172 <set_executor_creds+0x42>
lea    0xea8(%rip),%rdi
pop    %rax
jmp    1030 <xerror@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"setuid for executor\00"
@.str.1 = [20 x i8] c"setgid for executor\00"
define void @set_executor_creds() {
%1 = call i64 @setreuid(i32 3, i32 3)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @xerror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = call i64 @setregid(i32 3, i32 3)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @xerror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"setuid for executor\00"
@.str.1 = [20 x i8] c"setgid for executor\00"
define void @set_executor_creds() {
%1 = tail call i64 @setreuid(i32 3, i32 3)
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @xerror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
%6 = tail call i64 @setregid(i32 3, i32 3)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @xerror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
ret void
}
void __attribute__((weak)) EXTI5_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI5_Callback() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern long long shmem_longlong_cswap(long long *target, long long cond,
                                      long long value, int pe) {
  printf("\nOpenSHMEM Analyzer\n");
}


x86 assembly (clang, -O0):
<shmem_longlong_cswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"\0AOpenSHMEM Analyzer\0A\00"
define i64 @shmem_longlong_cswap(i64* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i64
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
store i64* %0, i64** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%11 = load i64, i64* %5
ret i64 %11
}

LLVM IR (-O2):
@str = [20 x i8] c"\0AOpenSHMEM Analyzer\00"
define i64 @shmem_longlong_cswap(i64* nocapture readnone %0, i64 %1, i64 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i64 undef
}
void ff_hevc_put_hevc_uni_epel_hv64_8_avx2() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @_ZGr51_gnu_Sjava_Sutil_Sregex_SMessagesBundle__properties() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, float);
void float_to_string(char *str, float f) { sprintf(str, "%f", f); }


x86 assembly (clang, -O0):
<float_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
lea    0xecf(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define void @float_to_string(i8* nocapture writeonly %0, float %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kill_producer();
void main(void) { kill_producer(); }


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

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

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @kill_producer()
ret void
}
unsigned long long pyramid(unsigned long long p) {
  return (p * (p * p - 1)) / 6;
}


x86 assembly (clang, -O0):
<pyramid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
imul   -0x8(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
mov    $0x6,%ecx
xor    %edx,%edx
div    %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<pyramid>:
mov    %rdi,%rax
imul   %rdi,%rax
add    $0xffffffffffffffff,%rax
imul   %rdi,%rax
movabs $0xaaaaaaaaaaaaaaab,%rcx
aa aa aa
mul    %rcx
mov    %rdx,%rax
shr    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @pyramid(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* %2
%5 = load i64, i64* %2
%6 = mul i64 %4, %5
%7 = sub i64 %6, 1
%8 = mul i64 %3, %7
%9 = udiv i64 %8, 6
ret i64 %9
}

LLVM IR (-O2):
define i64 @pyramid(i64 %0) {
%2 = mul i64 %0, %0
%3 = add i64 %2, -1
%4 = mul i64 %3, %0
%5 = udiv i64 %4, 6
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
carp_print_conditions() {
  puts("See LICENSE.txt or http://www.gnu.org/licenses/gpl-3.0.txt");
}


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

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

LLVM IR (-O0):
@.str = [59 x i8] c"See LICENSE.txt or http://www.gnu.org/licenses/gpl-3.0.txt\00"
define i32 @carp_print_conditions() {
%1 = alloca i32
%2 = call i32 @puts(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [59 x i8] c"See LICENSE.txt or http://www.gnu.org/licenses/gpl-3.0.txt\00"
define i32 @carp_print_conditions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_string(char *);
void print_debug(char *str) { __console_tx_string(str); }


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

x86 assembly (clang, -O2):
<print_debug>:
jmp    1030 <__console_tx_string@plt>

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

LLVM IR (-O2):
define void @print_debug(i8* %0) {
%2 = tail call i32 @__console_tx_string(i8* %0)
ret void
}
g() {
end:
  goto end;
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <g+0x9>
jmp    1109 <g+0x9>

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

LLVM IR (-O0):
define i32 @g() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define i32 @g() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ fsize(char *);
main() { fsize("/tmp/test/"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"/tmp/test/\00"
define i32 @main() {
%1 = call i32 @fsize(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"/tmp/test/\00"
define i32 @main() {
%1 = tail call i32 @fsize(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void tr_control_dummy_func(void) {}


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

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

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

LLVM IR (-O2):
define void @tr_control_dummy_func() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_unlock(int /*<<< orphan*/ *);
void release_mutex(void *m) {
  (void)pthread_mutex_unlock((pthread_mutex_t *)m);
}


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

x86 assembly (clang, -O2):
<release_mutex>:
jmp    1030 <pthread_mutex_unlock@plt>

LLVM IR (-O0):
define void @release_mutex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @pthread_mutex_unlock(i32* %4)
ret void
}

LLVM IR (-O2):
define void @release_mutex(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_unlock(i32* %2)
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int _nss_clientha_gethostbyname3_r(char const *, int, struct hostent *, char *,
                                   size_t, int *, int *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *);
enum nss_status _nss_clientha_gethostbyname2_r(const char *name, int af,
                                               struct hostent *host,
                                               char *buffer, size_t buflen,
                                               int *errnop, int *h_errnop) {
  return _nss_clientha_gethostbyname3_r(name, af, host, buffer, buflen, errnop,
                                        h_errnop, NULL, NULL);
}


x86 assembly (clang, -O0):
<_nss_clientha_gethostbyname2_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
xor    %r10d,%r10d
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <_nss_clientha_gethostbyname3_r@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_clientha_gethostbyname2_r>:
sub    $0x18,%rsp
mov    0x20(%rsp),%rax
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
mov    %rax,(%rsp)
call   1030 <_nss_clientha_gethostbyname3_r@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @_nss_clientha_gethostbyname2_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.hostent*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32*
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store %struct.hostent* %2, %struct.hostent** %10
store i8* %3, i8** %11
store i64 %4, i64* %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = load i32, i32* %9
%17 = load %struct.hostent*, %struct.hostent** %10
%18 = load i8*, i8** %11
%19 = load i64, i64* %12
%20 = load i32*, i32** %13
%21 = load i32*, i32** %14
%22 = call i32 @_nss_clientha_gethostbyname3_r(i8* %15, i32 %16, %struct.hostent* %17, i8* %18, i64 %19, i32* %20, i32* %21, i32* null, i32* null)
ret i32 %22
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @_nss_clientha_gethostbyname2_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6) {
%8 = tail call i32 @_nss_clientha_gethostbyname3_r(i8* %0, i32 %1, %struct.hostent* %2, i8* %3, i64 %4, i32* %5, i32* %6, i32* null, i32* null)
ret i32 %8
}
int not_use_vlink() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @not_use_vlink() {
ret i32 0
}
void XtGrabKeyboard() {}


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

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

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

LLVM IR (-O2):
define void @XtGrabKeyboard() {
ret void
}
void swap_le16(unsigned short *src, unsigned short *dest) {
  unsigned char *s = (unsigned char *)src;
  unsigned char *d = (unsigned char *)dest;
  d[0] = s[1];
  d[1] = s[0];
}


x86 assembly (clang, -O0):
<swap_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x20(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_le16>:
mov    0x1(%rdi),%al
mov    %al,(%rsi)
mov    (%rdi),%al
mov    %al,0x1(%rsi)
ret

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

LLVM IR (-O2):
define void @swap_le16(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = bitcast i16* %0 to i8*
%4 = bitcast i16* %1 to i8*
%5 = getelementptr inbounds i8, i8* %3, i64 1
%6 = load i8, i8* %5
store i8 %6, i8* %4
%7 = load i8, i8* %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %8
ret void
}
/* Variables and functions */
double acos(int);
int glmComputeVectorLength4d(double const *);
int glmDotProduct4d(double const *, double const *);
double glmComputeVectorAngle4dRad(const double v1[4], const double v2[4]) {
  return acos(glmDotProduct4d(v1, v2) /
              (glmComputeVectorLength4d(v1) * glmComputeVectorLength4d(v2)));
}


x86 assembly (clang, -O0):
<glmComputeVectorAngle4dRad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <glmDotProduct4d@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <glmComputeVectorLength4d@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <glmComputeVectorLength4d@plt>
mov    -0x18(%rbp),%ecx
mov    %eax,%edx
mov    -0x14(%rbp),%eax
imul   %edx,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1040 <acos@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeVectorAngle4dRad>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <glmDotProduct4d@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <glmComputeVectorLength4d@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1050 <glmComputeVectorLength4d@plt>
mov    %eax,%ecx
imul   %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
mov    %eax,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <acos@plt>

LLVM IR (-O0):
define double @glmComputeVectorAngle4dRad(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 @glmDotProduct4d(double* %5, double* %6)
%8 = load double*, double** %3
%9 = call i32 @glmComputeVectorLength4d(double* %8)
%10 = load double*, double** %4
%11 = call i32 @glmComputeVectorLength4d(double* %10)
%12 = mul nsw i32 %9, %11
%13 = sdiv i32 %7, %12
%14 = call double @acos(i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @glmComputeVectorAngle4dRad(double* %0, double* %1) {
%3 = tail call i32 @glmDotProduct4d(double* %0, double* %1)
%4 = tail call i32 @glmComputeVectorLength4d(double* %0)
%5 = tail call i32 @glmComputeVectorLength4d(double* %1)
%6 = mul nsw i32 %5, %4
%7 = sdiv i32 %3, %6
%8 = tail call double @acos(i32 %7)
ret double %8
}
/* Variables and functions */
char const *getFlagKeywordYesNo(int);
const char *bthGetPairedKeyword(int state) {
  return getFlagKeywordYesNo(state);
}


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

x86 assembly (clang, -O2):
<bthGetPairedKeyword>:
jmp    1030 <getFlagKeywordYesNo@plt>

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

LLVM IR (-O2):
define i8* @bthGetPairedKeyword(i32 %0) {
%2 = tail call i8* @getFlagKeywordYesNo(i32 %0)
ret i8* %2
}
int test_imm_67uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x67 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_67uint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x67,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_67uint64_highword_mem>:
testb  $0x67,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_67uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 103
%7 = icmp ne i64 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_67uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 442381631488
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
float magnitude(x, y)
float x, y;
{ return ((float)sqrt((double)(x * x + y * y))); }


x86 assembly (clang, -O0):
<magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm1,-0x10(%rbp)
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <sqrt@plt>
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<magnitude>:
cvtsd2ss %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1131 <magnitude+0x21>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @magnitude(double %0, double %1) {
%3 = alloca float
%4 = alloca float
%5 = fptrunc double %0 to float
%6 = fptrunc double %1 to float
store float %5, float* %3
store float %6, float* %4
%7 = load float, float* %3
%8 = load float, float* %3
%9 = load float, float* %4
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
%13 = fpext float %12 to double
%14 = call double @sqrt(double %13)
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @magnitude(double %0, double %1) {
%3 = fptrunc double %0 to float
%4 = fptrunc double %1 to float
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %3, float %3, float %5)
%7 = tail call float @sqrtf(float %6)
ret float %7
}
int main(int argc, char *argv[]) {
  const unsigned N = 1 << 5;
  unsigned B[N];
  unsigned A[N];
  B[0] = argc;
  B[1] = (unsigned)argv;
  for (unsigned i = 0; i < N; ++i) {
    A[i] = i;
    B[i] = i;
  }
  return ((unsigned)&B[N - 1]) % 4;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x20,-0x14(%rbp)
mov    %rsp,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xb0(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0xac(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x20,-0x24(%rbp)
jae    1173 <main+0x73>
mov    -0x24(%rbp),%ecx
mov    -0x24(%rbp),%eax
mov    %ecx,-0x130(%rbp,%rax,4)
mov    -0x24(%rbp),%ecx
mov    -0x24(%rbp),%eax
mov    %ecx,-0xb0(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1141 <main+0x41>
lea    -0xb0(%rbp),%rax
add    $0x7c,%rax
and    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 32, i32* %6
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %7
%10 = alloca i32, i64 32
%11 = alloca i32, i64 32
%12 = load i32, i32* %4
%13 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %12, i32* %13
%14 = load i8**, i8*** %5
%15 = ptrtoint i8** %14 to i32
%16 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %15, i32* %16
store i32 0, i32* %8
br label %17
17: ; preds = %29, %2
%18 = load i32, i32* %8
%19 = icmp ult i32 %18, 32
br i1 %19, label %20, label %32
20: ; preds = %17
%21 = load i32, i32* %8
%22 = load i32, i32* %8
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %11, i64 %23
store i32 %21, i32* %24
%25 = load i32, i32* %8
%26 = load i32, i32* %8
%27 = zext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %10, i64 %27
store i32 %25, i32* %28
br label %29
29: ; preds = %20
%30 = load i32, i32* %8
%31 = add i32 %30, 1
store i32 %31, i32* %8
br label %17
32: ; preds = %17
%33 = getelementptr inbounds i32, i32* %10, i64 31
%34 = ptrtoint i32* %33 to i32
%35 = urem i32 %34, 4
store i32 %35, i32* %3
%36 = load i8*, i8** %7
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ setForeColor(int);
int /*<<< orphan*/ setPixel(int, int);
void clearBoardArea() {
  setForeColor(0x0);
  uint32_t x;
  uint32_t y;
  for (y = 34; y <= 730; y++) {
    for (x = 112; x <= 910; x++) {
      setPixel(x, y);
    }
  }
}


x86 assembly (clang, -O0):
<clearBoardArea>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <setForeColor@plt>
movl   $0x22,-0x8(%rbp)
cmpl   $0x2da,-0x8(%rbp)
jg     1183 <clearBoardArea+0x63>
movl   $0x70,-0x4(%rbp)
cmpl   $0x38e,-0x4(%rbp)
jg     1170 <clearBoardArea+0x50>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <setPixel@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    114a <clearBoardArea+0x2a>
jmp    1175 <clearBoardArea+0x55>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <clearBoardArea+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearBoardArea>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <setForeColor@plt>
mov    $0x22,%ebx
nop
mov    $0x70,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <setPixel@plt>
add    $0x1,%ebp
cmp    $0x38f,%ebp
jne    1140 <clearBoardArea+0x20>
add    $0x1,%ebx
cmp    $0x2db,%ebx
jne    1130 <clearBoardArea+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @clearBoardArea() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @setForeColor(i32 0)
store i32 34, i32* %2
br label %4
4: ; preds = %19, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 730
br i1 %6, label %7, label %22
7: ; preds = %4
store i32 112, i32* %1
br label %8
8: ; preds = %15, %7
%9 = load i32, i32* %1
%10 = icmp sle i32 %9, 910
br i1 %10, label %11, label %18
11: ; preds = %8
%12 = load i32, i32* %1
%13 = load i32, i32* %2
%14 = call i32 @setPixel(i32 %12, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %1
%17 = add nsw i32 %16, 1
store i32 %17, i32* %1
br label %8
18: ; preds = %8
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = add nsw i32 %20, 1
store i32 %21, i32* %2
br label %4
22: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clearBoardArea() {
%1 = tail call i32 @setForeColor(i32 0)
br label %2
2: ; preds = %0, %9
%3 = phi i32 [ 34, %0 ], [ %10, %9 ]
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 112, %2 ], [ %7, %4 ]
%6 = tail call i32 @setPixel(i32 %5, i32 %3)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 911
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = add nuw nsw i32 %3, 1
%11 = icmp eq i32 %10, 731
br i1 %11, label %12, label %2
12: ; preds = %9
ret void
}
void wpas_dbus_signal_certification(struct wpa_supplicant *wpa_s, int depth,
                                    const char *subject, const char *cert_hash,
                                    const struct wpabuf *cert) {}


x86 assembly (clang, -O0):
<wpas_dbus_signal_certification>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wpabuf = type opaque
define void @wpas_dbus_signal_certification(%struct.wpa_supplicant* %0, i32 %1, i8* %2, i8* %3, %struct.wpabuf* %4) {
%6 = alloca %struct.wpa_supplicant*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.wpabuf*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store %struct.wpabuf* %4, %struct.wpabuf** %10
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpabuf = type opaque
define void @wpas_dbus_signal_certification(%struct.wpa_supplicant* nocapture %0, i32 %1, i8* nocapture %2, i8* nocapture %3, %struct.wpabuf* nocapture %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ restOfLine;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
void skipRestOfInput(FILE *stream) {
  char restOfLine[256];
  int rolLength = sizeof(restOfLine) / sizeof(restOfLine[0]);
  fgets(restOfLine, rolLength, stream);
}


x86 assembly (clang, -O0):
<skipRestOfInput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x100,-0x114(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x114(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1030 <fgets@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipRestOfInput>:
sub    $0x108,%rsp
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x100,%esi
call   1030 <fgets@plt>
add    $0x108,%rsp
ret

LLVM IR (-O0):
define void @skipRestOfInput(i32* %0) {
%2 = alloca i32*
%3 = alloca [256 x i8]
%4 = alloca i32
store i32* %0, i32** %2
store i32 256, i32* %4
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = load i32, i32* %4
%7 = load i32*, i32** %2
%8 = call i32 @fgets(i8* %5, i32 %6, i32* %7)
ret void
}

LLVM IR (-O2):
define void @skipRestOfInput(i32* nocapture %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @fgets(i8* %3, i32 256, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutMainLoop();
int /*<<< orphan*/ initGlut(int *, char **);
int /*<<< orphan*/ initServer(int *, char **);
int main(int argc, char **argv) {
  initGlut(&argc, argv);
  initServer(&argc, argv);
  glutMainLoop();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <initGlut@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <initServer@plt>
xor    %eax,%eax
call   1030 <glutMainLoop@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @initGlut(i32* %3, i8** %1)
%5 = call i32 @initServer(i32* %3, i8** %1)
%6 = call i32 (...) @glutMainLoop()
ret i32 0
}
/* Type definitions */
struct tm {
  int dummy;
};
struct stat {
  int /*<<< orphan*/ st_mtime;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int stat(char *, struct stat *);
struct tm *last_mod_timestamp(char *filename) {
  struct stat st;
  struct tm *timestamp;
  int result = stat(filename, &st);
  if (result == 0) {
    timestamp = gmtime(&st.st_mtime);
  }
  return timestamp;
}


x86 assembly (clang, -O0):
<last_mod_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1153 <last_mod_timestamp+0x33>
lea    -0x10(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<last_mod_timestamp>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
test   %ecx,%ecx
je     1131 <last_mod_timestamp+0x11>
pop    %rcx
ret
mov    %rsp,%rdi
call   1040 <gmtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
%struct.stat = type { i32 }
define %struct.tm* @last_mod_timestamp(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
%4 = alloca %struct.tm*
%5 = alloca i32
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 @stat(i8* %6, %struct.stat* %3)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%12 = call %struct.tm* @gmtime(i32* %11)
store %struct.tm* %12, %struct.tm** %4
br label %13
13: ; preds = %10, %1
%14 = load %struct.tm*, %struct.tm** %4
ret %struct.tm* %14
}

LLVM IR (-O2):
%struct.tm = type { i32 }
%struct.stat = type { i32 }
define %struct.tm* @last_mod_timestamp(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = call %struct.tm* @gmtime(i32* %7)
br label %9
9: ; preds = %6, %1
%10 = phi %struct.tm* [ %8, %6 ], [ undef, %1 ]
ret %struct.tm* %10
}
void hardware_rand64_fini(void) {}


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

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

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

LLVM IR (-O2):
define void @hardware_rand64_fini() {
ret void
}
void back_extdom_set_timeout(struct nss_ops_ctx *nss_context,
                             unsigned int timeout) {}


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

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

LLVM IR (-O0):
%struct.nss_ops_ctx = type opaque
define void @back_extdom_set_timeout(%struct.nss_ops_ctx* %0, i32 %1) {
%3 = alloca %struct.nss_ops_ctx*
%4 = alloca i32
store %struct.nss_ops_ctx* %0, %struct.nss_ops_ctx** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.nss_ops_ctx = type opaque
define void @back_extdom_set_timeout(%struct.nss_ops_ctx* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printUsage(char *cmd) {
  printf("Use: %s [options] <condor log file> <total number of jobs>\n", cmd);
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"Use: %s [options] <condor log file> <total number of jobs>\0A\00"
define void @printUsage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Use: %s [options] <condor log file> <total number of jobs>\0A\00"
define void @printUsage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar1();
int /*<<< orphan*/ bar2();
int /*<<< orphan*/ foo1();
int /*<<< orphan*/ foo2();
int bar() {
  foo1();
  foo2();
  bar1();
  bar2();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <foo1@plt>
mov    $0x0,%al
call   1040 <foo2@plt>
mov    $0x0,%al
call   1050 <bar1@plt>
mov    $0x0,%al
call   1030 <bar2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
xor    %eax,%eax
call   1060 <foo1@plt>
xor    %eax,%eax
call   1040 <foo2@plt>
xor    %eax,%eax
call   1050 <bar1@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bar2@plt>

LLVM IR (-O0):
define i32 @bar() {
%1 = alloca i32
%2 = call i32 (...) @foo1()
%3 = call i32 (...) @foo2()
%4 = call i32 (...) @bar1()
%5 = call i32 (...) @bar2()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 (...) @foo1()
%2 = tail call i32 (...) @foo2()
%3 = tail call i32 (...) @bar1()
%4 = tail call i32 (...) @bar2()
ret i32 undef
}
/* Variables and functions */
int float_round_int(double);
int round_int(double d) { return float_round_int(d); }


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

x86 assembly (clang, -O2):
<round_int>:
jmp    1030 <float_round_int@plt>

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

LLVM IR (-O2):
define i32 @round_int(double %0) {
%2 = tail call i32 @float_round_int(double %0)
ret i32 %2
}
void archdep_ui_init(int argc, char *argv[]) {}


x86 assembly (clang, -O0):
<archdep_ui_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @archdep_ui_init(i32 %0, i8** nocapture %1) {
ret void
}
int main(void) {
  int a;
  a = 0x1983;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1983,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 6531, i32* %2
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
ret i32 6531
}
/* Type definitions */
struct target {
  int dummy;
};

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *);
char *dump_sys_vhangup(int depth, struct target *target) {
  char *param_str = malloc(5);
  snprintf(param_str, 5, "void");
  return param_str;
}


x86 assembly (clang, -O0):
<dump_sys_vhangup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x5,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_sys_vhangup>:
push   %rbx
mov    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xecb(%rip),%rdx
mov    %rax,%rdi
mov    $0x5,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.target = type { i32 }
@.str = [5 x i8] c"void\00"
define i8* @dump_sys_vhangup(i32 %0, %struct.target* nocapture readnone %1) {
%3 = tail call dereferenceable_or_null(5) i8* @malloc(i32 5)
%4 = tail call i32 @snprintf(i8* %3, i32 5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}