xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strchr(char *, char);
int is_consonant(char c) { return (strchr("bcdfgjklmnprstvxz", c) != 0); }


x86 assembly (clang, -O0):
<is_consonant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_consonant>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"bcdfgjklmnprstvxz\00"
define i32 @is_consonant(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @strchr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"bcdfgjklmnprstvxz\00"
define i32 @is_consonant(i8 signext %0) {
%2 = tail call i64 @strchr(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void test_method() { return; }


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

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

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

LLVM IR (-O2):
define void @test_method() {
ret void
}
int bufpair(unsigned char *p, int n) { return p[n] + 256 * p[n + 1]; }


x86 assembly (clang, -O0):
<bufpair>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bufpair>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @bufpair(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = mul nsw i32 256, %17
%19 = add nsw i32 %10, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @bufpair(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ fabs(double);
double lr_round_half_down(int /*<<< orphan*/, double);
double lr_round_half_down0(double value, double rf) {
  double result;
  result = lr_round_half_down(fabs(value), rf);
  if (value < 0.0)
    return -result;
  return result;
}


x86 assembly (clang, -O0):
<lr_round_half_down0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <fabs@plt>
mov    %eax,%edi
movsd  -0x18(%rbp),%xmm0
call   1030 <lr_round_half_down@plt>
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1181 <lr_round_half_down0+0x61>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    118b <lr_round_half_down0+0x6b>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lr_round_half_down0>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movaps %xmm0,0x10(%rsp)
call   1040 <fabs@plt>
mov    %eax,%edi
movsd  0x8(%rsp),%xmm0
call   1030 <lr_round_half_down@plt>
movapd 0xeb7(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd 0x10(%rsp),%xmm3
cmpltsd %xmm2,%xmm3
movapd %xmm3,%xmm2
andnpd %xmm0,%xmm2
andpd  %xmm1,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm3,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @lr_round_half_down0(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
%7 = load double, double* %4
%8 = call i32 @fabs(double %7)
%9 = load double, double* %5
%10 = call double @lr_round_half_down(i32 %8, double %9)
store double %10, double* %6
%11 = load double, double* %4
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %16
13: ; preds = %2
%14 = load double, double* %6
%15 = fneg double %14
store double %15, double* %3
br label %18
16: ; preds = %2
%17 = load double, double* %6
store double %17, double* %3
br label %18
18: ; preds = %16, %13
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @lr_round_half_down0(double %0, double %1) {
%3 = tail call i32 @fabs(double %0)
%4 = tail call double @lr_round_half_down(i32 %3, double %1)
%5 = fcmp olt double %0, 0.000000e+00
%6 = fneg double %4
%7 = select i1 %5, double %6, double %4
ret double %7
}
/* Variables and functions */
double floor(double);
double limitAngle1(double L) {
  double F;
  F = L - floor(L);
  if (F < 0)
    return F += 1;
  return F;
}


x86 assembly (clang, -O0):
<limitAngle1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    116c <limitAngle1+0x5c>
movsd  0xea8(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm0,-0x8(%rbp)
jmp    1176 <limitAngle1+0x66>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitAngle1>:
sub    $0x18,%rsp
movapd %xmm0,(%rsp)
call   1030 <floor@plt>
movapd (%rsp),%xmm3
subsd  %xmm0,%xmm3
movsd  0xed1(%rip),%xmm1
addsd  %xmm3,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm3,%xmm0
cmpltsd %xmm2,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm3,%xmm0
orpd   %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @limitAngle1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %3
%5 = load double, double* %3
%6 = load double, double* %3
%7 = call double @llvm.floor.f64(double %6)
%8 = fsub double %5, %7
store double %8, double* %4
%9 = load double, double* %4
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load double, double* %4
%13 = fadd double %12, 1.000000e+00
store double %13, double* %4
store double %13, double* %2
br label %16
14: ; preds = %1
%15 = load double, double* %4
store double %15, double* %2
br label %16
16: ; preds = %14, %11
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @limitAngle1(double %0) {
%2 = tail call double @llvm.floor.f64(double %0)
%3 = fsub double %0, %2
%4 = fcmp olt double %3, 0.000000e+00
%5 = fadd double %3, 1.000000e+00
%6 = select i1 %4, double %5, double %3
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
scalar_t__ CPU_ISSET(int, int /*<<< orphan*/ *);
int cpuset_to_mask(cpu_set_t *cpuset) {
  int core;
  int mask = 0;
  for (core = 0; core < 31; core++) {
    if (CPU_ISSET(core, cpuset)) {
      mask = mask | 1 << core;
    }
  }
  return mask;
}


x86 assembly (clang, -O0):
<cpuset_to_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f,-0xc(%rbp)
jge    1171 <cpuset_to_mask+0x61>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <CPU_ISSET@plt>
cmp    $0x0,%rax
je     115e <cpuset_to_mask+0x4e>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <cpuset_to_mask+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <cpuset_to_mask+0x1a>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpuset_to_mask>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %r15d,%r15d
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <CPU_ISSET@plt>
mov    $0x1,%edx
mov    %ebx,%ecx
shl    %cl,%edx
test   %rax,%rax
cmove  %r15d,%edx
or     %edx,%ebp
add    $0x1,%ebx
cmp    $0x1f,%ebx
jne    1130 <cpuset_to_mask+0x20>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @cpuset_to_mask(i32* %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i32 [ 0, %1 ], [ %9, %2 ]
%4 = phi i32 [ 0, %1 ], [ %10, %2 ]
%5 = tail call i64 @CPU_ISSET(i32 %4, i32* %0)
%6 = icmp eq i64 %5, 0
%7 = shl nuw nsw i32 1, %4
%8 = select i1 %6, i32 0, i32 %7
%9 = or i32 %8, %3
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 31
br i1 %11, label %12, label %2
12: ; preds = %2
ret i32 %9
}
/* Variables and functions */
long long getllint();
int /*<<< orphan*/ putllint(long long);
int main() {
  long long int x = getllint();
  putllint(x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getllint@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <putllint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i64
%2 = call i64 (...) @getllint()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @putllint(i64 %3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 (...) @getllint()
%2 = tail call i32 @putllint(i64 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void help_init() {
  puts("init [<hotel name>]\n"
       "Creates a binary file with the .hms (Hotel Management System)\n"
       "extension. Prompts for hotel name if not provided as parameter, and\n"
       "for number of rooms.");
}


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

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

LLVM IR (-O0):
@.str = [171 x i8] c"init [<hotel name>]\0ACreates a binary file with the .hms (Hotel Management System)\0Aextension. Prompts for hotel name if not provided as parameter, and\0Afor number of rooms.\00"
define void @help_init() {
%1 = call i32 @puts(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [171 x i8] c"init [<hotel name>]\0ACreates a binary file with the .hms (Hotel Management System)\0Aextension. Prompts for hotel name if not provided as parameter, and\0Afor number of rooms.\00"
define void @help_init() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_stuff(void) { puts("Doing stuff while waiting for alarm...."); }


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Doing stuff while waiting for alarm....\00"
define void @do_stuff() {
%1 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Doing stuff while waiting for alarm....\00"
define void @do_stuff() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct ibv_context {
  int dummy;
};

/* Variables and functions */
int ibv_close_device(struct ibv_context *);
int mlx4_glue_close_device(struct ibv_context *context) {
  return ibv_close_device(context);
}


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

x86 assembly (clang, -O2):
<mlx4_glue_close_device>:
jmp    1030 <ibv_close_device@plt>

LLVM IR (-O0):
%struct.ibv_context = type { i32 }
define i32 @mlx4_glue_close_device(%struct.ibv_context* %0) {
%2 = alloca %struct.ibv_context*
store %struct.ibv_context* %0, %struct.ibv_context** %2
%3 = load %struct.ibv_context*, %struct.ibv_context** %2
%4 = call i32 @ibv_close_device(%struct.ibv_context* %3)
ret i32 %4
}

LLVM IR (-O2):
%struct.ibv_context = type { i32 }
define i32 @mlx4_glue_close_device(%struct.ibv_context* %0) {
%2 = tail call i32 @ibv_close_device(%struct.ibv_context* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ufree(void *data) {
  if (data != (void *)0)
    free(data);
}


x86 assembly (clang, -O0):
<ufree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <ufree+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ufree>:
test   %rdi,%rdi
je     111a <ufree+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @ufree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
int test_imm_0Fuint16_mem(unsigned short *val) {
  return ((*val) & (-0x0F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Fuint16_mem>:
movzwl (%rdi),%eax
test   $0xfff1,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -15
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int fn5(int a, int b) {
  int tem1 = a | b;
  int tem2 = a & b;
  return tem1 + tem2;
}


x86 assembly (clang, -O0):
<fn5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn5>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @fn5(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = or i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = and i32 %10, %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @fn5(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ OCSP_SINGLERESP;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ OCSP_SINGLERESP_it;
OCSP_SINGLERESP *OCSP_SINGLERESP_new(void) {
  return (OCSP_SINGLERESP *)ASN1_item_new(&OCSP_SINGLERESP_it);
}


x86 assembly (clang, -O0):
<OCSP_SINGLERESP_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<OCSP_SINGLERESP_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@OCSP_SINGLERESP_it = global i32 0
define i32* @OCSP_SINGLERESP_new() {
%1 = call i64 @ASN1_item_new(i32* @OCSP_SINGLERESP_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@OCSP_SINGLERESP_it = global i32 0
define i32* @OCSP_SINGLERESP_new() {
%1 = tail call i64 @ASN1_item_new(i32* @OCSP_SINGLERESP_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
unsigned long do_gettimeoffset_cyclone(void) {}


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

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

LLVM IR (-O0):
define i64 @do_gettimeoffset_cyclone() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @do_gettimeoffset_cyclone() {
ret i64 undef
}
int find_quote(char *str, int index) {
  while (str[index] != '"')
    index++;
  return index;
}


x86 assembly (clang, -O0):
<find_quote>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x22,%eax
je     112e <find_quote+0x2e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110b <find_quote+0xb>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_quote>:
movslq %esi,%rcx
lea    -0x1(%rcx),%eax
add    %rcx,%rdi
nopl   0x0(%rax)
add    $0x1,%eax
cmpb   $0x22,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <find_quote+0x10>
ret

LLVM IR (-O0):
define i32 @find_quote(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 = %13, %2
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 34
br i1 %12, label %13, label %16
13: ; preds = %5
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = load i32, i32* %4
ret i32 %17
}

LLVM IR (-O2):
define i32 @find_quote(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %9, %4 ], [ %3, %2 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 34
%9 = add i64 %5, 1
br i1 %8, label %10, label %4
10: ; preds = %4
%11 = trunc i64 %5 to i32
ret i32 %11
}
int init(int argc, char **argv) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
double SDL_strtod(char const *, void *);
double SDL_atof(const char *string) { return SDL_strtod(string, ((void *)0)); }


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

x86 assembly (clang, -O2):
<SDL_atof>:
xor    %esi,%esi
jmp    1030 <SDL_strtod@plt>

LLVM IR (-O0):
define double @SDL_atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @SDL_strtod(i8* %3, i8* null)
ret double %4
}

LLVM IR (-O2):
define double @SDL_atof(i8* %0) {
%2 = tail call double @SDL_strtod(i8* %0, i8* null)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, char **);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[], char *envp[]) {
  printf("execing...\n");
  execve("bin/args", argv, envp);
  printf("STILL HERE... NOT GOOD!!!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xebe(%rip),%rdi
call   1040 <execve@plt>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <execve@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"execing...\0A\00"
@.str.1 = [9 x i8] c"bin/args\00"
@.str.2 = [27 x i8] c"STILL HERE... NOT GOOD!!!\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%8 = load i8**, i8*** %5
%9 = load i8**, i8*** %6
%10 = call i32 @execve(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %8, i8** %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"bin/args\00"
@str = [11 x i8] c"execing...\00"
@str.3 = [26 x i8] c"STILL HERE... NOT GOOD!!!\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @execve(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %1, i8** %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int a2(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @a2() {
ret i32 2
}

LLVM IR (-O2):
define i32 @a2() {
ret i32 2
}
int getsrvadr(char *host, struct addrinfo *res) {
  int ret = -1;
  return ret;
}


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

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

LLVM IR (-O0):
%struct.addrinfo = type opaque
define i32 @getsrvadr(i8* %0, %struct.addrinfo* %1) {
%3 = alloca i8*
%4 = alloca %struct.addrinfo*
%5 = alloca i32
store i8* %0, i8** %3
store %struct.addrinfo* %1, %struct.addrinfo** %4
store i32 -1, i32* %5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.addrinfo = type opaque
define i32 @getsrvadr(i8* nocapture readnone %0, %struct.addrinfo* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t lyd(uint16_t year) {
  year += 1900;
  if (year % 4 == 0) {
    if (year % 100 != 0) {
      return 366;
    } else if (year % 400 == 0) {
      return 366;
    }
  }
  return 365;
}


x86 assembly (clang, -O0):
<lyd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1170 <lyd+0x70>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1146 <lyd+0x46>
movl   $0x16e,-0x4(%rbp)
jmp    1177 <lyd+0x77>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1166 <lyd+0x66>
movl   $0x16e,-0x4(%rbp)
jmp    1177 <lyd+0x77>
jmp    116b <lyd+0x6b>
jmp    1170 <lyd+0x70>
movl   $0x16d,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lyd>:
test   $0x3,%dil
jne    1149 <lyd+0x49>
add    $0x76c,%edi
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
mov    $0x16e,%eax
cmp    $0x28f5c28,%ecx
ja     114e <lyd+0x4e>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x27,%rcx
add    %edx,%ecx
imul   $0x190,%ecx,%ecx
sub    %ecx,%edi
je     114e <lyd+0x4e>
mov    $0x16d,%eax
ret

LLVM IR (-O0):
define i32 @lyd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 1900
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = srem i32 %6, 4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %1
%10 = load i32, i32* %3
%11 = srem i32 %10, 100
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 366, i32* %2
br label %22
14: ; preds = %9
%15 = load i32, i32* %3
%16 = srem i32 %15, 400
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 366, i32* %2
br label %22
19: ; preds = %14
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20, %1
store i32 365, i32* %2
br label %22
22: ; preds = %21, %18, %13
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @lyd(i32 %0) {
%2 = add nsw i32 %0, 1900
%3 = and i32 %0, 3
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = srem i32 %2, 100
%7 = icmp ne i32 %6, 0
%8 = srem i32 %2, 400
%9 = icmp eq i32 %8, 0
%10 = or i1 %7, %9
br i1 %10, label %12, label %11
11: ; preds = %5, %1
br label %12
12: ; preds = %5, %11
%13 = phi i32 [ 365, %11 ], [ 366, %5 ]
ret i32 %13
}
int test_imm_07uint8_mem(unsigned char *val) {
  return ((*val) & (0x07 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_07uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 7
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int rand();
unsigned char random_char_gen() {
  unsigned char a = (unsigned char)(rand() & 0x00ff);
  return a;
}


x86 assembly (clang, -O0):
<random_char_gen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @random_char_gen() {
%1 = alloca i8
%2 = call i32 (...) @rand()
%3 = and i32 %2, 255
%4 = trunc i32 %3 to i8
store i8 %4, i8* %1
%5 = load i8, i8* %1
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @random_char_gen() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Variables and functions */
int _rdrand64_step(unsigned long long *);
int rdrand64(unsigned long long *p) { return _rdrand64_step(p); }


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

x86 assembly (clang, -O2):
<rdrand64>:
jmp    1030 <_rdrand64_step@plt>

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

LLVM IR (-O2):
define i32 @rdrand64(i64* %0) {
%2 = tail call i32 @_rdrand64_step(i64* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ pfrd1(char *, char *);
int signed_range(int, int);
void test_pfrd1(void) {
  pfrd1("" + signed_range((0), (9)), "" + signed_range((1), (9)));
  pfrd1("" + signed_range((1), (2)), "");
}


x86 assembly (clang, -O0):
<test_pfrd1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x9,%esi
call   1040 <signed_range@plt>
movslq %eax,%rcx
lea    0xec2(%rip),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
mov    $0x9,%esi
call   1040 <signed_range@plt>
mov    -0x8(%rbp),%rdi
cltq
lea    0xe9f(%rip),%rsi
add    %rax,%rsi
call   1030 <pfrd1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <signed_range@plt>
cltq
lea    0xe7f(%rip),%rdi
add    %rax,%rdi
lea    0xe75(%rip),%rsi
call   1030 <pfrd1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pfrd1>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
mov    $0x9,%esi
call   1040 <signed_range@plt>
movslq %eax,%rbx
lea    0xec6(%rip),%r14
add    %r14,%rbx
mov    $0x1,%edi
mov    $0x9,%esi
call   1040 <signed_range@plt>
movslq %eax,%rsi
add    %r14,%rsi
mov    %rbx,%rdi
call   1030 <pfrd1@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <signed_range@plt>
movslq %eax,%rdi
add    %r14,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pfrd1@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @test_pfrd1() {
%1 = call i32 @signed_range(i32 0, i32 9)
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i64 %2
%4 = call i32 @signed_range(i32 1, i32 9)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i64 %5
%7 = call i32 @pfrd1(i8* %3, i8* %6)
%8 = call i32 @signed_range(i32 1, i32 2)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i64 %9
%11 = call i32 @pfrd1(i8* %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @test_pfrd1() {
%1 = tail call i32 @signed_range(i32 0, i32 9)
%2 = sext i32 %1 to i64
%3 = getelementptr inbounds [1 x i8], [1 x i8]* @.str, i64 0, i64 %2
%4 = tail call i32 @signed_range(i32 1, i32 9)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [1 x i8], [1 x i8]* @.str, i64 0, i64 %5
%7 = tail call i32 @pfrd1(i8* %3, i8* %6)
%8 = tail call i32 @signed_range(i32 1, i32 2)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [1 x i8], [1 x i8]* @.str, i64 0, i64 %9
%11 = tail call i32 @pfrd1(i8* %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};
typedef int __s32;

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_READ;
scalar_t__ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, union i2c_smbus_data *);
extern __s32 i2c_smbus_read_byte(int file) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(file, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data))
    return -1;
  else
    return 0x0FF & data.byte;
}


x86 assembly (clang, -O0):
<i2c_smbus_read_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
je     1151 <i2c_smbus_read_byte+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <i2c_smbus_read_byte+0x4c>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_smbus_read_byte>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r8
xor    %edx,%edx
call   1030 <i2c_smbus_access@plt>
movzbl (%rsp),%ecx
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.i2c_smbus_data
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SMBUS_READ
%7 = load i32, i32* @I2C_SMBUS_BYTE
%8 = call i64 @i2c_smbus_access(i32 %5, i32 %6, i32 0, i32 %7, %union.i2c_smbus_data* %4)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %15
11: ; preds = %1
%12 = bitcast %union.i2c_smbus_data* %4 to i32*
%13 = load i32, i32* %12
%14 = and i32 255, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @i2c_smbus_read_byte(i32 %0) {
%2 = alloca %union.i2c_smbus_data
%3 = bitcast %union.i2c_smbus_data* %2 to i8*
%4 = load i32, i32* @I2C_SMBUS_READ
%5 = load i32, i32* @I2C_SMBUS_BYTE
%6 = call i64 @i2c_smbus_access(i32 %0, i32 %4, i32 0, i32 %5, %union.i2c_smbus_data* %2)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = and i32 %9, 255
%11 = select i1 %7, i32 %10, i32 -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void wfile_temppath_from_env(char *dir) { strcpy(dir, "/tmp"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"/tmp\00"
define void @wfile_temppath_from_env(i8* %0) {
%2 = tail call i32 @strcpy(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
void init_coverage_filter(char *filename) {}


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

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

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

LLVM IR (-O2):
define void @init_coverage_filter(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printing_util() {
  printf("\n--------------New Operation---------------\n");
}


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

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

LLVM IR (-O0):
@.str = [45 x i8] c"\0A--------------New Operation---------------\0A\00"
define void @printing_util() {
%1 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [44 x i8] c"\0A--------------New Operation---------------\00"
define void @printing_util() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
ret void
}
float Sleef_asinf_u35(float x) { return __builtin_asinf(x); }


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

x86 assembly (clang, -O2):
<Sleef_asinf_u35>:
jmp    1030 <asinf@plt>

LLVM IR (-O0):
define float @Sleef_asinf_u35(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @asinf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @Sleef_asinf_u35(float %0) {
%2 = tail call float @asinf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ ol(char *);
com() { ol("NOT  AX"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"NOT AX\00"
define i32 @com() {
%1 = alloca i32
%2 = call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"NOT AX\00"
define i32 @com() {
%1 = tail call i32 @ol(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void lt_dlsetsearchpath(void) {}


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

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

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

LLVM IR (-O2):
define void @lt_dlsetsearchpath() {
ret void
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test06(void) { return test_sat_parser_should_fail("(a or)"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"(a or)\00"
define i32 @test06() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [7 x i8] c"(a or)\00"
define i32 @test06() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Type definitions */
typedef char wchar_t;
struct _Locale_time {
  int dummy;
};

/* Variables and functions */
const wchar_t *_WLocale_am_str(struct _Locale_time *ltime
                               __attribute__((__unused__)),
                               wchar_t *buf __attribute__((__unused__)),
                               size_t bufSize __attribute__((__unused__))) {
  return L"AM";
}


x86 assembly (clang, -O0):
<_WLocale_am_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xee9(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_WLocale_am_str>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct._Locale_time = type { i32 }
@.str = [3 x i32] [i32 65, i32 77, i32 0]
define i8* @_WLocale_am_str(%struct._Locale_time* %0, i8* %1, i64 %2) {
%4 = alloca %struct._Locale_time*
%5 = alloca i8*
%6 = alloca i64
store %struct._Locale_time* %0, %struct._Locale_time** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
ret i8* bitcast ([3 x i32]* @.str to i8*)
}

LLVM IR (-O2):
%struct._Locale_time = type { i32 }
@.str = [3 x i32] [i32 65, i32 77, i32 0]
define i8* @_WLocale_am_str(%struct._Locale_time* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* bitcast ([3 x i32]* @.str to i8*)
}
int sumDigits(int number) {
  int result = 0;
  while (number > 0) {
    result = result + number % 10;
    number = number / 10;
  }
  return result;
}


x86 assembly (clang, -O0):
<sumDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1144 <sumDigits+0x44>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <sumDigits+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumDigits>:
xor    %eax,%eax
test   %edi,%edi
jle    112d <sumDigits+0x2d>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
add    %ecx,%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <sumDigits+0x10>
ret

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

LLVM IR (-O2):
define i32 @sumDigits(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %10
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %8, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = add nuw nsw i32 %4, %6
%8 = udiv i32 %5, 10
%9 = icmp ult i32 %5, 10
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void i2sStopPlay(void) {
  printf("IIS stop playing\n");
  *((volatile unsigned int *)((0xB0020000 + 0x04))) =
      (*((volatile unsigned int *)((0xB0020000 + 0x04)))) & ~(1 << 5);
}


x86 assembly (clang, -O0):
<i2sStopPlay>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xb0020004,%eax
mov    (%rax),%ecx
and    $0xffffffdf,%ecx
mov    $0xb0020004,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2sStopPlay>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xb0020004,%eax
andl   $0xffffffdf,(%rax)
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"IIS stop playing\0A\00"
define void @i2sStopPlay() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = and i32 %2, -33
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"IIS stop playing\00"
define void @i2sStopPlay() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = load volatile i32, i32* inttoptr (i64 2952921092 to i32*)
%3 = and i32 %2, -33
store volatile i32 %3, i32* inttoptr (i64 2952921092 to i32*)
ret void
}
int digi_init() {
  (*(volatile unsigned int *)((0x3FF0000 + 0x5000)) = (0x3ff0f));
  (*(volatile unsigned int *)((0x3FF0000 + 0x5004)) = (0x0));
  (*(volatile unsigned int *)((0x3FF0000 + 0x5008)) = (0xe));
}


x86 assembly (clang, -O0):
<digi_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3ff5000,%eax
movl   $0x3ff0f,(%rax)
mov    $0x3ff5004,%eax
movl   $0x0,(%rax)
mov    $0x3ff5008,%eax
movl   $0xe,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digi_init>:
movl   $0x3ff0f,0x3ff5000
movl   $0x0,0x3ff5004
movl   $0xe,0x3ff5008
ret

LLVM IR (-O0):
define i32 @digi_init() {
%1 = alloca i32
store volatile i32 261903, i32* inttoptr (i64 67063808 to i32*)
store volatile i32 0, i32* inttoptr (i64 67063812 to i32*)
store volatile i32 14, i32* inttoptr (i64 67063816 to i32*)
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @digi_init() {
store volatile i32 261903, i32* inttoptr (i64 67063808 to i32*)
store volatile i32 0, i32* inttoptr (i64 67063812 to i32*)
store volatile i32 14, i32* inttoptr (i64 67063816 to i32*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, int);
void mus_lshort_to_char(unsigned char *j, short x) {
  unsigned char *ox = (unsigned char *)&x;
  memcpy((void *)j, (void *)ox, 2);
}


x86 assembly (clang, -O0):
<mus_lshort_to_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_lshort_to_char>:
push   %rax
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mus_lshort_to_char(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
%5 = alloca i8*
store i8* %0, i8** %3
store i16 %1, i16* %4
%6 = bitcast i16* %4 to i8*
store i8* %6, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %5
%9 = call i32 @memcpy(i8* %7, i8* %8, i32 2)
ret void
}

LLVM IR (-O2):
define void @mus_lshort_to_char(i8* %0, i16 signext %1) {
%3 = alloca i16
store i16 %1, i16* %3
%4 = bitcast i16* %3 to i8*
%5 = call i32 @memcpy(i8* %0, i8* %4, i32 2)
ret void
}
int base_get_alignment(void) { return 32; }


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

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

LLVM IR (-O0):
define i32 @base_get_alignment() {
ret i32 32
}

LLVM IR (-O2):
define i32 @base_get_alignment() {
ret i32 32
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_putstr(char *);
int /*<<< orphan*/ my_strlen(char *);
int write(int, char *, int /*<<< orphan*/);
void my_putstr2(char *c) {
  int a;
  a = write(2, c, my_strlen(c));
  if (a == -1) {
    my_putstr("Error on write\n");
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<my_putstr2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <my_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1040 <write@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    1190 <my_putstr2+0x50>
lea    0xe7f(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putstr2>:
push   %rbx
mov    %rdi,%rbx
call   1030 <my_strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <write@plt>
cmp    $0xffffffff,%eax
je     115f <my_putstr2+0x1f>
pop    %rbx
ret
lea    0xe9a(%rip),%rdi
call   1050 <my_putstr@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Error on write\0A\00"
define void @my_putstr2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @my_strlen(i8* %5)
%7 = call i32 @write(i32 2, i8* %4, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error on write\0A\00"
define void @my_putstr2(i8* %0) {
%2 = tail call i32 @my_strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @my_putstr(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 -1)
unreachable
8: ; preds = %1
ret void
}