xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putchar_fd(int /*<<< orphan*/, int);
void ft_putstr_fd(const char *s, int fd) {
  while (*s)
    ft_putchar_fd(*(s++), fd);
}


x86 assembly (clang, -O0):
<ft_putstr_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114b <ft_putstr_fd+0x3b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <ft_putchar_fd@plt>
jmp    111f <ft_putstr_fd+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr_fd>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <ft_putstr_fd+0x35>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <ft_putchar_fd@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_putstr_fd+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @ft_putstr_fd(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @ft_putchar_fd(i32 %9, i32 %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
int not_picked5() { return 12; }


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

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

LLVM IR (-O0):
define i32 @not_picked5() {
ret i32 12
}

LLVM IR (-O2):
define i32 @not_picked5() {
ret i32 12
}
void SplitRGBRow_Any_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @SplitRGBRow_Any_SSSE3() {
ret void
}
int main(void) {
  int x = 5;
  int *p = &x;
  (int *)p;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%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
%3 = alloca i32*
store i32 0, i32* %1
store i32 5, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
scalar_t__ rand();
double u_random() {
  return ((double)rand() + 0.5) / ((double)2147483647 + 1.0);
}


x86 assembly (clang, -O0):
<u_random>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xee0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_random>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
addsd  0xedb(%rip),%xmm0
mulsd  0xedb(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @u_random() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fdiv double %3, 0x41E0000000000000
ret double %4
}

LLVM IR (-O2):
define double @u_random() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fadd double %2, 5.000000e-01
%4 = fmul double %3, 0x3E00000000000000
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void cvt_u8ALPHA_u8BGR(const uint8_t *src, uint8_t *dest, int w) {
  int x;
  for (x = 0; x < w; ++x) {
    *dest++ = 0;
    *dest++ = 0;
    *dest++ = 0;
  }
}


x86 assembly (clang, -O0):
<cvt_u8ALPHA_u8BGR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    116f <cvt_u8ALPHA_u8BGR+0x6f>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
movl   $0x0,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <cvt_u8ALPHA_u8BGR+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_u8ALPHA_u8BGR>:
test   %edx,%edx
jle    112d <cvt_u8ALPHA_u8BGR+0x1d>
push   %rax
mov    %edx,%eax
shl    $0x2,%rax
lea    (%rax,%rax,2),%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @cvt_u8ALPHA_u8BGR(i32* nocapture readnone %0, i32* nocapture writeonly %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = bitcast i32* %1 to i8*
%7 = zext i32 %2 to i64
%8 = mul nuw nsw i64 %7, 12
br label %9
9: ; preds = %5, %3
ret void
}
int main(int argc, char *argv[]) {
  int b;
  int a = b = 2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
xor    %eax,%eax
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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 2, i32* %6
store i32 2, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
void foo(int x, int y) { __asm__ __volatile__("" : : "d"(x), "r"(y)); }


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

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%edx
ret

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

LLVM IR (-O2):
define void @foo(i32 %0, i32 %1) {
tail call void asm sideeffect "", "{dx},r,~{dirflag},~{fpsr},~{flags}"(i32 %0, i32 %1)
ret void
}
void rop3_126_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk1 = S ^ T;
  stk2 = *D ^ S;
  stk1 = stk1 | stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_126_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_126_0_0>:
xor    %esi,%edx
mov    (%rdi),%al
xor    %sil,%al
or     %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_126_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %7
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %5
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %8
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %8
%25 = zext i8 %24 to i32
%26 = or i32 %23, %25
%27 = trunc i32 %26 to i8
store i8 %27, i8* %7
%28 = load i8, i8* %7
%29 = load i8*, i8** %4
store i8 %28, i8* %29
ret void
}

LLVM IR (-O2):
define void @rop3_126_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, %1
%5 = load i8, i8* %0
%6 = xor i8 %5, %1
%7 = or i8 %6, %4
store i8 %7, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utfail(char *);
void test_api_three(void) { utfail("Failed because I felt like it"); }


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Failed because I felt like it\00"
define void @test_api_three() {
%1 = call i32 @utfail(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [30 x i8] c"Failed because I felt like it\00"
define void @test_api_three() {
%1 = tail call i32 @utfail(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
void mensagem_exit() { printf("Processo com pid %d deu exit()\n", getpid()); }


x86 assembly (clang, -O0):
<mensagem_exit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mensagem_exit>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Processo com pid %d deu exit()\0A\00"
define void @mensagem_exit() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Processo com pid %d deu exit()\0A\00"
define void @mensagem_exit() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void user_dec(void) {}


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

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

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

LLVM IR (-O2):
define void @user_dec() {
ret void
}
double third_order_polynomial(double a, double b, double c, double d,
                              double x) {
  ("enter third_order_polynomial %f %f %f %f %f\n", a, b, c, d, x);
  return ((a * x + b) * x + c) * x + d;
}


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

x86 assembly (clang, -O2):
<third_order_polynomial>:
mulsd  %xmm4,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm2,%xmm0
mulsd  %xmm4,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
@.str = [45 x i8] c"enter third_order_polynomial %f %f %f %f %f\0A\00"
define double @third_order_polynomial(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = load double, double* %8
%14 = load double, double* %9
%15 = load double, double* %10
%16 = load double, double* %6
%17 = load double, double* %10
%18 = load double, double* %7
%19 = call double @llvm.fmuladd.f64(double %16, double %17, double %18)
%20 = load double, double* %10
%21 = load double, double* %8
%22 = call double @llvm.fmuladd.f64(double %19, double %20, double %21)
%23 = load double, double* %10
%24 = load double, double* %9
%25 = call double @llvm.fmuladd.f64(double %22, double %23, double %24)
ret double %25
}

LLVM IR (-O2):
define double @third_order_polynomial(double %0, double %1, double %2, double %3, double %4) {
%6 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %1)
%7 = tail call double @llvm.fmuladd.f64(double %6, double %4, double %2)
%8 = tail call double @llvm.fmuladd.f64(double %7, double %4, double %3)
ret double %8
}
void init_ieee_floats(void) {}


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

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

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

LLVM IR (-O2):
define void @init_ieee_floats() {
ret void
}
/* Variables and functions */
unsigned char *get_dec_inv(char const *, char *);
unsigned char *get_hex_inv(char const *, char *);
unsigned char *inv_pds(const char *inventory) {
  unsigned char *inv;
  inv = get_hex_inv(inventory, "PDS=");
  if (inv != NULL)
    return inv;
  return get_dec_inv(inventory, "PDS10=");
}


x86 assembly (clang, -O0):
<inv_pds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <get_hex_inv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1158 <inv_pds+0x38>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <inv_pds+0x4c>
mov    -0x10(%rbp),%rdi
lea    0xea2(%rip),%rsi
call   1030 <get_dec_inv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_pds>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rsi
call   1040 <get_hex_inv@plt>
test   %rax,%rax
je     1137 <inv_pds+0x17>
pop    %rbx
ret
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <get_dec_inv@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"PDS=\00"
@.str.1 = [7 x i8] c"PDS10=\00"
define i8* @inv_pds(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @get_hex_inv(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %14
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i8* @get_dec_inv(i8* %12, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* %13, i8** %2
br label %14
14: ; preds = %11, %9
%15 = load i8*, i8** %2
ret i8* %15
}

LLVM IR (-O2):
@.str = [5 x i8] c"PDS=\00"
@.str.1 = [7 x i8] c"PDS10=\00"
define i8* @inv_pds(i8* %0) {
%2 = tail call i8* @get_hex_inv(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @get_dec_inv(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
ret i8* %7
}
/* Type definitions */
typedef scalar_t__ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ disconnect(int);
scalar_t__ recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, size_t);
void read_data(int fd) {
  static char buf[1024];
  ssize_t got = recv(fd, buf, 1024, 0);
  if (got == 0) {
    disconnect(fd);
  } else {
    write(0, buf, (size_t)got);
  }
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f0b(%rip),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116d <read_data+0x3d>
mov    -0x4(%rbp),%edi
call   1050 <disconnect@plt>
jmp    117f <read_data+0x4f>
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
lea    0x2ed6(%rip),%rsi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %rbx
mov    %edi,%ebx
lea    0x2f16(%rip),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
test   %rax,%rax
je     115d <read_data+0x2d>
lea    0x2efe(%rip),%rsi
xor    %edi,%edi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1050 <disconnect@plt>

LLVM IR (-O0):
@read_data.buf = internal global [1024 x i8] zeroinitializer
define void @read_data(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @recv(i32 %4, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_data.buf, i64 0, i64 0), i32 1024, i32 0)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* %2
%10 = call i32 @disconnect(i32 %9)
br label %14
11: ; preds = %1
%12 = load i64, i64* %3
%13 = call i32 @write(i32 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_data.buf, i64 0, i64 0), i64 %12)
br label %14
14: ; preds = %11, %8
ret void
}

LLVM IR (-O2):
@read_data.buf = internal global [1024 x i8] zeroinitializer
define void @read_data(i32 %0) {
%2 = tail call i64 @recv(i32 %0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_data.buf, i64 0, i64 0), i32 1024, i32 0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @disconnect(i32 %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @write(i32 0, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @read_data.buf, i64 0, i64 0), i64 %2)
br label %8
8: ; preds = %6, %4
ret void
}
void foo405(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo405(i32 %0) {
ret void
}
void handle_EMT(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_EMT(i32 %0) {
ret void
}
void wpas_p2p_network_removed(struct wpa_supplicant *wpa_s,
                              struct wpa_ssid *ssid) {}


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wpa_ssid = type opaque
define void @wpas_p2p_network_removed(%struct.wpa_supplicant* nocapture %0, %struct.wpa_ssid* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(long double);
int main(void) {
  g(1.23L);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %rsp,%rax
fldt   0xed8(%rip)
fstpt  (%rax)
call   1030 <g@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
fldt   0xee6(%rip)
fstpt  (%rsp)
call   1030 <g@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @g(x86_fp80 0xK3FFF9D70A3D70A3D70A4)
ret i32 0
}
double radians_to_degrees(double radians) {
  return radians * 180.0 / (3.14159265);
}


x86 assembly (clang, -O0):
<radians_to_degrees>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef7(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee2(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<radians_to_degrees>:
mulsd  0xef8(%rip),%xmm0
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @radians_to_degrees(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 1.800000e+02
%5 = fdiv double %4, 0x400921FB53C8D4F1
ret double %5
}

LLVM IR (-O2):
define double @radians_to_degrees(double %0) {
%2 = fmul double %0, 1.800000e+02
%3 = fdiv double %2, 0x400921FB53C8D4F1
ret double %3
}
int _write_r(struct _reent *r, int file, char *ptr, int len) {
  (void)r;
  (void)file;
  (void)ptr;
  (void)len;
  return 0;
}


x86 assembly (clang, -O0):
<_write_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_write_r(%struct._reent* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct._reent*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct._reent* %0, %struct._reent** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load %struct._reent*, %struct._reent** %5
%10 = load i32, i32* %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
ret i32 0
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_write_r(%struct._reent* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, i32 %3) {
ret i32 0
}
void GPIOPortQ4_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @GPIOPortQ4_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int ls_costN_nm9_f0(double const **, double **, int *, double *, int);
int ls_costN_nm9(const double **arg, double **res, int *iw, double *w,
                 int mem) {
  return ls_costN_nm9_f0(arg, res, iw, w, mem);
}


x86 assembly (clang, -O0):
<ls_costN_nm9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1030 <ls_costN_nm9_f0@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm9>:
jmp    1030 <ls_costN_nm9_f0@plt>

LLVM IR (-O0):
define i32 @ls_costN_nm9(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = alloca double**
%7 = alloca double**
%8 = alloca i32*
%9 = alloca double*
%10 = alloca i32
store double** %0, double*** %6
store double** %1, double*** %7
store i32* %2, i32** %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double**, double*** %6
%12 = load double**, double*** %7
%13 = load i32*, i32** %8
%14 = load double*, double** %9
%15 = load i32, i32* %10
%16 = call i32 @ls_costN_nm9_f0(double** %11, double** %12, i32* %13, double* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @ls_costN_nm9(double** %0, double** %1, i32* %2, double* %3, i32 %4) {
%6 = tail call i32 @ls_costN_nm9_f0(double** %0, double** %1, i32* %2, double* %3, i32 %4)
ret i32 %6
}
int endwin() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @endwin() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ D_Close();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void InterruptRpc(int S) {
  D_Close();
  exit(0);
}


x86 assembly (clang, -O0):
<InterruptRpc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <D_Close@plt>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<InterruptRpc>:
push   %rax
xor    %eax,%eax
call   1040 <D_Close@plt>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @InterruptRpc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @D_Close()
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @InterruptRpc(i32 %0) {
%2 = tail call i32 (...) @D_Close()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(int *, int *, int);
int /*<<< orphan*/ mergeSort(int *, int *, int, int);
void sort(int *a, int l, int r) {
  int *aux = (int *)malloc(sizeof(int) * (r - l + 1));
  memcpy(aux, a, sizeof(int) * (r - l + 1));
  mergeSort(a, aux, l, r);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <mergeSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r12
mov    %edx,%eax
sub    %esi,%eax
lea    0x4(,%rax,4),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
call   1030 <memcpy@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mergeSort@plt>

LLVM IR (-O0):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 4, %12
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i32*
store i32* %16, i32** %7
%17 = load i32*, i32** %7
%18 = load i32*, i32** %4
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = sub nsw i32 %19, %20
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = mul i64 4, %23
%25 = trunc i64 %24 to i32
%26 = call i32 @memcpy(i32* %17, i32* %18, i32 %25)
%27 = load i32*, i32** %4
%28 = load i32*, i32** %7
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = call i32 @mergeSort(i32* %27, i32* %28, i32 %29, i32 %30)
ret void
}

LLVM IR (-O2):
define void @sort(i32* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = shl i32 %4, 2
%6 = add i32 %5, 4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i32*
%9 = tail call i32 @memcpy(i32* %8, i32* %0, i32 %6)
%10 = tail call i32 @mergeSort(i32* %0, i32* %8, i32 %1, i32 %2)
ret void
}
int *test() {
  static int a = 3;
  a++;
  return &a;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f0d(%rip)
lea    0x2f06(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
lea    0x2f19(%rip),%rax
addl   $0x1,0x2f12(%rip)
ret

LLVM IR (-O0):
@test.a = internal global i32 3
define i32* @test() {
%1 = load i32, i32* @test.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @test.a
ret i32* @test.a
}

LLVM IR (-O2):
@test.a = internal global i32 3
define i32* @test() {
%1 = load i32, i32* @test.a
%2 = add nsw i32 %1, 1
store i32 %2, i32* @test.a
ret i32* @test.a
}
/* Type definitions */
struct MoveList {
  int dummy;
};
struct Game {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_move_list(struct MoveList *);
struct MoveList *generate_moves(struct Game const *);
int /*<<< orphan*/ print_move_list(struct MoveList *);
int /*<<< orphan*/ printf(char *);
void generate_and_print_move_list(const struct Game *g) {
  struct MoveList *i = generate_moves(g);
  printf("Possible moves: ");
  print_move_list(i);
  printf("\n");
  clear_move_list(i);
}


x86 assembly (clang, -O0):
<generate_and_print_move_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <generate_moves@plt>
mov    %rax,-0x10(%rbp)
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <print_move_list@plt>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <clear_move_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_and_print_move_list>:
push   %rbx
call   1040 <generate_moves@plt>
mov    %rax,%rbx
lea    0xea0(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1060 <print_move_list@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1070 <clear_move_list@plt>

LLVM IR (-O0):
%struct.Game = type { i32 }
%struct.MoveList = type { i32 }
@.str = [17 x i8] c"Possible moves: \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @generate_and_print_move_list(%struct.Game* %0) {
%2 = alloca %struct.Game*
%3 = alloca %struct.MoveList*
store %struct.Game* %0, %struct.Game** %2
%4 = load %struct.Game*, %struct.Game** %2
%5 = call %struct.MoveList* @generate_moves(%struct.Game* %4)
store %struct.MoveList* %5, %struct.MoveList** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.MoveList*, %struct.MoveList** %3
%8 = call i32 @print_move_list(%struct.MoveList* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = load %struct.MoveList*, %struct.MoveList** %3
%11 = call i32 @clear_move_list(%struct.MoveList* %10)
ret void
}

LLVM IR (-O2):
%struct.Game = type { i32 }
%struct.MoveList = type { i32 }
@.str = [17 x i8] c"Possible moves: \00"
define void @generate_and_print_move_list(%struct.Game* %0) {
%2 = tail call %struct.MoveList* @generate_moves(%struct.Game* %0)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @print_move_list(%struct.MoveList* %2)
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @clear_move_list(%struct.MoveList* %2)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
bool eth_addr_is_multicast(const uint8_t ea[6]) { return ea[0] & 1; }


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

x86 assembly (clang, -O2):
<eth_addr_is_multicast>:
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @eth_addr_is_multicast(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @eth_addr_is_multicast(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int arc4random();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int random_number;
  random_number = arc4random() % 65536;
  printf("%d\n", random_number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <arc4random@plt>
mov    $0x10000,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <arc4random@plt>
lea    0xffff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffff0000,%ecx
sub    %ecx,%eax
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <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
store i32 0, i32* %1
%3 = call i32 (...) @arc4random()
%4 = srem i32 %3, 65536
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @arc4random()
%2 = srem i32 %1, 65536
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  int result = getchar() != EOF;
  printf("result = %d\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rcx
xor    %esi,%esi
cmp    (%rcx),%rax
setne  %sil
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i64 0
@.str = [13 x i8] c"result = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp ne i64 %2, %3
%5 = zext i1 %4 to i32
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [13 x i8] c"result = %d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @getchar()
%2 = load i64, i64* @EOF
%3 = icmp ne i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fdouble(double, double);
int main() {
  fdouble(1.0, 2.0);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  0xec9(%rip),%xmm1
call   1030 <fdouble@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <fdouble@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fdouble(double 1.000000e+00, double 2.000000e+00)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fdouble(double 1.000000e+00, double 2.000000e+00)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct stat {
  long st_size;
};

/* Variables and functions */
int stat(char const *, struct stat *);
long file_size(const char *path) {
  struct stat buf;
  if (stat(path, &buf) == -1)
    return -1;
  return buf.st_size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    113f <file_size+0x2f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1147 <file_size+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %eax,%ecx
mov    $0xffffffffffffffff,%rax
cmp    $0xffffffff,%ecx
je     112b <file_size+0x1b>
mov    (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @file_size(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, -1
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i64, i64* %6
%8 = select i1 %5, i64 -1, i64 %7
ret i64 %8
}
void Init_Z80(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_Z80() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mintaka_state_idle();
void mintaka_state_idle_() { mintaka_state_idle(); }


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

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

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

LLVM IR (-O2):
define void @mintaka_state_idle_() {
%1 = tail call i32 (...) @mintaka_state_idle()
ret void
}
void start_thread() {}


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

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

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

LLVM IR (-O2):
define void @start_thread() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestIfBadThingHitsGoodThing(int, int, int);
void TestIfBadThingRunsIntoPlayer(int x, int y, int move_dir) {
  TestIfBadThingHitsGoodThing(x, y, move_dir);
}


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

x86 assembly (clang, -O2):
<TestIfBadThingRunsIntoPlayer>:
jmp    1030 <TestIfBadThingHitsGoodThing@plt>

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

LLVM IR (-O2):
define void @TestIfBadThingRunsIntoPlayer(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @TestIfBadThingHitsGoodThing(i32 %0, i32 %1, i32 %2)
ret void
}
int set_corr(element)
register int element;
{
  if (element == 3 || element == 4)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<set_corr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     111b <set_corr+0x1b>
cmpl   $0x4,-0x8(%rbp)
jne    1127 <set_corr+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <set_corr+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_corr>:
add    $0xfffffffd,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @set_corr(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ c();
int main() {
  c();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @c()
ret i32 0
}
/* Type definitions */
struct nmpa_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *nmpa_alloc(struct nmpa_s *, size_t);
void *nmpa_calloc(struct nmpa_s *nmpa, size_t sz) {
  void *ret = nmpa_alloc(nmpa, sz);
  if (ret) {
    memset(ret, 0, sz);
  }
  return ret;
}


x86 assembly (clang, -O0):
<nmpa_calloc>:
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   1040 <nmpa_alloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115b <nmpa_calloc+0x3b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmpa_calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <nmpa_alloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <nmpa_calloc+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.nmpa_s = type { i32 }
define i8* @nmpa_calloc(%struct.nmpa_s* %0, i64 %1) {
%3 = alloca %struct.nmpa_s*
%4 = alloca i64
%5 = alloca i8*
store %struct.nmpa_s* %0, %struct.nmpa_s** %3
store i64 %1, i64* %4
%6 = load %struct.nmpa_s*, %struct.nmpa_s** %3
%7 = load i64, i64* %4
%8 = call i8* @nmpa_alloc(%struct.nmpa_s* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = load i64, i64* %4
%14 = call i32 @memset(i8* %12, i32 0, i64 %13)
br label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
%struct.nmpa_s = type { i32 }
define i8* @nmpa_calloc(%struct.nmpa_s* %0, i64 %1) {
%3 = tail call i8* @nmpa_alloc(%struct.nmpa_s* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @memset(i8* %3, i32 0, i64 %1)
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
struct int_regs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print(char *);
void primary_irq(struct int_regs *r) { print("ata: irq 14\n"); }


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

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

LLVM IR (-O0):
%struct.int_regs = type { i32 }
@.str = [13 x i8] c"ata: irq 14\0A\00"
define void @primary_irq(%struct.int_regs* %0) {
%2 = alloca %struct.int_regs*
store %struct.int_regs* %0, %struct.int_regs** %2
%3 = call i32 @print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.int_regs = type { i32 }
@.str = [13 x i8] c"ata: irq 14\0A\00"
define void @primary_irq(%struct.int_regs* nocapture readnone %0) {
%2 = tail call i32 @print(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ function(char *);
int sum(char *);
int main() {
  char t[] = "asdf";
  function(t);
  return sum("asdf") % 256;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x9(%rbp),%rdi
call   1040 <function@plt>
lea    0xeaf(%rip),%rdi
call   1030 <sum@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x66647361,0x8(%rsp)
66
lea    0xec7(%rip),%rbx
lea    0x8(%rsp),%rdi
call   1040 <function@plt>
mov    %rbx,%rdi
call   1030 <sum@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.t = [5 x i8] c"asdf\00"
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = bitcast [5 x i8]* %2 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @function(i8* %4)
%6 = call i32 @sum(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = srem i32 %6, 256
ret i32 %7
}

LLVM IR (-O2):
@.str = [5 x i8] c"asdf\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @function(i8* %2)
%4 = call i32 @sum(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = srem i32 %4, 256
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_string(const char *str) { printf("%s\n", str); }


x86 assembly (clang, -O0):
<print_string>:
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):
<print_string>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print_string(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}