xunge/DecIR huggingface dataset:
int test_imm_69uint32_reg(unsigned int val) {
  return ((val) & (0x69 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_69uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x69,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_69uint32_reg>:
test   $0x69,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_69uint32_reg(i32 %0) {
%2 = and i32 %0, 105
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct arg_u64 {
  int dummy;
};

/* Variables and functions */
struct arg_u64 *arg_u64_n(char const *, char const *, char const *,
                          int /*<<< orphan*/, int, char const *);
struct arg_u64 *arg_u64_0(const char *shortopts, const char *longopts,
                          const char *datatype, const char *glossary) {
  return arg_u64_n(shortopts, longopts, datatype, 0, 1, glossary);
}


x86 assembly (clang, -O0):
<arg_u64_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r9
xor    %ecx,%ecx
mov    $0x1,%r8d
call   1030 <arg_u64_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arg_u64_0>:
mov    %rcx,%r9
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <arg_u64_n@plt>

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

LLVM IR (-O2):
%struct.arg_u64 = type { i32 }
define %struct.arg_u64* @arg_u64_0(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call %struct.arg_u64* @arg_u64_n(i8* %0, i8* %1, i8* %2, i32 0, i32 1, i8* %3)
ret %struct.arg_u64* %5
}
unsigned long xoseconds(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @xoseconds() {
ret i64 0
}

LLVM IR (-O2):
define i64 @xoseconds() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ my_abort();
__attribute__((always_)) int x(int a, int b) {
  my_abort();
  return a + b;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <my_abort@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <my_abort@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @x(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @my_abort()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @x(i32 %0, i32 %1) {
%3 = tail call i32 (...) @my_abort()
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ restoreIpAddresses(char *, int *);
int main(void) {
  char s[] = "19216811";
  int ret = 0;
  restoreIpAddresses(s, &ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xd(%rbp)
mov    0xed8(%rip),%al
mov    %al,-0x5(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0xd(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <restoreIpAddresses@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3131383631323931,%rax
38 31 31
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x0,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <restoreIpAddresses@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s = [9 x i8] c"19216811\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [9 x i8]* %2 to i8*
store i32 0, i32* %3
%5 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%6 = call i32 @restoreIpAddresses(i8* %5, i32* %3)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [9 x i8] c"19216811\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @restoreIpAddresses(i8* %3, i32* %2)
ret i32 0
}
/* Variables and functions */
long native___NativeString_fetch_4_ffi___impl(char *, long);
long core___core__NativeString___fetch_95d4_ffi(char *self, long p0) {
  long var;
  long var1;
  var1 = native___NativeString_fetch_4_ffi___impl(self, p0);
  var = var1;
  goto RET_LABEL;
RET_LABEL:;
  return var;
}


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

x86 assembly (clang, -O2):
<core___core__NativeString___fetch_95d4_ffi>:
jmp    1030 <native___NativeString_fetch_4_ffi___impl@plt>

LLVM IR (-O0):
define i64 @core___core__NativeString___fetch_95d4_ffi(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
%8 = load i64, i64* %4
%9 = call i64 @native___NativeString_fetch_4_ffi___impl(i8* %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
store i64 %10, i64* %5
br label %11
11: ; preds = %2
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @core___core__NativeString___fetch_95d4_ffi(i8* %0, i64 %1) {
%3 = tail call i64 @native___NativeString_fetch_4_ffi___impl(i8* %0, i64 %1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ ROL16(int /*<<< orphan*/, int);
int /*<<< orphan*/ SA1Absolute(int);
void Op2EM0(void) { ROL16(SA1Absolute(3), 0xFFFFFF); }


x86 assembly (clang, -O0):
<Op2EM0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
call   1040 <ROL16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op2EM0>:
push   %rax
mov    $0x3,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
mov    $0xffffff,%esi
pop    %rax
jmp    1040 <ROL16@plt>

LLVM IR (-O0):
define void @Op2EM0() {
%1 = call i32 @SA1Absolute(i32 3)
%2 = call i32 @ROL16(i32 %1, i32 16777215)
ret void
}

LLVM IR (-O2):
define void @Op2EM0() {
%1 = tail call i32 @SA1Absolute(i32 3)
%2 = tail call i32 @ROL16(i32 %1, i32 16777215)
ret void
}
int test_imm_E4uint32_mem(unsigned int *val) {
  return ((*val) & (0xE4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E4uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xe4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_E4uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 228
%6 = icmp ne i32 %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_E4uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 228
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int hash(const char *s) {
  int h = 0;
  for (; *s; s++) {
    h = h * 37 + *s;
  }
  h = h & 0xFF;
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <hash+0x3d>
imul   $0x25,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%al
test   %al,%al
je     112a <hash+0x2a>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
lea    (%rcx,%rcx,8),%edx
lea    (%rcx,%rdx,4),%edx
movzbl %al,%ecx
add    %edx,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash+0x10>
movzbl %cl,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 37
%9 = zext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 255
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *mystrdup(const char *str) {
  char *copy = malloc(strlen(str) * sizeof(char) + 1);
  if (copy != NULL)
    strcpy(copy, str);
  return copy;
}


x86 assembly (clang, -O0):
<mystrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cltq
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <mystrdup+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1157 <mystrdup+0x27>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @mystrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sext i32 %5 to i64
%7 = mul i64 %6, 1
%8 = add i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
br label %17
17: ; preds = %13, %1
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @mystrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ GenericFaultHandler(unsigned long *);
void BusFault_Handler(unsigned long *hardfault_args) {
  GenericFaultHandler(hardfault_args);
}


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

x86 assembly (clang, -O2):
<BusFault_Handler>:
jmp    1030 <GenericFaultHandler@plt>

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

LLVM IR (-O2):
define void @BusFault_Handler(i64* %0) {
%2 = tail call i32 @GenericFaultHandler(i64* %0)
ret void
}
void VEC_int_must_be_integral_type(void) { (void)~(int)0; }


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

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

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

LLVM IR (-O2):
define void @VEC_int_must_be_integral_type() {
ret void
}
/* Variables and functions */
float finn_vec2_dot(float *, float *);
float sqrt(float);
float finn_vec2_magnitude(float *vec) {
  float temp = finn_vec2_dot(vec, vec);
  return sqrt(temp * temp);
}


x86 assembly (clang, -O0):
<finn_vec2_magnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <finn_vec2_dot@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
call   1040 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finn_vec2_magnitude>:
push   %rax
mov    %rdi,%rsi
call   1030 <finn_vec2_dot@plt>
mulss  %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113b <finn_vec2_magnitude+0x1b>
sqrtss %xmm0,%xmm0
pop    %rax
ret
pop    %rax
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define float @finn_vec2_magnitude(float* %0) {
%2 = alloca float*
%3 = alloca float
store float* %0, float** %2
%4 = load float*, float** %2
%5 = load float*, float** %2
%6 = call float @finn_vec2_dot(float* %4, float* %5)
store float %6, float* %3
%7 = load float, float* %3
%8 = load float, float* %3
%9 = fmul float %7, %8
%10 = call float @sqrt(float %9)
ret float %10
}

LLVM IR (-O2):
define float @finn_vec2_magnitude(float* %0) {
%2 = tail call float @finn_vec2_dot(float* %0, float* %0)
%3 = fmul float %2, %2
%4 = tail call float @sqrt(float %3)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int scanf(char *, int *);
int main(int argc, char *argv[]) {
  int n, ret;
  ret = scanf("%d", &n);
  printf("n:%d, ret:%d\n", n, ret);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"n:%d, ret:%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %5)
ret i32 0
}
_Complex float pass_complex_float(_Complex float arg) { return arg; }


x86 assembly (clang, -O0):
<pass_complex_float>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0x4(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define <2 x float> @pass_complex_float(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
store float %6, float* %9
store float %8, float* %10
%11 = bitcast { float, float }* %2 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
ret <2 x float> %12
}

LLVM IR (-O2):
define <2 x float> @pass_complex_float(<2 x float> returned %0) {
ret <2 x float> %0
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void init_alea() { srand(time(NULL)); }


x86 assembly (clang, -O0):
<init_alea>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_alea>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <srand@plt>

LLVM IR (-O0):
define void @init_alea() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @init_alea() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glutSpaceballRotateFunc(void (*)(int, int, int));
void s2winSpaceballRotateFunc(void (*func)(int x, int y, int z)) {
  glutSpaceballRotateFunc(func);
}


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

x86 assembly (clang, -O2):
<s2winSpaceballRotateFunc>:
jmp    1030 <glutSpaceballRotateFunc@plt>

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

LLVM IR (-O2):
define void @s2winSpaceballRotateFunc(void (i32, i32, i32)* %0) {
%2 = tail call i32 @glutSpaceballRotateFunc(void (i32, i32, i32)* %0)
ret void
}
void XGetKeyboardControl() {}


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

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

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

LLVM IR (-O2):
define void @XGetKeyboardControl() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void usage(char const *progname) {
  fprintf(stderr, "[ERROR] %s: Usage: %s /path/to/sysfs/device/directory\n",
          progname, progname);
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rcx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
mov    %rcx,%rdx
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"[ERROR] %s: Usage: %s /path/to/sysfs/device/directory\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %5)
%7 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"[ERROR] %s: Usage: %s /path/to/sysfs/device/directory\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %0)
%4 = tail call i32 @exit(i32 2)
unreachable
}
int mpic_pasemi_msi_init(struct mpic *mpic) { return -1; }


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

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

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

LLVM IR (-O2):
%struct.mpic = type opaque
define i32 @mpic_pasemi_msi_init(%struct.mpic* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
scalar_t__ fopen(char const *, char const *);
void *PCFileOpen(const char *fullPath, const char *mode) {
  return (void *)fopen(fullPath, mode);
}


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

x86 assembly (clang, -O2):
<PCFileOpen>:
jmp    1030 <fopen@plt>

LLVM IR (-O0):
define i8* @PCFileOpen(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 = call i64 @fopen(i8* %5, i8* %6)
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
define i8* @PCFileOpen(i8* %0, i8* %1) {
%3 = tail call i64 @fopen(i8* %0, i8* %1)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int test_imm_19int64_lowword_reg(long long val) {
  return ((val) & (0x19 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_19int64_lowword_reg>:
test   $0x19,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_19int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 25
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
long g2(double f) { return f; }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i64 @g2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @g2(double %0) {
%2 = fptosi double %0 to i64
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float, float);
int main() {
  float n = 345.6789;
  printf("%.2f \n"
         "%.5f \n"
         "%.0f \n",
         n, n, n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
movaps %xmm0,%xmm1
movaps %xmm0,%xmm2
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"%.2f \0A%.5f \0A%.0f \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float 0x40759ADCC0000000, float 0x40759ADCC0000000, float 0x40759ADCC0000000)
ret i32 0
}
/* Type definitions */
struct kaizen_raw_reliable_frame_time_scope_s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int kaizen_reliable_frame_time_scope_finalize(
    struct kaizen_raw_reliable_frame_time_scope_s *scope) {
  assert(NULL != scope);
  (void)scope;
  return 0;
}


x86 assembly (clang, -O0):
<kaizen_reliable_frame_time_scope_finalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kaizen_reliable_frame_time_scope_finalize>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
setne  %al
mov    %eax,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.kaizen_raw_reliable_frame_time_scope_s = type { i32 }
define i32 @kaizen_reliable_frame_time_scope_finalize(%struct.kaizen_raw_reliable_frame_time_scope_s* %0) {
%2 = alloca %struct.kaizen_raw_reliable_frame_time_scope_s*
store %struct.kaizen_raw_reliable_frame_time_scope_s* %0, %struct.kaizen_raw_reliable_frame_time_scope_s** %2
%3 = load %struct.kaizen_raw_reliable_frame_time_scope_s*, %struct.kaizen_raw_reliable_frame_time_scope_s** %2
%4 = icmp ne %struct.kaizen_raw_reliable_frame_time_scope_s* null, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.kaizen_raw_reliable_frame_time_scope_s*, %struct.kaizen_raw_reliable_frame_time_scope_s** %2
ret i32 0
}

LLVM IR (-O2):
%struct.kaizen_raw_reliable_frame_time_scope_s = type { i32 }
define i32 @kaizen_reliable_frame_time_scope_finalize(%struct.kaizen_raw_reliable_frame_time_scope_s* readnone %0) {
%2 = icmp ne %struct.kaizen_raw_reliable_frame_time_scope_s* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void write_lines(char *pline[], int nlines) {
  while (nlines-- > 0)
    printf("%s\n", *pline++);
}


x86 assembly (clang, -O0):
<write_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
jle    1158 <write_lines+0x48>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rax
mov    %eax,%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    111f <write_lines+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_lines>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <write_lines+0x36>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xed9(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
add    $0x8,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1130 <write_lines+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @write_lines(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 i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp sgt i32 %6, 0
br i1 %8, label %9, label %15
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 = ptrtoint i8* %12 to i32
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %5
15: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @write_lines(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i8** [ %8, %4 ], [ %0, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %6
%10 = ptrtoint i8* %9 to i64
%11 = trunc i64 %10 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = icmp ugt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void prns(char *s) {
  for (; *s; s++) {
    putc((*s & 0377) & ~0200, stdout);
  }
  putc('\n', stdout);
}


x86 assembly (clang, -O0):
<prns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115c <prns+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
and    $0xff,%eax
and    $0xffffff7f,%eax
mov    0x2e9f(%rip),%rcx
mov    (%rcx),%esi
movsbl %al,%edi
call   1030 <putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <prns+0xc>
mov    0x2e7d(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prns>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1148 <prns+0x38>
mov    %rdi,%rbx
add    $0x1,%rbx
mov    0x2eb8(%rip),%r14
nopl   0x0(%rax,%rax,1)
and    $0x7f,%al
mov    (%r14),%esi
movzbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <prns+0x20>
mov    0x2e91(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @prns(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = icmp ne i8 %5, 0
br i1 %6, label %7, label %19
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = and i32 %10, 255
%12 = and i32 %11, -129
%13 = trunc i32 %12 to i8
%14 = load i32, i32* @stdout
%15 = call i32 @putc(i8 signext %13, i32 %14)
br label %16
16: ; preds = %7
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %3
%20 = load i32, i32* @stdout
%21 = call i32 @putc(i8 signext 10, i32 %20)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @prns(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i8* [ %10, %4 ], [ %0, %1 ]
%7 = and i8 %5, 127
%8 = load i32, i32* @stdout
%9 = tail call i32 @putc(i8 signext %7, i32 %8)
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = load i32, i32* @stdout
%15 = tail call i32 @putc(i8 signext 10, i32 %14)
ret void
}
/* Type definitions */
typedef scalar_t__ base;

/* Variables and functions */
int /*<<< orphan*/ barrier();
unsigned long get_uart_base();
void flush(void) {
  unsigned long base = get_uart_base();
  while ((*(volatile unsigned char *)((base) + 0x18)) & (1 << 3))
    barrier();
}


x86 assembly (clang, -O0):
<flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_uart_base@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%al
movzbl %al,%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1155 <flush+0x35>
mov    $0x0,%al
call   1030 <barrier@plt>
jmp    1133 <flush+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush>:
push   %rbx
xor    %eax,%eax
call   1040 <get_uart_base@plt>
testb  $0x8,0x18(%rax)
je     114d <flush+0x2d>
mov    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <barrier@plt>
testb  $0x8,0x18(%rbx)
jne    1140 <flush+0x20>
pop    %rbx
ret

LLVM IR (-O0):
define void @flush() {
%1 = alloca i64
%2 = call i64 (...) @get_uart_base()
store i64 %2, i64* %1
br label %3
3: ; preds = %11, %0
%4 = load i64, i64* %1
%5 = add i64 %4, 24
%6 = inttoptr i64 %5 to i8*
%7 = load volatile i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 8
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = call i32 (...) @barrier()
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @flush() {
%1 = tail call i64 (...) @get_uart_base()
%2 = add i64 %1, 24
%3 = inttoptr i64 %2 to i8*
%4 = load volatile i8, i8* %3
%5 = and i8 %4, 8
%6 = icmp eq i8 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %0, %7
%8 = tail call i32 (...) @barrier()
%9 = load volatile i8, i8* %3
%10 = and i8 %9, 8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addbyte(int);
void DEC_HOST_REG(int host_reg) {
  if (host_reg & 8)
    addbyte(0x41);
  addbyte(0xff);
  addbyte(0xc8 | (host_reg & 7));
}


x86 assembly (clang, -O0):
<DEC_HOST_REG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1134 <DEC_HOST_REG+0x24>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xff,%edi
call   1030 <addbyte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0xc8,%edi
call   1030 <addbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DEC_HOST_REG>:
push   %rbx
mov    %edi,%ebx
test   $0x8,%bl
je     1122 <DEC_HOST_REG+0x12>
mov    $0x41,%edi
call   1030 <addbyte@plt>
mov    $0xff,%edi
call   1030 <addbyte@plt>
and    $0x7,%ebx
or     $0xc8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <addbyte@plt>

LLVM IR (-O0):
define void @DEC_HOST_REG(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 8
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @addbyte(i32 65)
br label %8
8: ; preds = %6, %1
%9 = call i32 @addbyte(i32 255)
%10 = load i32, i32* %2
%11 = and i32 %10, 7
%12 = or i32 200, %11
%13 = call i32 @addbyte(i32 %12)
ret void
}

LLVM IR (-O2):
define void @DEC_HOST_REG(i32 %0) {
%2 = and i32 %0, 8
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @addbyte(i32 65)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @addbyte(i32 255)
%8 = and i32 %0, 7
%9 = or i32 %8, 200
%10 = tail call i32 @addbyte(i32 %9)
ret void
}
/* Variables and functions */
long random_at_most(long);
long random_between(long min, long max) {
  if (min >= max)
    return max;
  return min + random_at_most(max - min);
}


x86 assembly (clang, -O0):
<random_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     113b <random_between+0x2b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115e <random_between+0x4e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
sub    -0x10(%rbp),%rdi
call   1030 <random_at_most@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_between>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
mov    %rsi,%rdi
sub    %rbx,%rdi
jle    1127 <random_between+0x17>
call   1030 <random_at_most@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @random_between(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = load i64, i64* %5
%8 = icmp sge i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i64, i64* %5
store i64 %10, i64* %3
br label %18
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = load i64, i64* %4
%15 = sub nsw i64 %13, %14
%16 = call i64 @random_at_most(i64 %15)
%17 = add nsw i64 %12, %16
store i64 %17, i64* %3
br label %18
18: ; preds = %11, %9
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
define i64 @random_between(i64 %0, i64 %1) {
%3 = icmp sgt i64 %1, %0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = sub nsw i64 %1, %0
%6 = tail call i64 @random_at_most(i64 %5)
%7 = add nsw i64 %6, %0
br label %8
8: ; preds = %2, %4
%9 = phi i64 [ %7, %4 ], [ %1, %2 ]
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ AES128EncryptOneBlockStdcall(int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ *,
                                                int /*<<< orphan*/ *);
void Vale_AES_cipher(uint8_t *out, uint8_t *in, uint8_t *w, uint8_t *sb) {
  AES128EncryptOneBlockStdcall(out, in, w, sb);
}


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

x86 assembly (clang, -O2):
<Vale_AES_cipher>:
jmp    1030 <AES128EncryptOneBlockStdcall@plt>

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

LLVM IR (-O2):
define void @Vale_AES_cipher(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = tail call i32 @AES128EncryptOneBlockStdcall(i32* %0, i32* %1, i32* %2, i32* %3)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
bool extension_implies_markdown(const char *extension) {
  return (strcmp(extension, "md") == 0 || strcmp(extension, "mkd") == 0);
}


x86 assembly (clang, -O0):
<extension_implies_markdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <extension_implies_markdown+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension_implies_markdown>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <extension_implies_markdown+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"md\00"
@.str.1 = [4 x i8] c"mkd\00"
define i32 @extension_implies_markdown(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"md\00"
@.str.1 = [4 x i8] c"mkd\00"
define i32 @extension_implies_markdown(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char *parseChars(char const *, int, int);
char *parseURI(const char *request, int pos) {
  return parseChars(request, pos, 255);
}


x86 assembly (clang, -O0):
<parseURI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0xff,%edx
call   1030 <parseChars@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseURI>:
mov    $0xff,%edx
jmp    1030 <parseChars@plt>

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

LLVM IR (-O2):
define i8* @parseURI(i8* %0, i32 %1) {
%3 = tail call i8* @parseChars(i8* %0, i32 %1, i32 255)
ret i8* %3
}
int max(int x, int y, int z) {
  int max = (x > y) ? x : y;
  return (max > z) ? max : z;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1124 <max+0x24>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    112a <max+0x2a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1147 <max+0x47>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    114d <max+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
cmp    %edx,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @max(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* %4
%9 = load i32, i32* %5
%10 = icmp sgt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %4
br label %15
13: ; preds = %3
%14 = load i32, i32* %5
br label %15
15: ; preds = %13, %11
%16 = phi i32 [ %12, %11 ], [ %14, %13 ]
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = load i32, i32* %7
br label %24
22: ; preds = %15
%23 = load i32, i32* %6
br label %24
24: ; preds = %22, %20
%25 = phi i32 [ %21, %20 ], [ %23, %22 ]
ret i32 %25
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %0, i32 %1
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %5, i32 %2
ret i32 %7
}
void ff_hevc_put_hevc_bi_epel_hv32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv32_8_sse4() {
ret void
}
/* Type definitions */
struct std_bbtree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runtreetest(struct std_bbtree *);
int main(int argc, char *argv[]) {
  struct std_bbtree *tree = NULL;
  int i;
  for (i = 0; i < 10000; i++)
    runtreetest(tree);
  printf("PASSED\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2710,-0x1c(%rbp)
jge    1169 <main+0x49>
mov    -0x18(%rbp),%rdi
call   1040 <runtreetest@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1145 <main+0x25>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2710,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
call   1040 <runtreetest@plt>
add    $0xffffffff,%ebx
jne    1130 <main+0x10>
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.std_bbtree = type { i32 }
@.str = [8 x i8] c"PASSED\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.std_bbtree*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.std_bbtree* null, %struct.std_bbtree** %6
store i32 0, i32* %7
br label %8
8: ; preds = %14, %2
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 10000
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load %struct.std_bbtree*, %struct.std_bbtree** %6
%13 = call i32 @runtreetest(%struct.std_bbtree* %12)
br label %14
14: ; preds = %11
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
br label %8
17: ; preds = %8
%18 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
%struct.std_bbtree = type { i32 }
@str = [7 x i8] c"PASSED\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @runtreetest(%struct.std_bbtree* null)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 10000
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
float *malloc(size_t);
int /*<<< orphan*/ printf(char *, char *);
float *make_float(size_t size) {
  printf("%s\n", "make_float");
  return malloc(size * sizeof(float));
}


x86 assembly (clang, -O0):
<make_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_float>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <printf@plt>
shl    $0x2,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"make_float\00"
define noalias float* @make_float(i64 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%3 = shl i64 %0, 2
%4 = tail call float* @malloc(i64 %3)
ret float* %4
}