xunge/DecIR huggingface dataset:
/* Type definitions */
struct sigaction {
  int dummy;
};

/* Variables and functions */
int __platform_sigaction(int, struct sigaction const *, struct sigaction *);
int sigaction(int sig, const struct sigaction *__restrict nsv,
              struct sigaction *__restrict osv) {
  int ret = __platform_sigaction(sig, nsv, osv);
  return ret;
}


x86 assembly (clang, -O0):
<sigaction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__platform_sigaction@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigaction>:
jmp    1030 <__platform_sigaction@plt>

LLVM IR (-O0):
%struct.sigaction = type { i32 }
define i32 @sigaction(i32 %0, %struct.sigaction* noalias %1, %struct.sigaction* noalias %2) {
%4 = alloca i32
%5 = alloca %struct.sigaction*
%6 = alloca %struct.sigaction*
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sigaction* %1, %struct.sigaction** %5
store %struct.sigaction* %2, %struct.sigaction** %6
%8 = load i32, i32* %4
%9 = load %struct.sigaction*, %struct.sigaction** %5
%10 = load %struct.sigaction*, %struct.sigaction** %6
%11 = call i32 @__platform_sigaction(i32 %8, %struct.sigaction* %9, %struct.sigaction* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
ret i32 %12
}

LLVM IR (-O2):
%struct.sigaction = type { i32 }
define i32 @sigaction(i32 %0, %struct.sigaction* noalias %1, %struct.sigaction* noalias %2) {
%4 = tail call i32 @__platform_sigaction(i32 %0, %struct.sigaction* %1, %struct.sigaction* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNCTrigger() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(14);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCTrigger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0xe,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCTrigger>:
push   %rax
mov    $0xe,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNCTrigger() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 14)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNCTrigger() {
%1 = tail call i32 @BNCIO(i32 14)
ret i32 99
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void errorVarSize(void) { error("Variable(s) take(s) too much space\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"Variable(s) take(s) too much space\0A\00"
define void @errorVarSize() {
%1 = call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"Variable(s) take(s) too much space\0A\00"
define void @errorVarSize() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
pid_t __attribute__((section("libgloss_epiphany"))) _wait(int *status) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_wait(i32* %0) section "libgloss_epiphany" {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @_wait(i32* nocapture readnone %0) section "libgloss_epiphany" {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *, int, int);
int main() {
  char *a = "int main(){char* a=%c%s%c;int b='%c';printf(a,b,a,b,b);}";
  int b = '"';
  printf(a, b, a, b, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x22,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x22,%esi
mov    %rdi,%rdx
mov    $0x22,%ecx
mov    $0x22,%r8d
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"int main(){char* a=%c%s%c;int b='%c';printf(a,b,a,b,b);}\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i8** %1
store i32 34, i32* %2
%3 = load i8*, i8** %1
%4 = load i32, i32* %2
%5 = load i8*, i8** %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = call i32 @printf(i8* %3, i32 %4, i8* %5, i32 %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [57 x i8] c"int main(){char* a=%c%s%c;int b='%c';printf(a,b,a,b,b);}\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0), i32 34, i32 34)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int test_close_nowrite_helper(char *path, void *fdptr) {
  int fd = *(int *)fdptr;
  (void)close(fd);
  return 0;
}


x86 assembly (clang, -O0):
<test_close_nowrite_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_close_nowrite_helper>:
push   %rax
mov    (%rsi),%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_close_nowrite_helper(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @close(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @test_close_nowrite_helper(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @close(i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memory_leak();
int main(void) {
  memory_leak();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <memory_leak@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @memory_leak()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @memory_leak()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void clad_free(void *old) { free(old); }


x86 assembly (clang, -O0):
<clad_free>:
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):
<clad_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @clad_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("In user pid=%u\n", getpid());
  while (1)
    ;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
jmp    114b <main+0x2b>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1140 <main+0x20>

LLVM IR (-O0):
@.str = [16 x i8] c"In user pid=%u\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getpid()
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %2, %8
br label %8
}

LLVM IR (-O2):
@.str = [16 x i8] c"In user pid=%u\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getpid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
br label %5
5: ; preds = %2, %5
br label %5
}
/* Variables and functions */
double atof(char *);
double Type_toDouble(char *val) { return atof(val); }


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

x86 assembly (clang, -O2):
<Type_toDouble>:
jmp    1030 <atof@plt>

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

LLVM IR (-O2):
define double @Type_toDouble(i8* nocapture %0) {
%2 = tail call double @atof(i8* %0)
ret double %2
}
double dbl_flt_min1(float a, float b) { return (a < b) ? a : b; }


x86 assembly (clang, -O0):
<dbl_flt_min1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <dbl_flt_min1+0x30>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    113a <dbl_flt_min1+0x3a>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbl_flt_min1>:
minss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @dbl_flt_min1(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 = fcmp olt float %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load float, float* %3
br label %12
10: ; preds = %2
%11 = load float, float* %4
br label %12
12: ; preds = %10, %8
%13 = phi float [ %9, %8 ], [ %11, %10 ]
%14 = fpext float %13 to double
ret double %14
}

LLVM IR (-O2):
define double @dbl_flt_min1(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
%5 = fpext float %4 to double
ret double %5
}
/* Variables and functions */
int _getData(int);
float getAcm(int axis) {
  int in;
  if (axis < 0 || axis > 2)
    axis = 0;
  axis = axis * 2 + 0x32;
  in = _getData(axis);
  if (in < -32768)
    return -99.;
  return in * 0.004 * 9.80665;
}


x86 assembly (clang, -O0):
<getAcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     112f <getAcm+0x1f>
cmpl   $0x2,-0x8(%rbp)
jle    1136 <getAcm+0x26>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
add    $0x32,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <_getData@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffff8000,-0xc(%rbp)
jge    116c <getAcm+0x5c>
movss  0xeae(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1192 <getAcm+0x82>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe7b(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getAcm>:
push   %rax
cmp    $0x3,%edi
lea    0x32(%rdi,%rdi,1),%eax
mov    $0x32,%edi
cmovb  %eax,%edi
call   1030 <_getData@plt>
cmp    $0xffff8000,%eax
jl     1146 <getAcm+0x36>
cvtsi2sd %eax,%xmm0
mulsd  0xec8(%rip),%xmm0
mulsd  0xec8(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret
movss  0xec2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @getAcm(i32 %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7, %1
store i32 0, i32* %3
br label %11
11: ; preds = %10, %7
%12 = load i32, i32* %3
%13 = mul nsw i32 %12, 2
%14 = add nsw i32 %13, 50
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = call i32 @_getData(i32 %15)
store i32 %16, i32* %4
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, -32768
br i1 %18, label %19, label %20
19: ; preds = %11
store float -9.900000e+01, float* %2
br label %26
20: ; preds = %11
%21 = load i32, i32* %4
%22 = sitofp i32 %21 to double
%23 = fmul double %22, 4.000000e-03
%24 = fmul double %23, 0x40239D013A92A305
%25 = fptrunc double %24 to float
store float %25, float* %2
br label %26
26: ; preds = %20, %19
%27 = load float, float* %2
ret float %27
}

LLVM IR (-O2):
define float @getAcm(i32 %0) {
%2 = icmp ugt i32 %0, 2
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, 50
%5 = select i1 %2, i32 50, i32 %4
%6 = tail call i32 @_getData(i32 %5)
%7 = icmp slt i32 %6, -32768
%8 = sitofp i32 %6 to double
%9 = fmul double %8, 4.000000e-03
%10 = fmul double %9, 0x40239D013A92A305
%11 = fptrunc double %10 to float
%12 = select i1 %7, float -9.900000e+01, float %11
ret float %12
}
/* Variables and functions */
bool bc_isspace(int c) {
  return c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' ||
         c == '\v';
}


x86 assembly (clang, -O0):
<bc_isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <bc_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <bc_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <bc_isspace+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <bc_isspace+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <bc_isspace+0x5c>
cmpl   $0xb,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bc_isspace>:
cmp    $0x20,%edi
ja     111d <bc_isspace+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    111d <bc_isspace+0x1d>
ret
xor    %eax,%eax
cmp    $0xb,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bc_isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 12
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 13
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 9
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 11
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @bc_isspace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 11
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void PUT_BE32(uint8_t *a, uint32_t val) {
  a[0] = (val >> 24) & 0xff;
  a[1] = (val >> 16) & 0xff;
  a[2] = (val >> 8) & 0xff;
  a[3] = val & 0xff;
}


x86 assembly (clang, -O0):
<PUT_BE32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PUT_BE32>:
mov    %esi,%eax
mov    %esi,%ecx
movzbl %ah,%edx
movzbl %al,%esi
shr    $0x18,%eax
mov    %eax,(%rdi)
shr    $0x10,%ecx
movzbl %cl,%eax
mov    %eax,0x4(%rdi)
mov    %edx,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @PUT_BE32(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 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %4
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = and i32 %20, 255
%22 = load i32*, i32** %3
%23 = getelementptr inbounds i32, i32* %22, i64 3
store i32 %21, i32* %23
ret void
}

LLVM IR (-O2):
define void @PUT_BE32(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
store i32 %3, i32* %0
%4 = lshr i32 %1, 16
%5 = and i32 %4, 255
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = lshr i32 %1, 8
%8 = and i32 %7, 255
%9 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %8, i32* %9
%10 = and i32 %1, 255
%11 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %10, i32* %11
ret void
}
int isDelimiter(char c) {
  if (c == '%' || c == '@' || c == ',' || c == '\0') {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<isDelimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x25,%eax
je     113e <isDelimiter+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x40,%eax
je     113e <isDelimiter+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x2c,%eax
je     113e <isDelimiter+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    114a <isDelimiter+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <isDelimiter+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDelimiter>:
mov    $0x1,%eax
lea    -0x25(%rdi),%ecx
cmp    $0x1b,%cl
ja     111b <isDelimiter+0x1b>
movzbl %cl,%ecx
mov    $0x8000081,%edx
bt     %rcx,%rdx
jb     1120 <isDelimiter+0x20>
test   %dil,%dil
jne    1121 <isDelimiter+0x21>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isDelimiter(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 37
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 64
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 44
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %2
br label %21
20: ; preds = %15
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @isDelimiter(i8 signext %0) {
switch i8 %0, label %2 [
i8 64, label %3
i8 44, label %3
i8 37, label %3
i8 0, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
char *strcpy(char *dest, const char *src) {
  int i;
  for (i = 0; src[i]; i++)
    *(dest + i) = *(src + i);
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1149 <strcpy+0x49>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy+0x13>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <strcpy+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
getline(line, cnt) char line[];
int cnt;
{
  register char *lp;
  register c, cc;
  lp = line;
  cc = cnt;
  while ((c = getchar()) > 0) {
    *lp++ = c;
    if (--cc <= 0 || c == '\n')
      break;
  }
  return (cnt - cc);
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jle    117c <getline+0x6c>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jle    1172 <getline+0x62>
cmpl   $0xa,-0x1c(%rbp)
jne    1177 <getline+0x67>
jmp    117c <getline+0x6c>
jmp    112d <getline+0x1d>
mov    -0xc(%rbp),%eax
sub    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
test   %eax,%eax
jle    1142 <getline+0x32>
mov    %al,(%rbx)
lea    -0x1(%rbp),%ecx
cmp    $0x2,%ebp
jl     1144 <getline+0x34>
add    $0x1,%rbx
mov    %ecx,%ebp
cmp    $0xa,%eax
jne    1120 <getline+0x10>
jmp    1144 <getline+0x34>
mov    %ebp,%ecx
sub    %ecx,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getline(i8* nocapture writeonly %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %10, %8 ]
%5 = phi i32 [ %1, %2 ], [ %11, %8 ]
%6 = tail call i32 (...) @getchar()
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %3
%9 = trunc i32 %6 to i8
%10 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %9, i8* %4
%11 = add nsw i32 %5, -1
%12 = icmp slt i32 %5, 2
%13 = icmp eq i32 %6, 10
%14 = or i1 %12, %13
br i1 %14, label %15, label %3
15: ; preds = %8, %3
%16 = phi i32 [ %11, %8 ], [ %5, %3 ]
%17 = sub nsw i32 %1, %16
ret i32 %17
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ greetz(char *);
int main(int argc, char **argv, char **envp) {
  if (argc < 2)
    return EXIT_FAILURE;
  greetz(argv[1]);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1145 <main+0x35>
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <greetz@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    111f <main+0xf>
mov    0x2ec3(%rip),%rax
jmp    112f <main+0x1f>
mov    0x8(%rsi),%rdi
call   1030 <greetz@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %4
br label %18
12: ; preds = %3
%13 = load i8**, i8*** %6
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @greetz(i8* %15)
%17 = load i32, i32* @EXIT_SUCCESS
store i32 %17, i32* %4
br label %18
18: ; preds = %12, %10
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1, i8** nocapture readnone %2) {
%4 = icmp slt i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @greetz(i8* %7)
br label %9
9: ; preds = %3, %5
%10 = phi i32* [ @EXIT_SUCCESS, %5 ], [ @EXIT_FAILURE, %3 ]
%11 = load i32, i32* %10
ret i32 %11
}
int _is_arithop(c)
int c;
{
  switch (c) {
  case '=':
  case '>':
  case '<':
  case '+':
  case '-':
  case '*':
  case '/':
  case '%':
  case '!':
  case '(':
  case ')':
  case '&':
  case '|':
  case '^':
  case '~':
    return 1;
  case '?':
  case ':':
  case ',':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<_is_arithop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffdf,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5d,%eax
ja     1148 <_is_arithop+0x48>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    114f <_is_arithop+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    114f <_is_arithop+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_arithop>:
add    $0xffffffdf,%edi
cmp    $0x5d,%edi
ja     111e <_is_arithop+0x1e>
mov    $0x1,%eax
lea    0xeec(%rip),%rcx
movslq (%rcx,%rdi,4),%rdx
add    %rcx,%rdx
jmp    *%rdx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_is_arithop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 61, label %5
i32 62, label %5
i32 60, label %5
i32 43, label %5
i32 45, label %5
i32 42, label %5
i32 47, label %5
i32 37, label %5
i32 33, label %5
i32 40, label %5
i32 41, label %5
i32 38, label %5
i32 124, label %5
i32 94, label %5
i32 126, label %5
i32 63, label %6
i32 58, label %6
i32 44, label %6
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
6: ; preds = %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @_is_arithop(i32 %0) {
switch i32 %0, label %2 [
i32 61, label %3
i32 62, label %3
i32 60, label %3
i32 43, label %3
i32 45, label %3
i32 42, label %3
i32 47, label %3
i32 37, label %3
i32 33, label %3
i32 40, label %3
i32 41, label %3
i32 38, label %3
i32 124, label %3
i32 94, label %3
i32 126, label %3
i32 63, label %3
i32 58, label %3
i32 44, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ch_mvprintw(int, int, char *);
void Display_Message(int iRow, int iCol, char *sMessage) {
  ch_mvprintw(iRow, iCol, sMessage);
}


x86 assembly (clang, -O0):
<Display_Message>:
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 <ch_mvprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Display_Message>:
jmp    1030 <ch_mvprintw@plt>

LLVM IR (-O0):
define void @Display_Message(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 @ch_mvprintw(i32 %7, i32 %8, i8* %9)
ret void
}

LLVM IR (-O2):
define void @Display_Message(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @ch_mvprintw(i32 %0, i32 %1, i8* %2)
ret void
}
regx0regx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<regx0regx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     114c <regx0regx1+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    1153 <regx0regx1+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regx0regx1>:
movslq %edi,%rdi
movslq %esi,%rax
movsd  (%rcx,%rax,8),%xmm0
xor    %eax,%eax
ucomisd (%rdx,%rdi,8),%xmm0
setae  %al
ret

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

LLVM IR (-O2):
define i32 @regx0regx1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds double, double* %4, i64 %7
%9 = load double, double* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds double, double* %5, i64 %10
%12 = load double, double* %11
%13 = fcmp ole double %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
int my_rand_r(int *seedp) {
  unsigned x = *seedp * 1664525 + 1013904223;
  *seedp = x;
  return (x >> 16) & 0x7fff;
}


x86 assembly (clang, -O0):
<my_rand_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x19660d,(%rax),%eax
add    $0x3c6ef35f,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_rand_r>:
imul   $0x19660d,(%rdi),%eax
add    $0x3c6ef35f,%eax
mov    %eax,(%rdi)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
define i32 @my_rand_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1664525
%7 = add nsw i32 %6, 1013904223
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = load i32*, i32** %2
store i32 %8, i32* %9
%10 = load i32, i32* %3
%11 = lshr i32 %10, 16
%12 = and i32 %11, 32767
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_rand_r(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = mul nsw i32 %2, 1664525
%4 = add nsw i32 %3, 1013904223
store i32 %4, i32* %0
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ dram_node_to_cpu(int /*<<< orphan*/);
int get_accumulated_throttled_time(int /*<<< orphan*/, int, double *);
int get_dram_accumulated_throttled_time(
    uint64_t node, double *accumulated_throttled_time_seconds) {
  uint64_t cpu = dram_node_to_cpu(node);
  return get_accumulated_throttled_time(cpu, 0x61b,
                                        accumulated_throttled_time_seconds);
}


x86 assembly (clang, -O0):
<get_dram_accumulated_throttled_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <dram_node_to_cpu@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x61b,%esi
call   1030 <get_accumulated_throttled_time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_dram_accumulated_throttled_time>:
push   %rbx
mov    %rsi,%rbx
call   1040 <dram_node_to_cpu@plt>
mov    %eax,%edi
mov    $0x61b,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <get_accumulated_throttled_time@plt>

LLVM IR (-O0):
define i32 @get_dram_accumulated_throttled_time(i32 %0, double* %1) {
%3 = alloca i32
%4 = alloca double*
%5 = alloca i32
store i32 %0, i32* %3
store double* %1, double** %4
%6 = load i32, i32* %3
%7 = call i32 @dram_node_to_cpu(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load double*, double** %4
%10 = call i32 @get_accumulated_throttled_time(i32 %8, i32 1563, double* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @get_dram_accumulated_throttled_time(i32 %0, double* %1) {
%3 = tail call i32 @dram_node_to_cpu(i32 %0)
%4 = tail call i32 @get_accumulated_throttled_time(i32 %3, i32 1563, double* %1)
ret i32 %4
}
int stbi__bitcount(unsigned int a) {
  a = (a & 0x55555555) + ((a >> 1) & 0x55555555);
  a = (a & 0x33333333) + ((a >> 2) & 0x33333333);
  a = (a + (a >> 4)) & 0x0f0f0f0f;
  a = (a + (a >> 8));
  a = (a + (a >> 16));
  return a & 0xff;
}


x86 assembly (clang, -O0):
<stbi__bitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
add    %ecx,%eax
and    $0xf0f0f0f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbi__bitcount>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %eax,%edi
mov    %edi,%eax
shr    $0x4,%eax
add    %edi,%eax
and    $0xf0f0f0f,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x10,%eax
add    %ecx,%eax
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @stbi__bitcount(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = load i32, i32* %2
%17 = lshr i32 %16, 4
%18 = add i32 %15, %17
%19 = and i32 %18, 252645135
store i32 %19, i32* %2
%20 = load i32, i32* %2
%21 = load i32, i32* %2
%22 = lshr i32 %21, 8
%23 = add i32 %20, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = load i32, i32* %2
%26 = lshr i32 %25, 16
%27 = add i32 %24, %26
store i32 %27, i32* %2
%28 = load i32, i32* %2
%29 = and i32 %28, 255
ret i32 %29
}

LLVM IR (-O2):
define i32 @stbi__bitcount(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = lshr i32 %9, 4
%11 = add nuw nsw i32 %10, %9
%12 = and i32 %11, 252645135
%13 = lshr i32 %12, 8
%14 = add nuw nsw i32 %13, %12
%15 = lshr i32 %14, 16
%16 = add nuw nsw i32 %15, %14
%17 = and i32 %16, 63
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ rand_array_init();
int /*<<< orphan*/ rand_buf_init(void *, int);
void buf_init(void *buf, int size) {
  rand_array_init();
  rand_buf_init(buf, size);
}


x86 assembly (clang, -O0):
<buf_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1040 <rand_array_init@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <rand_buf_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<buf_init>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <rand_array_init@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <rand_buf_init@plt>

LLVM IR (-O0):
define void @buf_init(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand_array_init()
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @rand_buf_init(i8* %6, i32 %7)
ret void
}

LLVM IR (-O2):
define void @buf_init(i8* %0, i32 %1) {
%3 = tail call i32 (...) @rand_array_init()
%4 = tail call i32 @rand_buf_init(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
__attribute__((no)) void free_mem(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<free_mem>:
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):
<free_mem>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_mem(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int bitXor(int x, int y) { return ~(~(~(x & y) & x) & ~(~(x & y) & y)); }


x86 assembly (clang, -O0):
<bitXor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x4(%rbp),%ecx
and    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
xor    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitXor>:
mov    %esi,%eax
and    %edi,%eax
xor    %eax,%edi
xor    %esi,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @bitXor(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 = and i32 %5, %6
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %8, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = and i32 %12, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %4
%17 = and i32 %15, %16
%18 = xor i32 %17, -1
%19 = and i32 %11, %18
%20 = xor i32 %19, -1
ret i32 %20
}

LLVM IR (-O2):
define i32 @bitXor(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = xor i32 %3, %0
%5 = xor i32 %3, %1
%6 = or i32 %4, %5
ret i32 %6
}
long years_to_days(unsigned yr) {
  return yr * 365L + yr / 4 - yr / 100 + yr / 400;
}


x86 assembly (clang, -O0):
<years_to_days>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   $0x16d,%rax,%rax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<years_to_days>:
mov    %edi,%eax
imul   $0x16d,%rax,%rcx
shr    $0x2,%edi
add    %rdi,%rcx
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x25,%rdx
sub    %rdx,%rcx
shr    $0x27,%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @years_to_days(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul nsw i64 %4, 365
%6 = load i32, i32* %2
%7 = udiv i32 %6, 4
%8 = zext i32 %7 to i64
%9 = add nsw i64 %5, %8
%10 = load i32, i32* %2
%11 = udiv i32 %10, 100
%12 = zext i32 %11 to i64
%13 = sub nsw i64 %9, %12
%14 = load i32, i32* %2
%15 = udiv i32 %14, 400
%16 = zext i32 %15 to i64
%17 = add nsw i64 %13, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @years_to_days(i32 %0) {
%2 = zext i32 %0 to i64
%3 = mul nuw nsw i64 %2, 365
%4 = lshr i32 %0, 2
%5 = zext i32 %4 to i64
%6 = add nuw nsw i64 %3, %5
%7 = udiv i32 %0, 100
%8 = zext i32 %7 to i64
%9 = sub nsw i64 %6, %8
%10 = udiv i32 %0, 400
%11 = zext i32 %10 to i64
%12 = add nsw i64 %9, %11
ret i64 %12
}
void foo116(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo116(i32 %0) {
ret void
}
float fadd(float a_firstValue, float a_secondValue) {
  float a_resultValue = a_firstValue + a_secondValue;
  return a_resultValue;
}


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

x86 assembly (clang, -O2):
<fadd>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @fadd(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ step_hash(int);
short func_1(void) {
  unsigned l_2 = 0UL;
  step_hash(1);
  return l_2;
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <step_hash@plt>
mov    -0x4(%rbp),%eax
cwtl
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @func_1() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @step_hash(i32 1)
%3 = load i32, i32* %1
%4 = trunc i32 %3 to i16
ret i16 %4
}

LLVM IR (-O2):
define signext i16 @func_1() {
%1 = tail call i32 @step_hash(i32 1)
ret i16 0
}
int stack_max() { return 100; }


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

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

LLVM IR (-O0):
define i32 @stack_max() {
ret i32 100
}

LLVM IR (-O2):
define i32 @stack_max() {
ret i32 100
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void target_reset(void) { send_command(0x20); }


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

x86 assembly (clang, -O2):
<target_reset>:
mov    $0x20,%edi
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @target_reset() {
%1 = call i32 @send_command(i32 32)
ret void
}

LLVM IR (-O2):
define void @target_reset() {
%1 = tail call i32 @send_command(i32 32)
ret void
}