xunge/DecIR huggingface dataset:
long hash(char *key, long N) {
  long ans = 0L;
  char *sp;
  for (sp = key; *sp != '\0'; sp++)
    ans = ((7L * ans) + *sp) % N;
  return ans;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <hash+0x57>
imul   $0x7,-0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111c <hash+0x1c>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     1148 <hash+0x48>
add    $0x1,%rdi
xor    %edx,%edx
jmp    1120 <hash+0x20>
xchg   %ax,%ax
cqto
idiv   %rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1144 <hash+0x44>
lea    0x0(,%rdx,8),%rcx
sub    %rdx,%rcx
movsbq %al,%rax
add    %rcx,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
jne    1110 <hash+0x10>
xor    %edx,%edx
div    %esi
jmp    1115 <hash+0x15>
mov    %rdx,%rax
ret
xor    %edx,%edx
mov    %rdx,%rax
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0, i64 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %14, %5 ], [ %3, %2 ]
%7 = phi i8* [ %13, %5 ], [ %0, %2 ]
%8 = phi i64 [ %12, %5 ], [ 0, %2 ]
%9 = mul nsw i64 %8, 7
%10 = sext i8 %6 to i64
%11 = add nsw i64 %9, %10
%12 = srem i64 %11, %1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i64 [ 0, %2 ], [ %12, %5 ]
ret i64 %17
}
int readNothing(void *_ctx, char *buf, int size) { return 0; }


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

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

