xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ RamWrite(unsigned char, unsigned char, unsigned char,
                            unsigned char);
void RamWriteA(unsigned short RamAddr, unsigned short RamData) {
  unsigned char RamAddrH = RamAddr >> 8;
  unsigned char RamAddrL = RamAddr & 0xFF;
  unsigned char RamDataH = RamData >> 8;
  unsigned char RamDataL = RamData & 0xFF;
  RamWrite(RamAddrH, RamAddrL, RamDataH, RamDataL);
}


x86 assembly (clang, -O0):
<RamWriteA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x5(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x6(%rbp)
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x7(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x8(%rbp)
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%cl
mov    -0x7(%rbp),%al
movzbl %dl,%edi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0x8(%rbp),%ecx
call   1030 <RamWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamWriteA>:
movzbl %dil,%eax
shr    $0x8,%edi
movzbl %sil,%ecx
mov    %esi,%edx
shr    $0x8,%edx
mov    %eax,%esi
jmp    1030 <RamWrite@plt>

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

LLVM IR (-O2):
define void @RamWriteA(i16 zeroext %0, i16 zeroext %1) {
%3 = lshr i16 %0, 8
%4 = trunc i16 %3 to i8
%5 = trunc i16 %0 to i8
%6 = lshr i16 %1, 8
%7 = trunc i16 %6 to i8
%8 = trunc i16 %1 to i8
%9 = tail call i32 @RamWrite(i8 zeroext %4, i8 zeroext %5, i8 zeroext %7, i8 zeroext %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int /*<<< orphan*/);
void TOSH_SET_RADIO_CCA_PIN() { set_io_bit(-4, 0); }


x86 assembly (clang, -O0):
<TOSH_SET_RADIO_CCA_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
xor    %esi,%esi
call   1030 <set_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_SET_RADIO_CCA_PIN>:
mov    $0xfffffffc,%edi
xor    %esi,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_SET_RADIO_CCA_PIN() {
%1 = call i32 @set_io_bit(i32 -4, i32 0)
ret void
}

LLVM IR (-O2):
define void @TOSH_SET_RADIO_CCA_PIN() {
%1 = tail call i32 @set_io_bit(i32 -4, i32 0)
ret void
}
/* Variables and functions */
int __res_msend(int, unsigned char const **, int *, unsigned char **, int *,
                int);
int __res_send(const unsigned char *msg, int msglen, unsigned char *answer,
               int anslen) {
  int r = __res_msend(1, &msg, &msglen, &answer, &anslen, anslen);
  return r < 0 || !anslen ? -1 : anslen;
}


x86 assembly (clang, -O0):
<__res_send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%r9d
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1030 <__res_msend@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     115b <__res_send+0x4b>
cmpl   $0x0,-0x1c(%rbp)
jne    1168 <__res_send+0x58>
mov    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    116e <__res_send+0x5e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__res_send>:
sub    $0x18,%rsp
mov    %ecx,%r9d
mov    %rdi,0x10(%rsp)
mov    %esi,0x4(%rsp)
mov    %rdx,0x8(%rsp)
mov    %ecx,(%rsp)
lea    0x10(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
mov    %rsp,%r8
mov    $0x1,%edi
call   1030 <__res_msend@plt>
mov    (%rsp),%ecx
cmp    $0x1,%ecx
sbb    %edx,%edx
or     %ecx,%edx
test   %eax,%eax
mov    $0xffffffff,%eax
cmovns %edx,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @__res_send(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32, i32* %8
%11 = call i32 @__res_msend(i32 1, i8** %5, i32* %6, i8** %7, i32* %8, i32 %10)
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = icmp slt i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %4
%15 = load i32, i32* %8
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %14, %4
br label %20
18: ; preds = %14
%19 = load i32, i32* %8
br label %20
20: ; preds = %18, %17
%21 = phi i32 [ -1, %17 ], [ %19, %18 ]
ret i32 %21
}

LLVM IR (-O2):
define i32 @__res_send(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = call i32 @__res_msend(i32 1, i8** %5, i32* %6, i8** %7, i32* %8, i32 %3)
%10 = icmp sgt i32 %9, -1
%11 = load i32, i32* %8
%12 = icmp ne i32 %11, 0
%13 = select i1 %10, i1 %12, i1 false
%14 = select i1 %13, i32 %11, i32 -1
ret i32 %14
}
void ff_hevc_put_hevc_uni_pel_pixels32_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_pel_pixels32_12_sse4() {
ret void
}
void update_heat_param(design, schedule, t) struct Design *design;
struct Schedule *schedule;
double t;
{}


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

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

LLVM IR (-O0):
%struct.Design = type opaque
%struct.Schedule = type opaque
define void @update_heat_param(%struct.Design* %0, %struct.Schedule* %1, double %2) {
%4 = alloca %struct.Design*
%5 = alloca %struct.Schedule*
%6 = alloca double
store %struct.Design* %0, %struct.Design** %4
store %struct.Schedule* %1, %struct.Schedule** %5
store double %2, double* %6
ret void
}

LLVM IR (-O2):
%struct.Design = type opaque
%struct.Schedule = type opaque
define void @update_heat_param(%struct.Design* nocapture %0, %struct.Schedule* nocapture %1, double %2) {
ret void
}
/* Variables and functions */
int ocb_crypt(unsigned char *, unsigned char *, unsigned char *,
              unsigned char *, unsigned int, unsigned char *, unsigned int,
              int /*<<< orphan*/);
int ocb_decrypt(unsigned char *p, unsigned char *k, unsigned char *n,
                unsigned char *a, unsigned abytes, unsigned char *c,
                unsigned cbytes) {
  return ocb_crypt(p, k, n, a, abytes, c, cbytes, 0);
}


x86 assembly (clang, -O0):
<ocb_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <ocb_crypt@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ocb_decrypt>:
push   %rax
mov    0x10(%rsp),%eax
push   $0x0
push   %rax
call   1030 <ocb_crypt@plt>
add    $0x10,%rsp
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ocb_decrypt(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i8* %5, i32 %6) {
%8 = tail call i32 @ocb_crypt(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4, i8* %5, i32 %6, i32 0)
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_dobldobl_drop_coordinate_by_index(int k) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(348, &k, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_dobldobl_drop_coordinate_by_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x15c,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_dobldobl_drop_coordinate_by_index>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x15c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solcon_dobldobl_drop_coordinate_by_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 348, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_dobldobl_drop_coordinate_by_index(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 348, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
double round(double);
double f_nint(double x) { return (round(x)); }


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

x86 assembly (clang, -O2):
<f_nint>:
jmp    1030 <round@plt>

LLVM IR (-O0):
define double @f_nint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.round.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @f_nint(double %0) {
%2 = tail call double @llvm.round.f64(double %0)
ret double %2
}
/* Variables and functions */
intptr_t syscall4(int, uintptr_t, uintptr_t, uintptr_t, int /*<<< orphan*/);
intptr_t syscall3(int nr, uintptr_t a1, uintptr_t a2, uintptr_t a3) {
  return syscall4(nr, a1, a2, a3, 0);
}


x86 assembly (clang, -O0):
<syscall3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <syscall4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall3>:
xor    %r8d,%r8d
jmp    1030 <syscall4@plt>

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

LLVM IR (-O2):
define i64 @syscall3(i32 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 @syscall4(i32 %0, i64 %1, i64 %2, i64 %3, i32 0)
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int target2(int fd) {
  close(fd);
  return -5;
}


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

x86 assembly (clang, -O2):
<target2>:
push   %rax
call   1030 <close@plt>
mov    $0xfffffffb,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @target2(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 -5
}
double two_to(int exponent) {
  double result = 2.0;
  int idx;
  for (idx = 2; idx <= exponent; ++idx)
    result *= 2.0;
  return result;
}


x86 assembly (clang, -O0):
<two_to>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movsd  0xef1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1147 <two_to+0x47>
movsd  0xed1(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111b <two_to+0x1b>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_to>:
cmp    $0x2,%edi
jge    110e <two_to+0xe>
movsd  0xef3(%rip),%xmm0
ret
lea    -0x1(%rdi),%ecx
add    $0xfffffffe,%edi
mov    %ecx,%eax
and    $0x7,%eax
cmp    $0x7,%edi
jae    1128 <two_to+0x28>
movsd  0xeda(%rip),%xmm0
jmp    1165 <two_to+0x65>
and    $0xfffffff8,%ecx
movsd  0xecd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
addsd  %xmm0,%xmm0
add    $0xfffffff8,%ecx
jne    1140 <two_to+0x40>
test   %eax,%eax
je     1179 <two_to+0x79>
nopl   0x0(%rax)
addsd  %xmm0,%xmm0
add    $0xffffffff,%eax
jne    1170 <two_to+0x70>
ret

LLVM IR (-O0):
define double @two_to(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
store i32 %0, i32* %2
store double 2.000000e+00, double* %3
store i32 2, i32* %4
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %4
%7 = load i32, i32* %2
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load double, double* %3
%11 = fmul double %10, 2.000000e+00
store double %11, double* %3
br label %12
12: ; preds = %9
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load double, double* %3
ret double %16
}

LLVM IR (-O2):
define double @two_to(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %33, label %3
3: ; preds = %1
%4 = add i32 %0, -1
%5 = add i32 %0, -2
%6 = and i32 %4, 7
%7 = icmp ult i32 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %3
%9 = and i32 %4, -8
br label %10
10: ; preds = %10, %8
%11 = phi double [ 2.000000e+00, %8 ], [ %20, %10 ]
%12 = phi i32 [ 0, %8 ], [ %21, %10 ]
%13 = fmul double %11, 2.000000e+00
%14 = fmul double %13, 2.000000e+00
%15 = fmul double %14, 2.000000e+00
%16 = fmul double %15, 2.000000e+00
%17 = fmul double %16, 2.000000e+00
%18 = fmul double %17, 2.000000e+00
%19 = fmul double %18, 2.000000e+00
%20 = fmul double %19, 2.000000e+00
%21 = add i32 %12, 8
%22 = icmp eq i32 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %3
%24 = phi double [ undef, %3 ], [ %20, %10 ]
%25 = phi double [ 2.000000e+00, %3 ], [ %20, %10 ]
%26 = icmp eq i32 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi double [ %30, %27 ], [ %25, %23 ]
%29 = phi i32 [ %31, %27 ], [ 0, %23 ]
%30 = fmul double %28, 2.000000e+00
%31 = add i32 %29, 1
%32 = icmp eq i32 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %1
%34 = phi double [ 2.000000e+00, %1 ], [ %24, %23 ], [ %30, %27 ]
ret double %34
}
int sum(int a[4]) {
  int limit = sizeof(a) / sizeof(int);
  int result = 0;
  int i;
  for (i = 0; i < limit; i++) {
    result += a[i];
  }
  return result;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1148 <sum+0x48>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111d <sum+0x1d>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
mov    0x4(%rdi),%eax
add    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_bytes_per_second() {
  printf("NOT IMPLEMENTED:"
         "pa_bytes_per_second"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_bytes_per_second\00"
define i32 @pa_bytes_per_second() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void M_init(int (*A)[8], int m, int n) {
  int i, j;
  for (j = 0; j < 8; j++)
    for (i = 0; i < 8; i++)
      A[i][j] = 0;
  A[m][n] = 1;
}


x86 assembly (clang, -O0):
<M_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    116b <M_init+0x6b>
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1158 <M_init+0x58>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <M_init+0x26>
jmp    115d <M_init+0x5d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <M_init+0x15>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x5,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_init>:
movslq %esi,%rax
movslq %edx,%rcx
shl    $0x5,%rax
add    %rdi,%rax
xorps  %xmm0,%xmm0
movups %xmm0,0xf0(%rdi)
movups %xmm0,0xe0(%rdi)
movups %xmm0,0xd0(%rdi)
movups %xmm0,0xc0(%rdi)
movups %xmm0,0xb0(%rdi)
movups %xmm0,0xa0(%rdi)
movups %xmm0,0x90(%rdi)
movups %xmm0,0x80(%rdi)
movups %xmm0,0x70(%rdi)
movups %xmm0,0x60(%rdi)
movups %xmm0,0x50(%rdi)
movups %xmm0,0x40(%rdi)
movups %xmm0,0x30(%rdi)
movups %xmm0,0x20(%rdi)
movups %xmm0,0x10(%rdi)
movups %xmm0,(%rdi)
movl   $0x1,(%rax,%rcx,4)
ret

LLVM IR (-O0):
define void @M_init([8 x i32]* %0, i32 %1, i32 %2) {
%4 = alloca [8 x i32]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store [8 x i32]* %0, [8 x i32]** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %8
br label %9
9: ; preds = %28, %3
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %31
12: ; preds = %9
store i32 0, i32* %7
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 8
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load [8 x i32]*, [8 x i32]** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 %19
%21 = load i32, i32* %8
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 %22
store i32 0, i32* %23
br label %24
24: ; preds = %16
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %13
27: ; preds = %13
br label %28
28: ; preds = %27
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
store i32 %30, i32* %8
br label %9
31: ; preds = %9
%32 = load [8 x i32]*, [8 x i32]** %4
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [8 x i32], [8 x i32]* %32, i64 %34
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [8 x i32], [8 x i32]* %35, i64 0, i64 %37
store i32 1, i32* %38
ret void
}

LLVM IR (-O2):
define void @M_init([8 x i32]* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* %0, i64 %4, i64 %5
%7 = bitcast [8 x i32]* %0 to i8*
store i32 1, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void zeroDelta(float numA, float numB) {
  float x1;
  x1 = ((-numB) / (2.00 * numA));
  printf("\nThe root of the equation is %.2f.\n", x1);
}


x86 assembly (clang, -O0):
<zeroDelta>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xeb7(%rip),%xmm1
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroDelta>:
xorps  0xee9(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0AThe root of the equation is %.2f.\0A\00"
define void @zeroDelta(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = fneg float %6
%8 = fpext float %7 to double
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = fmul double 2.000000e+00, %10
%12 = fdiv double %8, %11
%13 = fptrunc double %12 to float
store float %13, float* %5
%14 = load float, float* %5
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), float %14)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0AThe root of the equation is %.2f.\0A\00"
define void @zeroDelta(float %0, float %1) {
%3 = fneg float %1
%4 = fpext float %3 to double
%5 = fpext float %0 to double
%6 = fmul double %5, 2.000000e+00
%7 = fdiv double %4, %6
%8 = fptrunc double %7 to float
%9 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), float %8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float salary;
  printf("Enter your desired monthly salary: ");
  scanf("%f", &salary);
  getchar();
  getchar();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xee0(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Enter your desired monthly salary: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = call i32 (...) @getchar()
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"Enter your desired monthly salary: \00"
@.str.1 = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = call i32 (...) @getchar()
%6 = call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void nrerror(char error_text[]) {
  printf("Numerical Recipes run-time error...\n");
  printf("%s\n", error_text);
  printf("...now exiting to system...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<nrerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nrerror>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Numerical Recipes run-time error...\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [29 x i8] c"...now exiting to system...\0A\00"
define void @nrerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [36 x i8] c"Numerical Recipes run-time error...\00"
@str.3 = [28 x i8] c"...now exiting to system...\00"
define void @nrerror(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
void yy_3_TableRowBody(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_3_TableRowBody(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void caml_regexp_split() { exit(1); }


x86 assembly (clang, -O0):
<caml_regexp_split>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<caml_regexp_split>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @caml_regexp_split() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @caml_regexp_split() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
char char_digit(int n) {
  if (n >= 0 && n <= 9)
    return (n + '0');
  else if (n >= 10 && n <= 36)
    return (n - 10 + 'A');
  else
    return -1;
}


x86 assembly (clang, -O0):
<char_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1129 <char_digit+0x29>
cmpl   $0x9,-0x8(%rbp)
jg     1129 <char_digit+0x29>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <char_digit+0x52>
cmpl   $0xa,-0x8(%rbp)
jl     114e <char_digit+0x4e>
cmpl   $0x24,-0x8(%rbp)
jg     114e <char_digit+0x4e>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x41,%eax
mov    %al,-0x1(%rbp)
jmp    1152 <char_digit+0x52>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_digit>:
cmp    $0x9,%edi
ja     110b <char_digit+0xb>
add    $0x30,%dil
jmp    1119 <char_digit+0x19>
lea    -0xa(%rdi),%ecx
mov    $0xff,%al
cmp    $0x1a,%ecx
ja     111b <char_digit+0x1b>
add    $0x37,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define signext i8 @char_digit(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 9
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 48
%12 = trunc i32 %11 to i8
store i8 %12, i8* %2
br label %25
13: ; preds = %6, %1
%14 = load i32, i32* %3
%15 = icmp sge i32 %14, 10
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %3
%18 = icmp sle i32 %17, 36
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %3
%21 = sub nsw i32 %20, 10
%22 = add nsw i32 %21, 65
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %25
24: ; preds = %16, %13
store i8 -1, i8* %2
br label %25
25: ; preds = %24, %19, %9
%26 = load i8, i8* %2
ret i8 %26
}

LLVM IR (-O2):
define signext i8 @char_digit(i32 %0) {
%2 = icmp ult i32 %0, 10
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add nuw nsw i8 %4, 48
br label %12
6: ; preds = %1
%7 = add i32 %0, -10
%8 = icmp ult i32 %7, 27
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = trunc i32 %0 to i8
%11 = add nuw nsw i8 %10, 55
br label %12
12: ; preds = %6, %9, %3
%13 = phi i8 [ %5, %3 ], [ %11, %9 ], [ -1, %6 ]
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ printf(char *);
void main(void) {
  clear_screen();
  printf("\n>>> Hello World!\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clear_screen@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <clear_screen@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"\0A>>> Hello World!\0A\00"
define void @main() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [18 x i8] c"\0A>>> Hello World!\00"
define void @main() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mysnprintf(char *, size_t, char *, void *);
int ptr2str(void *value, char *buf, size_t len) {
  return mysnprintf(buf, len, "%p", value);
}


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

x86 assembly (clang, -O2):
<ptr2str>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <mysnprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define i32 @ptr2str(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @mysnprintf(i8* %1, i64 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ io_clear_bit(int);
int /*<<< orphan*/ io_set_bit(int);
void elev_set_stop_lamp(int value) {
  if (value)
    io_set_bit((0x300 + 14));
  else
    io_clear_bit((0x300 + 14));
}


x86 assembly (clang, -O0):
<elev_set_stop_lamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <elev_set_stop_lamp+0x24>
mov    $0x30e,%edi
call   1030 <io_set_bit@plt>
jmp    114e <elev_set_stop_lamp+0x2e>
mov    $0x30e,%edi
call   1040 <io_clear_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elev_set_stop_lamp>:
test   %edi,%edi
je     112e <elev_set_stop_lamp+0xe>
mov    $0x30e,%edi
jmp    1030 <io_set_bit@plt>
mov    $0x30e,%edi
jmp    1040 <io_clear_bit@plt>

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

LLVM IR (-O2):
define void @elev_set_stop_lamp(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @io_set_bit(i32 782)
br label %7
5: ; preds = %1
%6 = tail call i32 @io_clear_bit(i32 782)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
void xgettimeofday(struct timeval *tv) {
  if (gettimeofday(tv, NULL) != 0)
    fatal("gettimeofday failed");
}


x86 assembly (clang, -O0):
<xgettimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     114f <xgettimeofday+0x2f>
lea    0xeb6(%rip),%rdi
call   1040 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xgettimeofday>:
push   %rax
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     113a <xgettimeofday+0x1a>
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <fatal@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [20 x i8] c"gettimeofday failed\00"
define void @xgettimeofday(%struct.timeval* %0) {
%2 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %2
%3 = load %struct.timeval*, %struct.timeval** %2
%4 = call i64 @gettimeofday(%struct.timeval* %3, i32* null)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [20 x i8] c"gettimeofday failed\00"
define void @xgettimeofday(%struct.timeval* nocapture %0) {
%2 = tail call i64 @gettimeofday(%struct.timeval* %0, i32* null)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fatal(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ enableInterrupt(int, int);
unsigned int tseEnable(void) {
  (*((volatile unsigned int *const)(0x40010000 + 0x1024))) = (1 << 0);
  (*((volatile unsigned int *const)((0x40010000 + 0) + 0x3c))) |= (1 << 29);
  enableInterrupt(1, 65);
  return 0;
}


x86 assembly (clang, -O0):
<tseEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40011024,%eax
movl   $0x1,(%rax)
mov    $0x4001003c,%eax
mov    (%rax),%ecx
or     $0x20000000,%ecx
mov    $0x4001003c,%eax
mov    %ecx,(%rax)
mov    $0x1,%edi
mov    $0x41,%esi
call   1030 <enableInterrupt@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tseEnable>:
push   %rax
movl   $0x1,0x40011024
orl    $0x20000000,0x4001003c
mov    $0x1,%edi
mov    $0x41,%esi
call   1030 <enableInterrupt@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @tseEnable() {
store volatile i32 1, i32* inttoptr (i64 1073811492 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1073807420 to i32*)
%2 = or i32 %1, 536870912
store volatile i32 %2, i32* inttoptr (i64 1073807420 to i32*)
%3 = call i32 @enableInterrupt(i32 1, i32 65)
ret i32 0
}

LLVM IR (-O2):
define i32 @tseEnable() {
store volatile i32 1, i32* inttoptr (i64 1073811492 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1073807420 to i32*)
%2 = or i32 %1, 536870912
store volatile i32 %2, i32* inttoptr (i64 1073807420 to i32*)
%3 = tail call i32 @enableInterrupt(i32 1, i32 65)
ret i32 0
}
int main() {
  unsigned long t1 = (unsigned long)(char)1;
  unsigned long t2 = 'a';
  return t1 + t2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
movq   $0x61,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
store i64 1, i64* %2
store i64 97, i64* %3
%4 = load i64, i64* %2
%5 = load i64, i64* %3
%6 = add i64 %4, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 98
}
int func(int a) {
  switch (a) {
  case 1:
    return a;
  case 2:
    return a + 1;
  case 3:
    return a * 2;
  case 4:
    return a + 3;
  case 5:
    return a - 4;
  case 6:
    return a + 1;
  case 7:
    return a - 5;
  case 8:
    return a + 7;
  }
  return -1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     119d <func+0x9d>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
sub    $0x4,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
sub    $0x5,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
mov    -0x8(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x4(%rbp)
jmp    11a4 <func+0xa4>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
add    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     111a <func+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.func = [8 x i32] [i32 1, i32 3, i32 6, i32 7, i32 1, i32 7, i32 2, i32 15]
define i32 @func(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.func, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
char getchar();
void consumeLine() {
  while (getchar() != '\n') {
  }
}


x86 assembly (clang, -O0):
<consumeLine>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <consumeLine+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <consumeLine+0x21>
jmp    1119 <consumeLine+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<consumeLine>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <consumeLine+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @consumeLine() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @consumeLine() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
float sqf(float v) { return v * v; }


x86 assembly (clang, -O0):
<sqf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sqf>:
mulss  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define float @sqf(float %0) {
%2 = fmul float %0, %0
ret float %2
}
/* Type definitions */
typedef char *uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
uint8_t inb(uint16_t addr) {
  uint8_t val;
  __asm__ __volatile__("inb %%dx,%%al" : "=a"(val) : "d"(addr));
  return val;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
in     (%dx),%al
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define i8* @inb(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* asm sideeffect "inb %dx,%al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @inb(i32 %0) {
%2 = tail call i8* asm sideeffect "inb %dx,%al", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i32 %0)
ret i8* %2
}
/* Variables and functions */
void v_swap(void *, int);
void v_ntoh(void *p, int nbytes) { return v_swap(p, nbytes); }


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

x86 assembly (clang, -O2):
<v_ntoh>:
jmp    1030 <v_swap@plt>

LLVM IR (-O0):
define void @v_ntoh(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
ret void
}

LLVM IR (-O2):
define void @v_ntoh(i8* %0, i32 %1) {
tail call void @v_swap(i8* %0, i32 %1)
ret void
}
int s2n_free(struct s2n_blob *b) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.s2n_blob = type opaque
define i32 @s2n_free(%struct.s2n_blob* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo(void) {
  int i;
  uint32_t a = 0x01020304;
  char *x = (char *)&a;
  if (*x = 0x04)
    printf("little endian\n");
  else if (*x == 0x01)
    printf("big endian\n");
  else
    printf("error\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1020304,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x4,(%rax)
mov    $0x1,%al
test   $0x1,%al
jne    113d <foo+0x2d>
jmp    114e <foo+0x3e>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <foo+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1,%eax
jne    116f <foo+0x5f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
jmp    117b <foo+0x6b>
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <foo+0x70>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"little endian\0A\00"
@.str.1 = [12 x i8] c"big endian\0A\00"
@.str.2 = [7 x i8] c"error\0A\00"
define void @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 16909060, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
store i8 4, i8* %5
br i1 true, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %18
8: ; preds = %0
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %8
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
br label %18
18: ; preds = %17, %6
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"little endian\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}