xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ fail();
scalar_t__ inet_addr(char *);
int /*<<< orphan*/ perror(char *);
in_addr_t localhost(void) {
  in_addr_t res = inet_addr("127.0.0.1");
  if (res == (in_addr_t)-1) {
    perror("parrot: inet_addr");
    fail();
  }
  return res;
}


x86 assembly (clang, -O0):
<localhost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <inet_addr@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0xffffffffffffffff,-0x8(%rbp)
jne    1166 <localhost+0x36>
lea    0xeb0(%rip),%rdi
call   1050 <perror@plt>
mov    $0x0,%al
call   1030 <fail@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<localhost>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <inet_addr@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
je     114b <localhost+0x1b>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xeb8(%rip),%rdi
call   1050 <perror@plt>
xor    %eax,%eax
call   1030 <fail@plt>
jmp    1146 <localhost+0x16>

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [18 x i8] c"parrot: inet_addr\00"
define i64 @localhost() {
%1 = alloca i64
%2 = call i64 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = icmp eq i64 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @fail()
br label %8
8: ; preds = %5, %0
%9 = load i64, i64* %1
ret i64 %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [18 x i8] c"parrot: inet_addr\00"
define i64 @localhost() {
%1 = tail call i64 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, -1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (...) @fail()
br label %6
6: ; preds = %3, %0
ret i64 %1
}
/* Type definitions */
typedef int u_int32_t;

/* Variables and functions */
u_int32_t iceil_log2(u_int32_t a, u_int32_t b) {
  return (a + (1 << b) - 1) >> b;
}


x86 assembly (clang, -O0):
<iceil_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
sub    $0x1,%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iceil_log2>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
add    %edi,%eax
add    $0xffffffff,%eax
sar    %cl,%eax
ret

LLVM IR (-O0):
define i32 @iceil_log2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = add nsw i32 %5, %7
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %4
%11 = ashr i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @iceil_log2(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = add i32 %0, -1
%5 = add i32 %4, %3
%6 = ashr i32 %5, %1
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ wchar_t;

/* Variables and functions */
wchar_t *wcsrchr(const wchar_t *wcs, const wchar_t wc) {
  const wchar_t *retval = NULL;
  do
    if (*wcs == wc)
      retval = wcs;
  while (*wcs++ != L'\0');
  return (wchar_t *)retval;
}


x86 assembly (clang, -O0):
<wcsrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
cmp    -0x10(%rbp),%rax
jne    112d <wcsrchr+0x2d>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1132 <wcsrchr+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
cmpq   $0x0,(%rax)
jne    1114 <wcsrchr+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rdi),%rcx
cmp    %rsi,%rcx
cmove  %rdi,%rax
add    $0x8,%rdi
test   %rcx,%rcx
jne    1110 <wcsrchr+0x10>
ret

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

LLVM IR (-O2):
define i64* @wcsrchr(i64* %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64* [ %0, %2 ], [ %9, %3 ]
%5 = phi i64* [ null, %2 ], [ %8, %3 ]
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, %1
%8 = select i1 %7, i64* %4, i64* %5
%9 = getelementptr inbounds i64, i64* %4, i64 1
%10 = icmp eq i64 %6, 0
br i1 %10, label %11, label %3
11: ; preds = %3
ret i64* %8
}
/* Variables and functions */
int WSTOPSIG(int);
int wstopsig(int status) { return WSTOPSIG(status); }


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

x86 assembly (clang, -O2):
<wstopsig>:
jmp    1030 <WSTOPSIG@plt>

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

LLVM IR (-O2):
define i32 @wstopsig(i32 %0) {
%2 = tail call i32 @WSTOPSIG(i32 %0)
ret i32 %2
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int fstat(int fd, struct stat *buf) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<fstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<fstat>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ StrDump(char *);
void TabDump() { StrDump("\t"); }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
define void @TabDump() {
%1 = tail call i32 @StrDump(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
void func1(int var1, int var2) {
  var1 = var2 | var1;
  var1 = var2 & var1;
  var1 = var2 ^ var1;
  var1 = var2 <= var1;
  var1 = var2 >= var1;
  var1 = var2 == var1;
  var1 = var2 != var1;
}


x86 assembly (clang, -O0):
<func1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func1(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* %3
%7 = or i32 %5, %6
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = and i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = xor i32 %11, %12
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp sle i32 %14, %15
%17 = zext i1 %16 to i32
store i32 %17, i32* %3
%18 = load i32, i32* %4
%19 = load i32, i32* %3
%20 = icmp sge i32 %18, %19
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
%22 = load i32, i32* %4
%23 = load i32, i32* %3
%24 = icmp eq i32 %22, %23
%25 = zext i1 %24 to i32
store i32 %25, i32* %3
%26 = load i32, i32* %4
%27 = load i32, i32* %3
%28 = icmp ne i32 %26, %27
%29 = zext i1 %28 to i32
store i32 %29, i32* %3
ret void
}

LLVM IR (-O2):
define void @func1(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
double floor(float);
float calculateCharges(float hours) {
  float ret;
  if (hours <= 3) {
    ret = 2.00;
  } else {
    ret = floor(hours - 3) * 0.5 + 2.00;
  }
  if (ret > 10.0) {
    ret = 10.0;
  }
  return ret;
}


x86 assembly (clang, -O0):
<calculateCharges>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jb     1141 <calculateCharges+0x31>
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1178 <calculateCharges+0x68>
movss  -0x4(%rbp),%xmm0
movss  0xeb2(%rip),%xmm1
subss  %xmm1,%xmm0
call   1030 <floor@plt>
movsd  0xeb1(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xead(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11a0 <calculateCharges+0x90>
movss  0xe6d(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateCharges>:
push   %rax
movss  0xeeb(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    1144 <calculateCharges+0x34>
addss  0xee2(%rip),%xmm0
call   1030 <floor@plt>
mulsd  0xedd(%rip),%xmm0
addsd  0xedd(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm1
jmp    114c <calculateCharges+0x3c>
movss  0xeb4(%rip),%xmm1
movss  0xeb8(%rip),%xmm0
minss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @calculateCharges(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp ole float %4, 3.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store float 2.000000e+00, float* %3
br label %13
7: ; preds = %1
%8 = load float, float* %2
%9 = fsub float %8, 3.000000e+00
%10 = call double @floor(float %9)
%11 = call double @llvm.fmuladd.f64(double %10, double 5.000000e-01, double 2.000000e+00)
%12 = fptrunc double %11 to float
store float %12, float* %3
br label %13
13: ; preds = %7, %6
%14 = load float, float* %3
%15 = fpext float %14 to double
%16 = fcmp ogt double %15, 1.000000e+01
br i1 %16, label %17, label %18
17: ; preds = %13
store float 1.000000e+01, float* %3
br label %18
18: ; preds = %17, %13
%19 = load float, float* %3
ret float %19
}

LLVM IR (-O2):
define float @calculateCharges(float %0) {
%2 = fcmp ugt float %0, 3.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fadd float %0, -3.000000e+00
%5 = tail call double @floor(float %4)
%6 = tail call double @llvm.fmuladd.f64(double %5, double 5.000000e-01, double 2.000000e+00)
%7 = fptrunc double %6 to float
br label %8
8: ; preds = %1, %3
%9 = phi float [ %7, %3 ], [ 2.000000e+00, %1 ]
%10 = fcmp ogt float %9, 1.000000e+01
%11 = select i1 %10, float 1.000000e+01, float %9
ret float %11
}
int _bitcpy_test_getbit(void *ptr, int n) {
  return (((unsigned char *)ptr)[n >> 3] >> (n & 7)) & 1;
}


x86 assembly (clang, -O0):
<_bitcpy_test_getbit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sar    $0x3,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
sar    %cl,%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bitcpy_test_getbit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
cltq
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @_bitcpy_test_getbit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = and i32 %12, 7
%14 = ashr i32 %11, %13
%15 = and i32 %14, 1
ret i32 %15
}

LLVM IR (-O2):
define i32 @_bitcpy_test_getbit(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, 7
%9 = lshr i32 %7, %8
%10 = and i32 %9, 1
ret i32 %10
}
void mysubmodule_destroy() {}


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

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

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

LLVM IR (-O2):
define void @mysubmodule_destroy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void think(int thinkPosition) {
  printf("philosopher %d is thinking...\n", thinkPosition);
}


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

x86 assembly (clang, -O2):
<think>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [31 x i8] c"philosopher %d is thinking...\0A\00"
define void @think(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int gethostname(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *dcc_gethostname(void) {
  static char myname[100] = "\0";
  if (!myname[0]) {
    if (gethostname(myname, sizeof myname - 1) == -1)
      strcpy(myname, "UNKNOWN");
  }
  return myname;
}


x86 assembly (clang, -O0):
<dcc_gethostname>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f15(%rip)
jne    1163 <dcc_gethostname+0x43>
lea    0x2f08(%rip),%rdi
mov    $0x63,%esi
call   1040 <gethostname@plt>
cmp    $0xffffffff,%eax
jne    115e <dcc_gethostname+0x3e>
lea    0x2eee(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1163 <dcc_gethostname+0x43>
lea    0x2ed6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dcc_gethostname>:
push   %rax
cmpb   $0x0,0x2f18(%rip)
jne    1153 <dcc_gethostname+0x33>
lea    0x2f0f(%rip),%rdi
mov    $0x63,%esi
call   1040 <gethostname@plt>
cmp    $0xffffffff,%eax
jne    1153 <dcc_gethostname+0x33>
lea    0x2ef9(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ee6(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@dcc_gethostname.myname = internal global [100 x i8] zeroinitializer
@.str = [8 x i8] c"UNKNOWN\00"
define i8* @dcc_gethostname() {
%1 = load i8, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0)
%2 = icmp ne i8 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i32 @gethostname(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0), i32 99)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
br label %9
9: ; preds = %8, %0
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0)
}

LLVM IR (-O2):
@dcc_gethostname.myname = internal global [100 x i8] zeroinitializer
@.str = [8 x i8] c"UNKNOWN\00"
define i8* @dcc_gethostname() {
%1 = load i8, i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 @gethostname(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0), i32 99)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @strcpy(i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %0
ret i8* getelementptr inbounds ([100 x i8], [100 x i8]* @dcc_gethostname.myname, i64 0, i64 0)
}
/* Variables and functions */
size_t getpagesize();
size_t tp_info_defaultguard() { return getpagesize(); }


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

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

LLVM IR (-O0):
define i64 @tp_info_defaultguard() {
%1 = call i64 (...) @getpagesize()
ret i64 %1
}

LLVM IR (-O2):
define i64 @tp_info_defaultguard() {
%1 = tail call i64 (...) @getpagesize()
ret i64 %1
}
/* Variables and functions */
float powf(float, float);
float __glsl_pow(float x, float y) { return powf(x, y); }


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

x86 assembly (clang, -O2):
<__glsl_pow>:
jmp    1030 <powf@plt>

LLVM IR (-O0):
define float @__glsl_pow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @powf(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__glsl_pow(float %0, float %1) {
%3 = tail call float @powf(float %0, float %1)
ret float %3
}
void g_ptr_array_free() {}


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

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

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

LLVM IR (-O2):
define void @g_ptr_array_free() {
ret void
}
/* Variables and functions */
void *realloc(void *, size_t);
void *_mosquitto_realloc(void *ptr, size_t size) {
  void *mem;
  mem = realloc(ptr, size);
  return mem;
}


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

x86 assembly (clang, -O2):
<_mosquitto_realloc>:
jmp    1030 <realloc@plt>

LLVM IR (-O0):
define i8* @_mosquitto_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @_mosquitto_realloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
ret i8* %3
}
void palupdate(int forceUpdate) {}


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

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

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

LLVM IR (-O2):
define void @palupdate(i32 %0) {
ret void
}
void nop_print(struct lb_record *rec, unsigned long addr) { return; }


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

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

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

LLVM IR (-O2):
%struct.lb_record = type opaque
define void @nop_print(%struct.lb_record* nocapture %0, i64 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int getAbs(int value) {
  int tmp, record;
  record = value;
  tmp = value >> 31;
  value = (value ^ tmp) - tmp;
  printf("abs of %d is %d\n", record, value);
  return value;
}


x86 assembly (clang, -O0):
<getAbs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAbs>:
push   %rbx
mov    %edi,%esi
mov    %edi,%ebx
neg    %ebx
cmovs  %edi,%ebx
lea    0xedf(%rip),%rdi
mov    %ebx,%edx
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"abs of %d is %d\0A\00"
define i32 @getAbs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %4
%6 = load i32, i32* %2
%7 = ashr i32 %6, 31
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = xor i32 %8, %9
%11 = load i32, i32* %3
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %2
%13 = load i32, i32* %4
%14 = load i32, i32* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %14)
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"abs of %d is %d\0A\00"
define i32 @getAbs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret i32 %2
}
/* Variables and functions */
int ioctl(int, int, void *);
int real_ioctl(int fd, int r, void *arg) { return ioctl(fd, r, arg); }


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

x86 assembly (clang, -O2):
<real_ioctl>:
jmp    1030 <ioctl@plt>

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

LLVM IR (-O2):
define i32 @real_ioctl(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @ioctl(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void WebRtc_MeanEstimatorFix(int32_t new_value, int factor,
                             int32_t *mean_value) {
  int32_t diff = new_value - *mean_value;
  if (diff < 0) {
    diff = -((-diff) >> factor);
  } else {
    diff = (diff >> factor);
  }
  *mean_value += diff;
}


x86 assembly (clang, -O0):
<WebRtc_MeanEstimatorFix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    113c <WebRtc_MeanEstimatorFix+0x3c>
xor    %eax,%eax
sub    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1147 <WebRtc_MeanEstimatorFix+0x47>
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<WebRtc_MeanEstimatorFix>:
mov    %esi,%ecx
mov    (%rdx),%r8d
sub    %r8d,%edi
mov    %edi,%esi
neg    %esi
sar    %cl,%esi
neg    %esi
mov    %edi,%eax
sar    %cl,%eax
test   %edi,%edi
cmovs  %esi,%eax
add    %r8d,%eax
mov    %eax,(%rdx)
ret

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

LLVM IR (-O2):
define void @WebRtc_MeanEstimatorFix(i32 %0, i32 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = sub nsw i32 %0, %4
%6 = icmp slt i32 %5, 0
%7 = sub nsw i32 0, %5
%8 = ashr i32 %7, %1
%9 = sub nsw i32 0, %8
%10 = ashr i32 %5, %1
%11 = select i1 %6, i32 %9, i32 %10
%12 = add nsw i32 %11, %4
store i32 %12, i32* %2
ret void
}
void compaq_nvram_init(void *rom_start) { return; }


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

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

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

LLVM IR (-O2):
define void @compaq_nvram_init(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_66() {
  Assert_real((isqrt(66) == 8),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              335, ("Integer square root of 66 should be 8"));
}


x86 assembly (clang, -O0):
<t_sqrt_66>:
push   %rbp
mov    %rsp,%rbp
mov    $0x42,%edi
call   1030 <isqrt@plt>
cmp    $0x8,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x14f,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_66>:
push   %rax
mov    $0x42,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x8,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x14f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 66 should be 8\00"
define void @t_sqrt_66() {
%1 = call i32 @isqrt(i32 66)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [38 x i8] c"Integer square root of 66 should be 8\00"
define void @t_sqrt_66() {
%1 = tail call i32 @isqrt(i32 66)
%2 = icmp eq i32 %1, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int inportb(int);
int /*<<< orphan*/ outportb(int, int);
int cmos_get_update_in_progress_flag(void) {
  outportb(0x70, 0x0A);
  return inportb(0x71) & 0x80;
}


x86 assembly (clang, -O0):
<cmos_get_update_in_progress_flag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
mov    $0xa,%esi
call   1040 <outportb@plt>
mov    $0x71,%edi
call   1030 <inportb@plt>
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmos_get_update_in_progress_flag>:
push   %rax
mov    $0x70,%edi
mov    $0xa,%esi
call   1040 <outportb@plt>
mov    $0x71,%edi
call   1030 <inportb@plt>
and    $0x80,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmos_get_update_in_progress_flag() {
%1 = call i32 @outportb(i32 112, i32 10)
%2 = call i32 @inportb(i32 113)
%3 = and i32 %2, 128
ret i32 %3
}

LLVM IR (-O2):
define i32 @cmos_get_update_in_progress_flag() {
%1 = tail call i32 @outportb(i32 112, i32 10)
%2 = tail call i32 @inportb(i32 113)
%3 = and i32 %2, 128
ret i32 %3
}
ISR(TIMER0_OVF_vect) {
  if (*((char *)0x260) != 0x55) {
    DEBUG("STACK OVERFLOW DETECTED\n");
    timer_stop();
    sei();
    for (;;)
      ;
  }
}


x86 assembly (clang, -O0):
<ISR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x260,%eax
movsbl (%rax),%eax
cmp    $0x55,%eax
je     116d <ISR+0x3d>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <DEBUG@plt>
mov    $0x0,%al
call   1050 <timer_stop@plt>
mov    $0x0,%al
call   1040 <sei@plt>
jmp    1168 <ISR+0x38>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISR>:
push   %rax
cmpb   $0x55,0x260
55
jne    113d <ISR+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <DEBUG@plt>
xor    %eax,%eax
call   1050 <timer_stop@plt>
xor    %eax,%eax
call   1040 <sei@plt>
nopl   0x0(%rax)
jmp    1160 <ISR+0x30>

LLVM IR (-O0):
@.str = [25 x i8] c"STACK OVERFLOW DETECTED\0A\00"
define i32 @ISR(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i8, i8* inttoptr (i64 608 to i8*)
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 85
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @timer_stop()
%10 = call i32 (...) @sei()
br label %11
11: ; preds = %11, %7
br label %11
12: ; preds = %1
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [25 x i8] c"STACK OVERFLOW DETECTED\0A\00"
define i32 @ISR(i32 %0) {
%2 = load i8, i8* inttoptr (i64 608 to i8*)
%3 = icmp eq i8 %2, 85
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @DEBUG to i32 (i8*, ...)*)(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (...) @timer_stop()
%7 = tail call i32 (...) @sei()
br label %8
8: ; preds = %8, %4
br label %8
9: ; preds = %1
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ inv_fifo_protocol_helper_decode_acc_data(void const *,
                                                            int /*<<< orphan*/,
                                                            float *, float *,
                                                            float *);
void inv_fifo_protocol_helper_decode_gravity_data(const void *in, uint16_t len,
                                                  float *x, float *y,
                                                  float *z) {
  inv_fifo_protocol_helper_decode_acc_data(in, len, x, y, z);
}


x86 assembly (clang, -O0):
<inv_fifo_protocol_helper_decode_gravity_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <inv_fifo_protocol_helper_decode_acc_data@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_fifo_protocol_helper_decode_gravity_data>:
jmp    1030 <inv_fifo_protocol_helper_decode_acc_data@plt>

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

LLVM IR (-O2):
define void @inv_fifo_protocol_helper_decode_gravity_data(i8* %0, i32 %1, float* %2, float* %3, float* %4) {
%6 = tail call i32 @inv_fifo_protocol_helper_decode_acc_data(i8* %0, i32 %1, float* %2, float* %3, float* %4)
ret void
}
/* Variables and functions */
scalar_t__ _syscall(int, int /*<<< orphan*/, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int syscall_getpid() { return (int)_syscall(0x106, 0, 0, 0); }


x86 assembly (clang, -O0):
<syscall_getpid>:
push   %rbp
mov    %rsp,%rbp
mov    $0x106,%edi
xor    %ecx,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <_syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_getpid>:
mov    $0x106,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <_syscall@plt>

LLVM IR (-O0):
define i32 @syscall_getpid() {
%1 = call i64 @_syscall(i32 262, i32 0, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @syscall_getpid() {
%1 = tail call i64 @_syscall(i32 262, i32 0, i32 0, i32 0)
%2 = trunc i64 %1 to i32
ret i32 %2
}
void gtk_vbutton_box_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_vbutton_box_new() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ vwarn(char const *, int /*<<< orphan*/);
void verr(int status, const char *fmt, va_list ap) {
  vwarn(fmt, ap);
  exit(status);
}


x86 assembly (clang, -O0):
<verr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <vwarn@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<verr>:
push   %rbx
mov    %edi,%ebx
mov    %rsi,%rdi
mov    %edx,%esi
call   1030 <vwarn@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @verr(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = load i32, i32* %6
%9 = call i32 @vwarn(i8* %7, i32 %8)
%10 = load i32, i32* %4
%11 = call i32 @exit(i32 %10)
unreachable
}

LLVM IR (-O2):
define void @verr(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @vwarn(i8* %1, i32 %2)
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
#define TIME_UTC 128
int /*<<< orphan*/ __clock_gettime(int /*<<< orphan*/, struct timespec *);
int timespec_get(struct timespec *ts, int base) {
  switch (base) {
  case TIME_UTC:
    if (__clock_gettime(CLOCK_REALTIME, ts) < 0)
      return 0;
    break;
  default:
    return 0;
  }
  return base;
}


x86 assembly (clang, -O0):
<timespec_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x80,%eax
jne    115e <timespec_get+0x4e>
jmp    1132 <timespec_get+0x22>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <__clock_gettime@plt>
cmp    $0x0,%eax
jge    1159 <timespec_get+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1170 <timespec_get+0x60>
jmp    116a <timespec_get+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1170 <timespec_get+0x60>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_get>:
xor    %eax,%eax
cmp    $0x80,%esi
jne    113d <timespec_get+0x2d>
push   %rax
mov    %rdi,%rcx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    %rcx,%rsi
call   1030 <__clock_gettime@plt>
shr    $0x18,%eax
not    %eax
and    $0x80,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @timespec_get(%struct.timespec* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca i32
store %struct.timespec* %0, %struct.timespec** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
switch i32 %6, label %14 [
i32 128, label %7
]
7: ; preds = %2
%8 = load i32, i32* @CLOCK_REALTIME
%9 = load %struct.timespec*, %struct.timespec** %4
%10 = call i32 @__clock_gettime(i32 %8, %struct.timespec* %9)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %7
store i32 0, i32* %3
br label %17
13: ; preds = %7
br label %15
14: ; preds = %2
store i32 0, i32* %3
br label %17
15: ; preds = %13
%16 = load i32, i32* %5
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %14, %12
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @timespec_get(%struct.timespec* %0, i32 %1) {
%3 = icmp eq i32 %1, 128
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = load i32, i32* @CLOCK_REALTIME
%6 = tail call i32 @__clock_gettime(i32 %5, %struct.timespec* %0)
%7 = lshr i32 %6, 24
%8 = and i32 %7, 128
%9 = xor i32 %8, 128
br label %10
10: ; preds = %2, %4
%11 = phi i32 [ %9, %4 ], [ 0, %2 ]
ret i32 %11
}
void push_buffer(char *buffer, int key) {
  int i;
  for (i = 0; i < 4 - 1; i++)
    buffer[i] = buffer[i + 1];
  buffer[4 - 1] = (char)key;
}


x86 assembly (clang, -O0):
<push_buffer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3,-0x10(%rbp)
jge    1145 <push_buffer+0x45>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <push_buffer+0x12>
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_buffer>:
movzwl 0x1(%rdi),%eax
mov    %ax,(%rdi)
mov    0x3(%rdi),%al
mov    %al,0x2(%rdi)
mov    %sil,0x3(%rdi)
ret

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

LLVM IR (-O2):
define void @push_buffer(i8* nocapture %0, i32 %1) {
%3 = getelementptr i8, i8* %0, i64 1
%4 = trunc i32 %1 to i8
%5 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %4, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("19880101\n19880111\n19880117\n19880129\n19880221\n19880317\n19880321"
         "\n19880323\n19880417\n19880501\n19880519\n19880521\n19880603\n1988062"
         "9\n19880711\n19880719\n19880723\n19880807\n19880911\n19881019\n198811"
         "01\n19881227\n19881229\n19890103\n19890107\n19890307\n19890413\n19890"
         "503\n19890509\n19890517\n19890523\n19890707\n19890713\n19890817\n1989"
         "0911\n19890919\n19891007\n19891019\n19891031\n19891103\n19891117\n198"
         "91127\n19891213\n19891229\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [397 x i8] c"19880101\0A19880111\0A19880117\0A19880129\0A19880221\0A19880317\0A19880321\0A19880323\0A19880417\0A19880501\0A19880519\0A19880521\0A19880603\0A19880629\0A19880711\0A19880719\0A19880723\0A19880807\0A19880911\0A19881019\0A19881101\0A19881227\0A19881229\0A19890103\0A19890107\0A19890307\0A19890413\0A19890503\0A19890509\0A19890517\0A19890523\0A19890707\0A19890713\0A19890817\0A19890911\0A19890919\0A19891007\0A19891019\0A19891031\0A19891103\0A19891117\0A19891127\0A19891213\0A19891229\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([397 x i8], [397 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [396 x i8] c"19880101\0A19880111\0A19880117\0A19880129\0A19880221\0A19880317\0A19880321\0A19880323\0A19880417\0A19880501\0A19880519\0A19880521\0A19880603\0A19880629\0A19880711\0A19880719\0A19880723\0A19880807\0A19880911\0A19881019\0A19881101\0A19881227\0A19881229\0A19890103\0A19890107\0A19890307\0A19890413\0A19890503\0A19890509\0A19890517\0A19890523\0A19890707\0A19890713\0A19890817\0A19890911\0A19890919\0A19891007\0A19891019\0A19891031\0A19891103\0A19891117\0A19891127\0A19891213\0A19891229\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([396 x i8], [396 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int outchar() {}


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

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

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

LLVM IR (-O2):
define i32 @outchar() {
ret i32 undef
}
volatile char *add_headeri(volatile char *tgt_addr) {
  (*tgt_addr++) = 0xc8;
  (*(short *)tgt_addr) = 2048;
  tgt_addr += 0x2;
  tgt_addr++;
  return (tgt_addr);
}


x86 assembly (clang, -O0):
<add_headeri>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0xc8,(%rax)
mov    -0x8(%rbp),%rax
movw   $0x800,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_headeri>:
movb   $0xc8,(%rdi)
movw   $0x800,0x1(%rdi)
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @add_headeri(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i32 1
store i8* %4, i8** %2
store volatile i8 -56, i8* %3
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i16*
store i16 2048, i16* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @add_headeri(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
store volatile i8 -56, i8* %0
%3 = bitcast i8* %2 to i16*
store i16 2048, i16* %3
%4 = getelementptr inbounds i8, i8* %0, i64 4
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int write(int, char *, int);
int net_server_terminate(int sock) {
  int res;
  res = write(sock, "TERM\n", 5);
  close(sock);
  return (res == 5);
}


x86 assembly (clang, -O0):
<net_server_terminate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0xecb(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
cmpl   $0x5,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_server_terminate>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed4(%rip),%rsi
mov    $0x5,%edx
call   1030 <write@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <close@plt>
xor    %eax,%eax
cmp    $0x5,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"TERM\0A\00"
define i32 @net_server_terminate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 5
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
@.str = [6 x i8] c"TERM\0A\00"
define i32 @net_server_terminate(i32 %0) {
%2 = tail call i32 @write(i32 %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %2, 5
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct mem_pool {
  int dummy;
};

/* Variables and functions */
struct mem_pool *ftor_pool_get_with_size(int);
struct mem_pool *ftor_pool_get() {
  return ftor_pool_get_with_size((1 * 1024 * 1024));
}


x86 assembly (clang, -O0):
<ftor_pool_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100000,%edi
call   1030 <ftor_pool_get_with_size@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ftor_pool_get>:
mov    $0x100000,%edi
jmp    1030 <ftor_pool_get_with_size@plt>

LLVM IR (-O0):
%struct.mem_pool = type { i32 }
define %struct.mem_pool* @ftor_pool_get() {
%1 = call %struct.mem_pool* @ftor_pool_get_with_size(i32 1048576)
ret %struct.mem_pool* %1
}

LLVM IR (-O2):
%struct.mem_pool = type { i32 }
define %struct.mem_pool* @ftor_pool_get() {
%1 = tail call %struct.mem_pool* @ftor_pool_get_with_size(i32 1048576)
ret %struct.mem_pool* %1
}
int expect_not_taken(int x) {
  if (__builtin_expect(x, 0))
    return 0;
  return x;
}


x86 assembly (clang, -O0):
<expect_not_taken>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmp    $0x0,%rax
je     1121 <expect_not_taken+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1127 <expect_not_taken+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @expect_not_taken(i32 %0) {
ret i32 0
}
int break_me(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @break_me() {
ret i32 0
}