LLVM IR (-O0):
define i32 @readNothing(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @readNothing(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ft_putstr_fd(char *, int);
void ft_putcolor_fd(char *str, char *color, int fd) {
  ft_putstr_fd(color, fd);
  ft_putstr_fd(str, fd);
  ft_putstr_fd("\033[0;m", fd);
}


x86 assembly (clang, -O0):
<ft_putcolor_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <ft_putstr_fd@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <ft_putstr_fd@plt>
mov    -0x14(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1030 <ft_putstr_fd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putcolor_fd>:
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <ft_putstr_fd@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <ft_putstr_fd@plt>
lea    0xecc(%rip),%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ft_putstr_fd@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[0;m\00"
define void @ft_putcolor_fd(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ft_putstr_fd(i8* %1, i32 %2)
%5 = tail call i32 @ft_putstr_fd(i8* %0, i32 %2)
%6 = tail call i32 @ft_putstr_fd(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ used();
void test_duplicate() { used(); }


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

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

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

LLVM IR (-O2):
define void @test_duplicate() {
%1 = tail call i32 (...) @used()
ret void
}
/* Variables and functions */
scalar_t__ COND_MI();
int /*<<< orphan*/ EA_AY_IX_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_smi_8_ix(void) {
  m68ki_write_8(EA_AY_IX_8(), COND_MI() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_smi_8_ix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_AY_IX_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_MI@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_smi_8_ix>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_AY_IX_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_MI@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_smi_8_ix() {
%1 = call i32 (...) @EA_AY_IX_8()
%2 = call i64 (...) @COND_MI()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_smi_8_ix() {
%1 = tail call i32 (...) @EA_AY_IX_8()
%2 = tail call i64 (...) @COND_MI()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Type definitions */
typedef int fpu_control_t;
typedef int /*<<< orphan*/ fenv_t;

/* Variables and functions */
int FE_ALL_EXCEPT;
int /*<<< orphan*/ _FPU_GETCW(int);
int /*<<< orphan*/ __feraiseexcept(int);
int /*<<< orphan*/ __fesetenv(int /*<<< orphan*/ const *);
int __feupdateenv(const fenv_t *envp) {
  fpu_control_t temp;
  _FPU_GETCW(temp);
  temp = (temp & FE_ALL_EXCEPT);
  __fesetenv(envp);
  __feraiseexcept((int)temp);
  return 0;
}


x86 assembly (clang, -O0):
<__feupdateenv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <_FPU_GETCW@plt>
mov    -0xc(%rbp),%eax
mov    0x2e92(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <__fesetenv@plt>
mov    -0xc(%rbp),%edi
call   1030 <__feraiseexcept@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__feupdateenv>:
push   %rbx
mov    %rdi,%rbx
call   1040 <_FPU_GETCW@plt>
mov    %rbx,%rdi
call   1050 <__fesetenv@plt>
xor    %edi,%edi
call   1030 <__feraiseexcept@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@FE_ALL_EXCEPT = global i32 0
define i32 @__feupdateenv(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32, i32* %3
%5 = call i32 @_FPU_GETCW(i32 %4)
%6 = load i32, i32* %3
%7 = load i32, i32* @FE_ALL_EXCEPT
%8 = and i32 %6, %7
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = call i32 @__fesetenv(i32* %9)
%11 = load i32, i32* %3
%12 = call i32 @__feraiseexcept(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@FE_ALL_EXCEPT = global i32 0
define i32 @__feupdateenv(i32* %0) {
%2 = tail call i32 @_FPU_GETCW(i32 undef)
%3 = tail call i32 @__fesetenv(i32* %0)
%4 = tail call i32 @__feraiseexcept(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void target_singlestep(void) { send_command(0x22); }


x86 assembly (clang, -O0):
<target_singlestep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x22,%edi
call   1030 <send_command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<target_singlestep>:
mov    $0x22,%edi
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @target_singlestep() {
%1 = call i32 @send_command(i32 34)
ret void
}

LLVM IR (-O2):
define void @target_singlestep() {
%1 = tail call i32 @send_command(i32 34)
ret void
}
/* Variables and functions */
int mysum(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 3;
  int b = 20;
  int d = 15;
  int c = 0;
  c = mysum(a, b, d);
  printf("%d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
movl   $0xf,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <mysum@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x14,%esi
mov    $0xf,%edx
call   1040 <mysum@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @mysum(i32 3, i32 20, i32 15)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_64int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x64 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_64int64_midword_mem>:
testb  $0x64,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_64int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 100
%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_64int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 6553600
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int hashMap_equals(const void *toCompare, const void *compare) {
  return toCompare == compare;
}


x86 assembly (clang, -O0):
<hashMap_equals>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashMap_equals>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @hashMap_equals(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hashMap_equals(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
void minimum(double *a, double *b) {
  if (*a < *b)
    *a = 0;
  else
    *b = 0;
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1136 <minimum+0x36>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
jmp    1141 <minimum+0x41>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
movsd  (%rsi),%xmm0
ucomisd (%rdi),%xmm0
cmova  %rdi,%rsi
movq   $0x0,(%rsi)
ret

LLVM IR (-O0):
define void @minimum(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* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp olt double %6, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load double*, double** %3
store double 0.000000e+00, double* %11
br label %14
12: ; preds = %2
%13 = load double*, double** %4
store double 0.000000e+00, double* %13
br label %14
14: ; preds = %12, %10
ret void
}

LLVM IR (-O2):
define void @minimum(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp olt double %3, %4
%6 = select i1 %5, double* %0, double* %1
store double 0.000000e+00, double* %6
ret void
}
int reverse(int n) {
  int i;
  i = 0;
  while (n) {
    i *= 10;
    i += n % 10;
    n /= 10;
  }
  return i;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <reverse+0x43>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
void foo217() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ be32toh(int /*<<< orphan*/);
uint32_t unaligned_read_be32(const void *_u) {
  const struct __attribute__((__packed__, __may_alias__)) {
    uint32_t x;
  } *u = _u;
  return be32toh(u->x);
}


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

x86 assembly (clang, -O2):
<unaligned_read_be32>:
mov    (%rdi),%edi
jmp    1030 <be32toh@plt>

LLVM IR (-O0):
%struct.anon = type { i32 }
define i32 @unaligned_read_be32(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.anon*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.anon*
store %struct.anon* %5, %struct.anon** %3
%6 = load %struct.anon*, %struct.anon** %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @be32toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @unaligned_read_be32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @be32toh(i32 %3)
ret i32 %4
}
int is_prime(int n) {
  if (n <= 1)
    return 0;
  else if (n == 2)
    return 1;
  else {
    int i;
    for (i = 2; i < n; i++) {
      if (n % i == 0)
        return 0;
    }
    return 1;
  }
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     111d <is_prime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    117c <is_prime+0x7c>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <is_prime+0x33>
movl   $0x1,-0x4(%rbp)
jmp    117c <is_prime+0x7c>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1175 <is_prime+0x75>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1162 <is_prime+0x62>
movl   $0x0,-0x4(%rbp)
jmp    117c <is_prime+0x7c>
jmp    1167 <is_prime+0x67>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <is_prime+0x3a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %ecx,%ecx
cmp    $0x2,%edi
jge    110a <is_prime+0xa>
mov    %ecx,%eax
ret
jne    1112 <is_prime+0x12>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <is_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <is_prime+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @is_prime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %28
8: ; preds = %1
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %2
br label %28
12: ; preds = %8
store i32 2, i32* %4
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %17
store i32 0, i32* %2
br label %28
23: ; preds = %17
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %13
27: ; preds = %13
store i32 1, i32* %2
br label %28
28: ; preds = %27, %22, %11, %7
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 2
br i1 %4, label %12, label %7
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %5, %7, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ chg_caseless();
void opt_i(int type, char *s) {
  switch (type) {
  case 2:
    chg_caseless();
    break;
  case 1:
  case 0:
    break;
  }
}


x86 assembly (clang, -O0):
<opt_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x2,%eax
jb     1150 <opt_i+0x40>
jmp    1133 <opt_i+0x23>
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
jne    1155 <opt_i+0x45>
jmp    1144 <opt_i+0x34>
mov    $0x0,%al
call   1030 <chg_caseless@plt>
jmp    1155 <opt_i+0x45>
jmp    1155 <opt_i+0x45>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_i>:
cmp    $0x2,%edi
jne    111c <opt_i+0xc>
xor    %eax,%eax
jmp    1030 <chg_caseless@plt>
ret

LLVM IR (-O0):
define void @opt_i(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
switch i32 %5, label %9 [
i32 2, label %6
i32 1, label %8
i32 0, label %8
]
6: ; preds = %2
%7 = call i32 (...) @chg_caseless()
br label %9
8: ; preds = %2, %2
br label %9
9: ; preds = %2, %8, %6
ret void
}

LLVM IR (-O2):
define void @opt_i(i32 %0, i8* nocapture readnone %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @chg_caseless()
br label %6
6: ; preds = %2, %4
ret void
}
int clz(unsigned int x) { return __builtin_clz(x); }


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @clz(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
ret i32 %4
}

LLVM IR (-O2):
define i32 @clz(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Do not have a file layout like this in your own projects.\n");
  printf("This is only to test that this works.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [59 x i8] c"Do not have a file layout like this in your own projects.\0A\00"
@.str.1 = [39 x i8] c"This is only to test that this works.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [58 x i8] c"Do not have a file layout like this in your own projects.\00"
@str.2 = [38 x i8] c"This is only to test that this works.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int ferror(FILE *file) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ferror(i32* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int wdelch(WINDOW *w) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wdelch(i32* nocapture readnone %0) {
ret i32 0
}
void print_args(int argc, char *argv[]) {}


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

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

LLVM IR (-O0):
define void @print_args(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 @print_args(i32 %0, i8** nocapture %1) {
ret void
}
int main() {
  int *x$1;
  if ((x$1 != 0))
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     111b <main+0x1b>
jmp    111b <main+0x1b>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int update_perf_window() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @update_perf_window() {
ret i32 0
}
/* Variables and functions */
int fastio_read(int, double *, int);
int fastio_read_double(int fd, double *val) {
  return fastio_read(fd, val, sizeof(double));
}


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

x86 assembly (clang, -O2):
<fastio_read_double>:
mov    $0x8,%edx
jmp    1030 <fastio_read@plt>

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

LLVM IR (-O2):
define i32 @fastio_read_double(i32 %0, double* %1) {
%3 = tail call i32 @fastio_read(i32 %0, double* %1, i32 8)
ret i32 %3
}
void foo5(void) { return; }


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

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

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

LLVM IR (-O2):
define void @foo5() {
ret void
}
int square(int number) { return number * number; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mov    %edi,%eax
imul   %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @square(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
int test_imm_49uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x49 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_49uint64_highword_reg>:
movabs $0x4900000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_49uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 313532612608
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ properties;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ getAsciiArt(int /*<<< orphan*/ *, long);
int getProperties(FILE *fp, long bufsize) {
  char properties[256];
  fgets(properties, sizeof(properties), fp);
  fgets(properties, sizeof(properties), fp);
  fgets(properties, sizeof(properties), fp);
  getAsciiArt(fp, bufsize);
  return 0;
}


x86 assembly (clang, -O0):
<getProperties>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1030 <fgets@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1030 <fgets@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1030 <fgets@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <getAsciiArt@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getProperties>:
push   %r15
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %r15,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %r15,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1030 <fgets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <getAsciiArt@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @getProperties(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca [256 x i8]
store i32* %0, i32** %3
store i64 %1, i64* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32*, i32** %3
%8 = call i32 @fgets(i8* %6, i32 256, i32* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%10 = load i32*, i32** %3
%11 = call i32 @fgets(i8* %9, i32 256, i32* %10)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%13 = load i32*, i32** %3
%14 = call i32 @fgets(i8* %12, i32 256, i32* %13)
%15 = load i32*, i32** %3
%16 = load i64, i64* %4
%17 = call i32 @getAsciiArt(i32* %15, i64 %16)
ret i32 0
}

LLVM IR (-O2):
define i32 @getProperties(i32* %0, i64 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @fgets(i8* %4, i32 256, i32* %0)
%6 = call i32 @fgets(i8* %4, i32 256, i32* %0)
%7 = call i32 @fgets(i8* %4, i32 256, i32* %0)
%8 = call i32 @getAsciiArt(i32* %0, i64 %1)
ret i32 0
}
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  long long tmp;
  while (b != 0) {
    tmp = b;
    b = a % b;
    a = tmp;
  }
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <gcd+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = urem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
/* Variables and functions */
int foo_com1(int);
int foo_com3(int x) { return foo_com1(x) + sizeof(int *); }


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

x86 assembly (clang, -O2):
<foo_com3>:
push   %rax
call   1030 <foo_com1@plt>
add    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @foo_com3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @foo_com1(i32 %3)
%5 = sext i32 %4 to i64
%6 = add i64 %5, 8
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @foo_com3(i32 %0) {
%2 = tail call i32 @foo_com1(i32 %0)
%3 = add i32 %2, 8
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void imprimir(int x) { printf("Valor = %d\n", x); }


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

x86 assembly (clang, -O2):
<imprimir>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Valor = %d\0A\00"
define void @imprimir(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Valor = %d\0A\00"
define void @imprimir(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_mail_box(int, int, int);
void clear_my_lmb(int index) { write_mail_box(true, index, false); }


x86 assembly (clang, -O0):
<clear_my_lmb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
xor    %edx,%edx
call   1030 <write_mail_box@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @clear_my_lmb(i32 %0) {
%2 = tail call i32 @write_mail_box(i32 1, i32 %0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ solve(int, int);
int main() {
  solve(112, true);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x70,%edi
mov    $0x1,%esi
call   1030 <solve@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x70,%edi
mov    $0x1,%esi
call   1030 <solve@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @solve(i32 112, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @solve(i32 112, i32 1)
ret i32 0
}
void glGetUniformBlockIndex(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glGetUniformBlockIndex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ cleanup_rmdir(char *);
int /*<<< orphan*/ recursive_cleanup(char *, int /*<<< orphan*/);
void cleanup(void) {
  recursive_cleanup(".", 0);
  chdir("..");
  cleanup_rmdir("dirconc");
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xec6(%rip),%rdi
xor    %esi,%esi
call   1040 <recursive_cleanup@plt>
lea    0xeb7(%rip),%rdi
call   1030 <chdir@plt>
lea    0xeae(%rip),%rdi
call   1050 <cleanup_rmdir@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cleanup>:
push   %rax
lea    0xec9(%rip),%rdi
xor    %esi,%esi
call   1040 <recursive_cleanup@plt>
lea    0xeba(%rip),%rdi
call   1030 <chdir@plt>
lea    0xeb1(%rip),%rdi
pop    %rax
jmp    1050 <cleanup_rmdir@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
@.str.2 = [8 x i8] c"dirconc\00"
define void @cleanup() {
%1 = call i32 @recursive_cleanup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @cleanup_rmdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
@.str.2 = [8 x i8] c"dirconc\00"
define void @cleanup() {
%1 = tail call i32 @recursive_cleanup(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @chdir(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @cleanup_rmdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int threeSumClosest(int *, int, int /*<<< orphan*/);
int main(void) {
  int arr[] = {
      0,
      2,
      1,
      -3,
  };
  printf("%d\n", threeSumClosest(arr, 4, 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <threeSumClosest@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <threeSumClosest@plt>
lea    0xecb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [4 x i32] [i32 0, i32 2, i32 1, i32 -3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @threeSumClosest(i32* %3, i32 4, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [4 x i32] [i32 0, i32 2, i32 1, i32 -3]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @threeSumClosest(i32* %3, i32 4, i32 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ seq_utils_clamp(scalar_t__, int /*<<< orphan*/, int);
scalar_t__ song_get_magic_range();
int /*<<< orphan*/ song_set_magic_range(int /*<<< orphan*/);
void seq_ctrl_adjust_magic_range(int change) {
  song_set_magic_range(seq_utils_clamp(song_get_magic_range() + change, 0, 36));
}


x86 assembly (clang, -O0):
<seq_ctrl_adjust_magic_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <song_get_magic_range@plt>
mov    %rax,%rdi
movslq -0x4(%rbp),%rax
add    %rax,%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1050 <seq_utils_clamp@plt>
mov    %eax,%edi
call   1030 <song_set_magic_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_ctrl_adjust_magic_range>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <song_get_magic_range@plt>
movslq %ebx,%rdi
add    %rax,%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1050 <seq_utils_clamp@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <song_set_magic_range@plt>

LLVM IR (-O0):
define void @seq_ctrl_adjust_magic_range(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @song_get_magic_range()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
%7 = call i32 @seq_utils_clamp(i64 %6, i32 0, i32 36)
%8 = call i32 @song_set_magic_range(i32 %7)
ret void
}

LLVM IR (-O2):
define void @seq_ctrl_adjust_magic_range(i32 %0) {
%2 = tail call i64 (...) @song_get_magic_range()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
%5 = tail call i32 @seq_utils_clamp(i64 %4, i32 0, i32 36)
%6 = tail call i32 @song_set_magic_range(i32 %5)
ret void
}
/* Variables and functions */
double __builtin_arm_vcvtr_d(double, int /*<<< orphan*/);
double test_vcvtrd0(double d) { return __builtin_arm_vcvtr_d(d, 0); }


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

x86 assembly (clang, -O2):
<test_vcvtrd0>:
xor    %edi,%edi
jmp    1030 <__builtin_arm_vcvtr_d@plt>

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

LLVM IR (-O2):
define double @test_vcvtrd0(double %0) {
%2 = tail call double @__builtin_arm_vcvtr_d(double %0, i32 0)
ret double %2
}
/* Type definitions */
struct event_base {
  int dummy;
};

/* Variables and functions */
struct event_base *event_base_new();
struct event_base *AMCEventBase_New() {
  return event_base_new();
}


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

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

LLVM IR (-O0):
%struct.event_base = type { i32 }
define %struct.event_base* @AMCEventBase_New() {
%1 = call %struct.event_base* (...) @event_base_new()
ret %struct.event_base* %1
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
define %struct.event_base* @AMCEventBase_New() {
%1 = tail call %struct.event_base* (...) @event_base_new()
ret %struct.event_base* %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char const *strpbrk(char const *, char *);
int main() {
  const char *c;
  c = "fnord:foo:bar:baz";
  assert(strpbrk(c, ":") == c + 5);
  c = ":/::/:foo/bar:baz";
  assert(strpbrk(c, "/:") == c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xee0(%rip),%rsi
call   1040 <strpbrk@plt>
mov    -0x10(%rbp),%rcx
add    $0x5,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
lea    0xea9(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1040 <strpbrk@plt>
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"fnord:foo:bar:baz\00"
@.str.1 = [2 x i8] c":\00"
@.str.2 = [18 x i8] c":/::/:foo/bar:baz\00"
@.str.3 = [3 x i8] c"/:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strpbrk(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 5
%7 = icmp eq i8* %4, %6
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %2
%10 = load i8*, i8** %2
%11 = call i8* @strpbrk(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%12 = load i8*, i8** %2
%13 = icmp eq i8* %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
%2 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char const *, int /*<<< orphan*/);
int qfilef(const char *fname) {
  if (fname == 0)
    return 0;
  if (access(fname, F_OK) == 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<qfilef>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <qfilef+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1162 <qfilef+0x52>
mov    -0x10(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
cmp    $0x0,%rax
jne    115b <qfilef+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1162 <qfilef+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfilef>:
test   %rdi,%rdi
je     1134 <qfilef+0x24>
push   %rax
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <access@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@F_OK = global i32 0
define i32 @qfilef(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @F_OK
%5 = tail call i64 @access(i8* %0, i32 %4)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %3, %1
%9 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %9
}
/* Variables and functions */
double PADE_2_2(double);
double ARCTAN_0_1(double x) { return x * PADE_2_2(x); }


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

x86 assembly (clang, -O2):
<ARCTAN_0_1>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <PADE_2_2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @ARCTAN_0_1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @PADE_2_2(double %4)
%6 = fmul double %3, %5
ret double %6
}

LLVM IR (-O2):
define double @ARCTAN_0_1(double %0) {
%2 = tail call double @PADE_2_2(double %0)
%3 = fmul double %2, %0
ret double %3
}