xunge/DecIR huggingface dataset:
void clearSrc(unsigned int color) {
  (*(volatile unsigned long *)0x4D000050) = (1 << 24) | (color & 0xffffff);
}


x86 assembly (clang, -O0):
<clearSrc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
or     $0x1000000,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x4d000050,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<clearSrc>:
and    $0xffffff,%edi
or     $0x1000000,%edi
mov    %rdi,0x4d000050
4d
ret

LLVM IR (-O0):
define void @clearSrc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 16777215
%5 = or i32 16777216, %4
%6 = zext i32 %5 to i64
store volatile i64 %6, i64* inttoptr (i64 1291845712 to i64*)
ret void
}

LLVM IR (-O2):
define void @clearSrc(i32 %0) {
%2 = and i32 %0, 16777215
%3 = or i32 %2, 16777216
%4 = zext i32 %3 to i64
store volatile i64 %4, i64* inttoptr (i64 1291845712 to i64*)
ret void
}
void put_short_be(char *cp, short int sval) {
  *cp++ = (sval >> 8) & 0xff;
  *cp++ = sval & 0xff;
}


x86 assembly (clang, -O0):
<put_short_be>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movswl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
movswl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_short_be>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @put_short_be(i8* %0, i16 signext %1) {
%3 = alloca i8*
%4 = alloca i16
store i8* %0, i8** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = sext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = trunc i32 %8 to i8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
store i8 %9, i8* %10
%12 = load i16, i16* %4
%13 = sext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
store i8 %15, i8* %16
ret void
}

LLVM IR (-O2):
define void @put_short_be(i8* nocapture writeonly %0, i16 signext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %0
%6 = trunc i16 %1 to i8
store i8 %6, i8* %5
ret void
}
double identity(double x) { return x; }


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

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

LLVM IR (-O0):
define double @identity(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
ret double %3
}

LLVM IR (-O2):
define double @identity(double returned %0) {
ret double %0
}
/* Variables and functions */
int /*<<< orphan*/ kexit(int);
int kkexit(int value) { kexit(value); }


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

x86 assembly (clang, -O2):
<kkexit>:
jmp    1030 <kexit@plt>

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

LLVM IR (-O2):
define i32 @kkexit(i32 %0) {
%2 = tail call i32 @kexit(i32 %0)
ret i32 undef
}
int check(int k) {
  int i = 0;
  for (i = 2; i < k; i++) {
    if (k % i == 0)
      return 0;
  }
  if (i >= k)
    return 1;
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1150 <check+0x50>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    113d <check+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1163 <check+0x63>
jmp    1142 <check+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <check+0x15>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1163 <check+0x63>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
mov    $0x1,%ecx
cmp    $0x3,%edi
jl     1120 <check+0x20>
mov    $0x2,%esi
nop
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <check+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <check+0x10>
mov    %ecx,%eax
ret
xor    %ecx,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @check(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 1, %3 ], [ 0, %5 ]
ret i32 %11
}
int generate_next_num(int num) {
  int next;
  next = num;
  while (num > 0) {
    next += num % 10;
    num /= 10;
  }
  return next;
}


x86 assembly (clang, -O0):
<generate_next_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113b <generate_next_num+0x3b>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110d <generate_next_num+0xd>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @generate_next_num(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 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 */
double RAND_MAX;
double prandom_double();
double prandom_double_range(double min, double max) {
  double input = prandom_double();
  double slope = (max - min) / (RAND_MAX - 0);
  double output = slope * input + min;
  return output;
}


x86 assembly (clang, -O0):
<prandom_double_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <prandom_double@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
mov    0x2ea9(%rip),%rax
movsd  (%rax),%xmm1
xorps  %xmm2,%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prandom_double_range>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <prandom_double@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mov    0x2eaa(%rip),%rax
divsd  (%rax),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @prandom_double_range(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
store double %1, double* %4
%8 = call double (...) @prandom_double()
store double %8, double* %5
%9 = load double, double* %4
%10 = load double, double* %3
%11 = fsub double %9, %10
%12 = load double, double* @RAND_MAX
%13 = fsub double %12, 0.000000e+00
%14 = fdiv double %11, %13
store double %14, double* %6
%15 = load double, double* %6
%16 = load double, double* %5
%17 = load double, double* %3
%18 = call double @llvm.fmuladd.f64(double %15, double %16, double %17)
store double %18, double* %7
%19 = load double, double* %7
ret double %19
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @prandom_double_range(double %0, double %1) {
%3 = tail call double (...) @prandom_double()
%4 = fsub double %1, %0
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
%7 = tail call double @llvm.fmuladd.f64(double %6, double %3, double %0)
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct hostent {
  scalar_t__ h_addr;
};

/* Variables and functions */
struct hostent *gethostbyname(char const *);
unsigned long htonl(int /*<<< orphan*/);
unsigned long net_dnsresolve(const char *name) {
  struct hostent *hent = gethostbyname(name);
  return (hent) ? htonl(*((uint32_t *)(hent->h_addr))) : 0;
}


x86 assembly (clang, -O0):
<net_dnsresolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115b <net_dnsresolve+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <htonl@plt>
mov    %rax,-0x18(%rbp)
jmp    1166 <net_dnsresolve+0x46>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1166 <net_dnsresolve+0x46>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_dnsresolve>:
push   %rax
call   1040 <gethostbyname@plt>
test   %rax,%rax
je     1136 <net_dnsresolve+0x16>
mov    (%rax),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <htonl@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hostent = type { i64 }
define i64 @net_dnsresolve(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.hostent* @gethostbyname(i8* %4)
store %struct.hostent* %5, %struct.hostent** %3
%6 = load %struct.hostent*, %struct.hostent** %3
%7 = icmp ne %struct.hostent* %6, null
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = load %struct.hostent*, %struct.hostent** %3
%10 = getelementptr inbounds %struct.hostent, %struct.hostent* %9, i32 0, i32 0
%11 = load i64, i64* %10
%12 = inttoptr i64 %11 to i32*
%13 = load i32, i32* %12
%14 = call i64 @htonl(i32 %13)
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %8
%17 = phi i64 [ %14, %8 ], [ 0, %15 ]
ret i64 %17
}

LLVM IR (-O2):
%struct.hostent = type { i64 }
define i64 @net_dnsresolve(i8* %0) {
%2 = tail call %struct.hostent* @gethostbyname(i8* %0)
%3 = icmp eq %struct.hostent* %2, null
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.hostent, %struct.hostent* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i32*
%8 = load i32, i32* %7
%9 = tail call i64 @htonl(i32 %8)
br label %10
10: ; preds = %1, %4
%11 = phi i64 [ %9, %4 ], [ 0, %1 ]
ret i64 %11
}
/* Variables and functions */
int M_PI;
unsigned int sin(int);
int sine(unsigned int phase, unsigned int amplitude) {
  return amplitude * sin(2 * M_PI * (double)phase / 0x10000);
}


x86 assembly (clang, -O0):
<sine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm0
mov    -0x4(%rbp),%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <sin@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine>:
push   %rbx
mov    %esi,%ebx
mov    0x2ece(%rip),%rax
mov    (%rax),%eax
add    %eax,%eax
cvtsi2sd %eax,%xmm0
mov    %edi,%eax
cvtsi2sd %rax,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xecb(%rip),%xmm1
cvttsd2si %xmm1,%edi
call   1030 <sin@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@M_PI = global i32 0
define i32 @sine(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* @M_PI
%7 = mul nsw i32 2, %6
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %3
%10 = uitofp i32 %9 to double
%11 = fmul double %8, %10
%12 = fdiv double %11, 6.553600e+04
%13 = fptosi double %12 to i32
%14 = call i32 @sin(i32 %13)
%15 = mul i32 %5, %14
ret i32 %15
}

LLVM IR (-O2):
@M_PI = global i32 0
define i32 @sine(i32 %0, i32 %1) {
%3 = load i32, i32* @M_PI
%4 = shl nsw i32 %3, 1
%5 = sitofp i32 %4 to double
%6 = uitofp i32 %0 to double
%7 = fmul double %6, %5
%8 = fmul double %7, 0x3EF0000000000000
%9 = fptosi double %8 to i32
%10 = tail call i32 @sin(i32 %9)
%11 = mul i32 %10, %1
ret i32 %11
}
void Lcd_EnvidOnOff(int onoff) {
  if (onoff == 1)
    (*(volatile unsigned *)0x4d000000) |= 1;
  else
    (*(volatile unsigned *)0x4d000000) =
        (*(volatile unsigned *)0x4d000000) & 0x3fffe;
}


x86 assembly (clang, -O0):
<Lcd_EnvidOnOff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1127 <Lcd_EnvidOnOff+0x27>
mov    $0x4d000000,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x4d000000,%eax
mov    %ecx,(%rax)
jmp    113b <Lcd_EnvidOnOff+0x3b>
mov    $0x4d000000,%eax
mov    (%rax),%ecx
and    $0x3fffe,%ecx
mov    $0x4d000000,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Lcd_EnvidOnOff>:
mov    0x4d000000,%eax
mov    %eax,%ecx
and    $0x3fffe,%ecx
or     $0x1,%eax
cmp    $0x1,%edi
cmovne %ecx,%eax
mov    %eax,0x4d000000
ret

LLVM IR (-O0):
define void @Lcd_EnvidOnOff(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 1291845632 to i32*)
%7 = or i32 %6, 1
store volatile i32 %7, i32* inttoptr (i64 1291845632 to i32*)
br label %11
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 1291845632 to i32*)
%10 = and i32 %9, 262142
store volatile i32 %10, i32* inttoptr (i64 1291845632 to i32*)
br label %11
11: ; preds = %8, %5
ret void
}

LLVM IR (-O2):
define void @Lcd_EnvidOnOff(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = load volatile i32, i32* inttoptr (i64 1291845632 to i32*)
%4 = and i32 %3, 262142
%5 = or i32 %3, 1
%6 = select i1 %2, i32 %5, i32 %4
store volatile i32 %6, i32* inttoptr (i64 1291845632 to i32*)
ret void
}
/* Type definitions */
struct oidmap_iter {
  int dummy;
};
struct oidmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oidmap_iter_init(struct oidmap *, struct oidmap_iter *);
void *oidmap_iter_next(struct oidmap_iter *);
void *oidmap_iter_first(struct oidmap *map, struct oidmap_iter *iter) {
  oidmap_iter_init(map, iter);
  return oidmap_iter_next(iter);
}


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

x86 assembly (clang, -O2):
<oidmap_iter_first>:
push   %rbx
mov    %rsi,%rbx
call   1040 <oidmap_iter_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <oidmap_iter_next@plt>

LLVM IR (-O0):
%struct.oidmap = type { i32 }
%struct.oidmap_iter = type { i32 }
define i8* @oidmap_iter_first(%struct.oidmap* %0, %struct.oidmap_iter* %1) {
%3 = alloca %struct.oidmap*
%4 = alloca %struct.oidmap_iter*
store %struct.oidmap* %0, %struct.oidmap** %3
store %struct.oidmap_iter* %1, %struct.oidmap_iter** %4
%5 = load %struct.oidmap*, %struct.oidmap** %3
%6 = load %struct.oidmap_iter*, %struct.oidmap_iter** %4
%7 = call i32 @oidmap_iter_init(%struct.oidmap* %5, %struct.oidmap_iter* %6)
%8 = load %struct.oidmap_iter*, %struct.oidmap_iter** %4
%9 = call i8* @oidmap_iter_next(%struct.oidmap_iter* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.oidmap = type { i32 }
%struct.oidmap_iter = type { i32 }
define i8* @oidmap_iter_first(%struct.oidmap* %0, %struct.oidmap_iter* %1) {
%3 = tail call i32 @oidmap_iter_init(%struct.oidmap* %0, %struct.oidmap_iter* %1)
%4 = tail call i8* @oidmap_iter_next(%struct.oidmap_iter* %1)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int create_server_socket(void) {
  int serverfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (serverfd < 0) {
    printf("create server socket failed!\n");
    exit(1);
  }
  return serverfd;
}


x86 assembly (clang, -O0):
<create_server_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e88(%rip),%rax
mov    (%rax),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    117b <create_server_socket+0x4b>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_server_socket>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
call   1050 <socket@plt>
test   %eax,%eax
js     1157 <create_server_socket+0x27>
pop    %rcx
ret
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str = [30 x i8] c"create server socket failed!\0A\00"
define i32 @create_server_socket() {
%1 = alloca i32
%2 = load i32, i32* @AF_INET
%3 = load i32, i32* @SOCK_STREAM
%4 = load i32, i32* @IPPROTO_TCP
%5 = call i32 @socket(i32 %2, i32 %3, i32 %4)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %0
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@str = [29 x i8] c"create server socket failed!\00"
define i32 @create_server_socket() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = load i32, i32* @IPPROTO_TCP
%4 = tail call i32 @socket(i32 %1, i32 %2, i32 %3)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %0
ret i32 %4
}
int stub(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @stub() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M998_f(char *s) {
  debug("M998_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M998_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M998_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M998_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M998_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M998_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M998_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_number_of_standard_polynomials(int *length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(22, length, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_number_of_standard_polynomials>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x16,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_number_of_standard_polynomials>:
mov    %rdi,%rsi
mov    $0x16,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @syscon_number_of_standard_polynomials(i32* %0) {
%2 = tail call i32 @_ada_use_c2phc(i32 22, i32* %0, i32* undef, double* undef)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ serialCommand(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, int);
void hr20UnsetTimer(int day, int slot) {
  char buffer[20];
  sprintf(buffer, "\rW%d%d0fff\r", day, slot);
  serialCommand(buffer, 0);
}


x86 assembly (clang, -O0):
<hr20UnsetTimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xec1(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1030 <serialCommand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hr20UnsetTimer>:
push   %rbx
sub    $0x20,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xed0(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <serialCommand@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\0DW%d%d0fff\0D\00"
define void @hr20UnsetTimer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%11 = call i32 @serialCommand(i8* %10, i32 0)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\0DW%d%d0fff\0D\00"
define void @hr20UnsetTimer(i32 %0, i32 %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @serialCommand(i8* %4, i32 0)
ret void
}
int bug1021_test_2(int x, char *y, void *z) {
  (void)x;
  (void)z;
  return y[0];
}


x86 assembly (clang, -O0):
<bug1021_test_2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bug1021_test_2>:
movsbl (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @bug1021_test_2(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 = load i32, i32* %4
%8 = load i8*, i8** %6
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @bug1021_test_2(i32 %0, i8* nocapture %1, i8* nocapture readnone %2) {
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float, char);
int main() {
  int i = 44;
  float f = -3.667;
  char c = '@';
  printf("i= %d\nf= %f\nc= %c\n", i, f, c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x2c,-0x4(%rbp)
movss  0xed9(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movb   $0x40,-0x9(%rbp)
mov    -0x4(%rbp),%esi
movss  -0x8(%rbp),%xmm0
lea    0xec5(%rip),%rdi
movsbl -0x9(%rbp),%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
mov    $0x2c,%esi
mov    $0x40,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"i= %d\0Af= %f\0Ac= %c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 44, float 0xC00D560420000000, i8 signext 64)
ret i32 0
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t dtls_uint16_to_int(const unsigned char *field) {
  return ((uint16_t)field[0] << 8) | (uint16_t)field[1];
}


x86 assembly (clang, -O0):
<dtls_uint16_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtls_uint16_to_int>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @dtls_uint16_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @dtls_uint16_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = or i32 %4, %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ enter_signal();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ leave_signal();
int /*<<< orphan*/ loginfo(char *);
int /*<<< orphan*/ shutdown_cleanup();
void signal_terminate(int signal) {
  enter_signal();
  loginfo("Terminating signal received.\n");
  shutdown_cleanup();
  leave_signal();
  exit(1);
}


x86 assembly (clang, -O0):
<signal_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <enter_signal@plt>
lea    0xe97(%rip),%rdi
call   1040 <loginfo@plt>
mov    $0x0,%al
call   1060 <shutdown_cleanup@plt>
mov    $0x0,%al
call   1030 <leave_signal@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<signal_terminate>:
push   %rax
xor    %eax,%eax
call   1050 <enter_signal@plt>
lea    0xea1(%rip),%rdi
call   1040 <loginfo@plt>
xor    %eax,%eax
call   1060 <shutdown_cleanup@plt>
xor    %eax,%eax
call   1030 <leave_signal@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"Terminating signal received.\0A\00"
define void @signal_terminate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @enter_signal()
%4 = call i32 @loginfo(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @shutdown_cleanup()
%6 = call i32 (...) @leave_signal()
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [30 x i8] c"Terminating signal received.\0A\00"
define void @signal_terminate(i32 %0) {
%2 = tail call i32 (...) @enter_signal()
%3 = tail call i32 @loginfo(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @shutdown_cleanup()
%5 = tail call i32 (...) @leave_signal()
%6 = tail call i32 @exit(i32 1)
unreachable
}
void flushout() {}


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

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

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

LLVM IR (-O2):
define void @flushout() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stega_show_usage(void) {
  (void)printf("\n\nNot enough parameters:");
  (void)printf("\n");
  (void)printf(
      "   "
      "\nstega -h cover-image-name message-image-name n"
      "\n       to hide the message image in the cover image"
      "\n                 or"
      "\nstega -u cover-image-name message-image-name n"
      "\n       to uncover the cover image from the message image\n\n");
}


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

x86 assembly (clang, -O2):
<stega_show_usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xecb(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A\0ANot enough parameters:\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [229 x i8] c" \0Astega -h cover-image-name message-image-name n\0A to hide the message image in the cover image\0A or\0Astega -u cover-image-name message-image-name n\0A to uncover the cover image from the message image\0A\0A\00"
define void @stega_show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A\0ANot enough parameters:\00"
@str = [228 x i8] c" \0Astega -h cover-image-name message-image-name n\0A to hide the message image in the cover image\0A or\0Astega -u cover-image-name message-image-name n\0A to uncover the cover image from the message image\0A\00"
define void @stega_show_usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([228 x i8], [228 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xx(int, int, char **, char *, int, int, int,
                      int /*<<< orphan*/, int /*<<< orphan*/);
void x3(int line_no, int n, char *ps[], char *s, int from, int to, int mem) {
  xx(line_no, n, ps, s, from, to, mem, 0, 0);
}


x86 assembly (clang, -O0):
<x3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    0x10(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
call   1030 <xx@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x3>:
push   %rax
mov    0x10(%rsp),%eax
sub    $0x8,%rsp
push   $0x0
push   $0x0
push   %rax
call   1030 <xx@plt>
add    $0x20,%rsp
pop    %rax
ret

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

LLVM IR (-O2):
define void @x3(i32 %0, i32 %1, i8** %2, i8* %3, i32 %4, i32 %5, i32 %6) {
%8 = tail call i32 @xx(i32 %0, i32 %1, i8** %2, i8* %3, i32 %4, i32 %5, i32 %6, i32 0, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ atan2(double, double);
int /*<<< orphan*/ link_failure_atan2();
void test_atan2(double d1, double d2) {
  if (atan2(d1, d2) != atan2(d1, d2))
    link_failure_atan2();
}


x86 assembly (clang, -O0):
<test_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
mov    %rax,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <atan2@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_atan2+0x4b>
mov    $0x0,%al
call   1040 <link_failure_atan2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_atan2>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
call   1030 <atan2@plt>
mov    %rax,%rbx
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1030 <atan2@plt>
cmp    %rax,%rbx
jne    1153 <test_atan2+0x33>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_atan2@plt>

LLVM IR (-O0):
define void @test_atan2(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @atan2(double %5, double %6)
%8 = load double, double* %3
%9 = load double, double* %4
%10 = call i64 @atan2(double %8, double %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_atan2()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_atan2(double %0, double %1) {
%3 = tail call i64 @atan2(double %0, double %1)
%4 = tail call i64 @atan2(double %0, double %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_atan2()
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void sigint_handle(int signo) {
  printf("interrupt\n%%");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<sigint_handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint_handle>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"interrupt\0A%%\00"
@stdout = global i32 0
define void @sigint_handle(i32 %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
ret void
}
/* Type definitions */
struct mibinfo {
  int dummy;
};

/* Variables and functions */
int format(char *, char *, size_t, void const *, size_t);
int hexvec_format(struct mibinfo *m, const void *data, size_t data_size,
                  char *buf, size_t len) {
  return format("%01x ", buf, len, data, data_size);
}


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

x86 assembly (clang, -O2):
<hexvec_format>:
mov    %rdx,%r9
mov    %rsi,%rax
lea    0xee3(%rip),%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %rax,%rcx
mov    %r9,%r8
jmp    1030 <format@plt>

LLVM IR (-O0):
%struct.mibinfo = type { i32 }
@.str = [6 x i8] c"%01x \00"
define i32 @hexvec_format(%struct.mibinfo* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca %struct.mibinfo*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
store %struct.mibinfo* %0, %struct.mibinfo** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
%11 = load i8*, i8** %9
%12 = load i64, i64* %10
%13 = load i8*, i8** %7
%14 = load i64, i64* %8
%15 = call i32 @format(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12, i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.mibinfo = type { i32 }
@.str = [6 x i8] c"%01x \00"
define i32 @hexvec_format(%struct.mibinfo* nocapture readnone %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i32 @format(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i64 %4, i8* %1, i64 %2)
ret i32 %6
}
unsigned char Avi_SetVol(unsigned char bVol) {
  unsigned char result = 0;
  return result;
}


x86 assembly (clang, -O0):
<Avi_SetVol>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @Avi_SetVol(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
%4 = load i8, i8* %3
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @Avi_SetVol(i8 zeroext %0) {
ret i8 0
}
/* Variables and functions */
int /*<<< orphan*/ f(char);
int main() { f("."[0]); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xee5(%rip),%edi
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = load i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%2 = call i32 @f(i8 signext %1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i8 signext 46)
ret i32 0
}
int smp_find_processor_id(int address) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @smp_find_processor_id(i32 %0) {
ret i32 0
}
void NANDAddressWrite(unsigned int addrRegAddr, unsigned int addr) {
  (*(volatile unsigned char *)(addrRegAddr)) = (unsigned char)addr;
}


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

x86 assembly (clang, -O2):
<NANDAddressWrite>:
mov    %edi,%eax
mov    %sil,(%rax)
ret

LLVM IR (-O0):
define void @NANDAddressWrite(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = trunc i32 %5 to i8
%7 = load i32, i32* %3
%8 = zext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store volatile i8 %6, i8* %9
ret void
}

LLVM IR (-O2):
define void @NANDAddressWrite(i32 %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = zext i32 %0 to i64
%5 = inttoptr i64 %4 to i8*
store volatile i8 %3, i8* %5
ret void
}
void nothing_destroy(ctx) void *ctx;
{ free(ctx); }


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

x86 assembly (clang, -O2):
<nothing_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @nothing_destroy(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, double);
int main() {
  int i = 11, j = 3;
  double d;
  d = (double)i / j;
  printf("%d / %d = %.2f\n", i, j, d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xb,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movsd  -0x18(%rbp),%xmm0
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0xb,%esi
mov    $0x3,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"%d / %d = %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 11, i32 3, double 0x400D555555555555)
ret i32 0
}
void addReplyDouble(void) {
  _serverPanic("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/"
               "heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c",
               23, "Function '%s' is disabled.", __func__);
}


x86 assembly (clang, -O0):
<addReplyDouble>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x17,%esi
lea    0xf79(%rip),%rdx
lea    0xf8d(%rip),%rcx
mov    $0x0,%al
call   1030 <_serverPanic@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<addReplyDouble>:
lea    0xee9(%rip),%rdi
lea    0xf82(%rip),%rdx
lea    0xf96(%rip),%rcx
mov    $0x17,%esi
xor    %eax,%eax
jmp    1030 <_serverPanic@plt>

LLVM IR (-O0):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyDouble = [15 x i8] c"addReplyDouble\00"
define void @addReplyDouble() {
%1 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.addReplyDouble, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [160 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CodisLabs/redis-port/refs/heads/redis-4.x-cgo/pkg/rdb/cgo_glue_meow.c\00"
@.str.1 = [27 x i8] c"Function '%s' is disabled.\00"
@__func__.addReplyDouble = [15 x i8] c"addReplyDouble\00"
define void @addReplyDouble() {
%1 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @_serverPanic to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([160 x i8], [160 x i8]* @.str, i64 0, i64 0), i32 23, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.addReplyDouble, i64 0, i64 0))
ret void
}
/* Variables and functions */
float mydrand();
float ran1(int *idum) { return mydrand(); }


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

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

LLVM IR (-O0):
define float @ran1(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call float (...) @mydrand()
ret float %3
}

LLVM IR (-O2):
define float @ran1(i32* nocapture readnone %0) {
%2 = tail call float (...) @mydrand()
ret float %2
}
int main() {
  while (1) {
    int i = 100000;
    while (i--)
      ;
    asm("cli;sti;");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x186a0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     112b <main+0x2b>
jmp    1112 <main+0x12>
cli
sti
jmp    110b <main+0xb>

x86 assembly (clang, -O2):
<main>:
cli
sti
jmp    1100 <main>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
tail call void asm sideeffect "cli;sti;", "~{dirflag},~{fpsr},~{flags}"()
br label %1
}