xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t b4_BE_to_uint32(const uint8_t *b) {
  uint32_t value = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];
  return value;
}


x86 assembly (clang, -O0):
<b4_BE_to_uint32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
or     0xc(%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b4_BE_to_uint32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @b4_BE_to_uint32(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = shl i32 %10, 16
%12 = or i32 %7, %11
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 2
%15 = load i32, i32* %14
%16 = shl i32 %15, 8
%17 = or i32 %12, %16
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 3
%20 = load i32, i32* %19
%21 = or i32 %17, %20
store i32 %21, i32* %3
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @b4_BE_to_uint32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 24
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = or i32 %6, %3
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = shl i32 %9, 8
%11 = or i32 %7, %10
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = or i32 %11, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *realloc_or_die(void *ptr, size_t size) {
  void *m = realloc(ptr, size);
  if (m == NULL) {
    free(ptr);
    die("Not enough memory.");
  }
  return m;
}


x86 assembly (clang, -O0):
<realloc_or_die>:
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   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1171 <realloc_or_die+0x41>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xe94(%rip),%rdi
call   1050 <die@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realloc_or_die>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1158 <realloc_or_die+0x28>
mov    %r14,%rdi
call   1030 <free@plt>
lea    0xead(%rip),%rdi
call   1050 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Not enough memory.\00"
define i8* @realloc_or_die(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
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
%14 = call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %11, %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@.str = [19 x i8] c"Not enough memory.\00"
define noalias i8* @realloc_or_die(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @free(i8* %0)
%7 = tail call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %5, %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ abort();
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int xvsnprintf(char *restrict s, size_t n, const char *restrict format,
               va_list arg) {
  int ret = vsnprintf(s, n, format, arg);
  if ((ret < 0) || ((size_t)ret >= n)) {
    abort();
  }
  return ret;
}


x86 assembly (clang, -O0):
<xvsnprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <vsnprintf@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     1166 <xvsnprintf+0x46>
movslq -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     116d <xvsnprintf+0x4d>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xvsnprintf>:
push   %rbx
mov    %rsi,%rbx
call   1040 <vsnprintf@plt>
test   %eax,%eax
js     1137 <xvsnprintf+0x17>
movslq %eax,%rcx
cmp    %rbx,%rcx
jae    1137 <xvsnprintf+0x17>
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @xvsnprintf(i8* noalias %0, i64 %1, i8* noalias %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = call i32 @vsnprintf(i8* %10, i64 %11, i8* %12, i32 %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = icmp slt i32 %15, 0
br i1 %16, label %22, label %17
17: ; preds = %4
%18 = load i32, i32* %9
%19 = sext i32 %18 to i64
%20 = load i64, i64* %6
%21 = icmp uge i64 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %17, %4
%23 = call i32 (...) @abort()
unreachable
24: ; preds = %17
%25 = load i32, i32* %9
ret i32 %25
}

LLVM IR (-O2):
define i32 @xvsnprintf(i8* noalias nocapture %0, i64 %1, i8* noalias nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
%6 = icmp sgt i32 %5, -1
%7 = sext i32 %5 to i64
%8 = icmp ult i64 %7, %1
%9 = and i1 %6, %8
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = tail call i32 (...) @abort()
unreachable
12: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ wczytaj_liczbe_calkowita(int *);
int main() {
  int n, suma = 0;
  int i;
  wczytaj_liczbe_calkowita(&n);
  i = 1;
  while (i <= n) {
    suma += i;
    i++;
  }
  printf("Suma: %d\n", suma);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <wczytaj_liczbe_calkowita@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1169 <main+0x49>
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <main+0x26>
mov    -0xc(%rbp),%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <wczytaj_liczbe_calkowita@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    1148 <main+0x28>
lea    -0x1(%rax),%ecx
lea    -0x2(%rax),%edx
imul   %rcx,%rdx
shr    %rdx
lea    (%rdx,%rax,2),%esi
add    $0xffffffff,%esi
jmp    114a <main+0x2a>
xor    %esi,%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Suma: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%5 = call i32 @wczytaj_liczbe_calkowita(i32* %2)
store i32 1, i32* %4
br label %6
6: ; preds = %10, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %2
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = add nsw i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %6
16: ; preds = %6
%17 = load i32, i32* %3
%18 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [10 x i8] c"Suma: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @wczytaj_liczbe_calkowita(i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %17, label %6
6: ; preds = %0
%7 = shl nuw i32 %4, 1
%8 = add nsw i32 %4, -1
%9 = zext i32 %8 to i33
%10 = add nsw i32 %4, -2
%11 = zext i32 %10 to i33
%12 = mul i33 %9, %11
%13 = lshr i33 %12, 1
%14 = trunc i33 %13 to i32
%15 = add i32 %7, %14
%16 = add i32 %15, -1
br label %17
17: ; preds = %6, %0
%18 = phi i32 [ 0, %0 ], [ %16, %6 ]
%19 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %18)
ret i32 0
}
/* Variables and functions */
char *_trim(char *, char const *, int);
char *rtrim_chars(char *str, const char *rem) { return _trim(str, rem, 2); }


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

x86 assembly (clang, -O2):
<rtrim_chars>:
mov    $0x2,%edx
jmp    1030 <_trim@plt>

LLVM IR (-O0):
define i8* @rtrim_chars(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i8* @_trim(i8* %5, i8* %6, i32 2)
ret i8* %7
}

LLVM IR (-O2):
define i8* @rtrim_chars(i8* %0, i8* %1) {
%3 = tail call i8* @_trim(i8* %0, i8* %1, i32 2)
ret i8* %3
}
int test_imm_5Fint64_midword_reg(long long val) {
  return ((val >> 16) & (0x5F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Fint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x10,%rdx
and    $0x5f,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Fint64_midword_reg>:
test   $0x5f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_5Fint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6225920
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
char *trace_malloc(size_t, char *);
char *trace_strndup(const char *source, size_t len, char *where) {
  char *ptr = trace_malloc(len + 1, where);
  memcpy(ptr, source, len + 1);
  return ptr;
}


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

x86 assembly (clang, -O2):
<trace_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
lea    0x1(%rsi),%r15
mov    %r15,%rdi
mov    %rdx,%rsi
call   1040 <trace_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @trace_strndup(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%8 = load i64, i64* %5
%9 = add i64 %8, 1
%10 = load i8*, i8** %6
%11 = call i8* @trace_malloc(i64 %9, i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i8*, i8** %4
%14 = load i64, i64* %5
%15 = add i64 %14, 1
%16 = call i32 @memcpy(i8* %12, i8* %13, i64 %15)
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
define i8* @trace_strndup(i8* %0, i64 %1, i8* %2) {
%4 = add i64 %1, 1
%5 = tail call i8* @trace_malloc(i64 %4, i8* %2)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ SystemAlarmsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void SystemAlarmsRequestUpdate() { UAVObjRequestUpdate(SystemAlarmsHandle()); }


x86 assembly (clang, -O0):
<SystemAlarmsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SystemAlarmsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SystemAlarmsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <SystemAlarmsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @SystemAlarmsRequestUpdate() {
%1 = call i32 (...) @SystemAlarmsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SystemAlarmsRequestUpdate() {
%1 = tail call i32 (...) @SystemAlarmsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
double vlength(double *);
int /*<<< orphan*/ vscale(double *, double);
void vnormal(double *v) { vscale(v, 1.0 / vlength(v)); }


x86 assembly (clang, -O0):
<vnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <vlength@plt>
mov    -0x10(%rbp),%rdi
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <vscale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vnormal>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vlength@plt>
movsd  0xecf(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    %rbx,%rdi
movapd %xmm1,%xmm0
pop    %rbx
jmp    1040 <vscale@plt>

LLVM IR (-O0):
define void @vnormal(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double*, double** %2
%5 = call double @vlength(double* %4)
%6 = fdiv double 1.000000e+00, %5
%7 = call i32 @vscale(double* %3, double %6)
ret void
}

LLVM IR (-O2):
define void @vnormal(double* %0) {
%2 = tail call double @vlength(double* %0)
%3 = fdiv double 1.000000e+00, %2
%4 = tail call i32 @vscale(double* %0, double %3)
ret void
}
/* Variables and functions */
int ExprConvert(int, int);
int /*<<< orphan*/ PCWrite(int);
int /*<<< orphan*/ PCWriteWord(int);
void PCWrite24(int val) {
  val = ExprConvert(24, val);
  PCWrite(val);
  PCWriteWord(val >> 8);
}


x86 assembly (clang, -O0):
<PCWrite24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x18,%edi
call   1030 <ExprConvert@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <PCWrite@plt>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1040 <PCWriteWord@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PCWrite24>:
push   %rbx
mov    %edi,%esi
mov    $0x18,%edi
call   1030 <ExprConvert@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <PCWrite@plt>
sar    $0x8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <PCWriteWord@plt>

LLVM IR (-O0):
define void @PCWrite24(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ExprConvert(i32 24, i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @PCWrite(i32 %5)
%7 = load i32, i32* %2
%8 = ashr i32 %7, 8
%9 = call i32 @PCWriteWord(i32 %8)
ret void
}

LLVM IR (-O2):
define void @PCWrite24(i32 %0) {
%2 = tail call i32 @ExprConvert(i32 24, i32 %0)
%3 = tail call i32 @PCWrite(i32 %2)
%4 = ashr i32 %2, 8
%5 = tail call i32 @PCWriteWord(i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_DUPFD;
int fcntl(int, int /*<<< orphan*/, int);
int fcntl_dupfd(int fd, int arg) { return fcntl(fd, F_DUPFD, arg); }


x86 assembly (clang, -O0):
<fcntl_dupfd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcntl_dupfd>:
mov    %esi,%edx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_DUPFD = global i32 0
define i32 @fcntl_dupfd(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* @F_DUPFD
%7 = load i32, i32* %4
%8 = call i32 @fcntl(i32 %5, i32 %6, i32 %7)
ret i32 %8
}

LLVM IR (-O2):
@F_DUPFD = global i32 0
define i32 @fcntl_dupfd(i32 %0, i32 %1) {
%3 = load i32, i32* @F_DUPFD
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ rp_fatal(char const *);
void sysErr(char const *str) { rp_fatal(str); }


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

x86 assembly (clang, -O2):
<sysErr>:
jmp    1030 <rp_fatal@plt>

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

LLVM IR (-O2):
define void @sysErr(i8* %0) {
%2 = tail call i32 @rp_fatal(i8* %0)
ret void
}
/* Type definitions */
struct lt_trace {
  int dummy;
};

/* Variables and functions */
int lt_emit_u8(struct lt_trace *, char);
int lt_emit_string(struct lt_trace *lt, char *value) {
  int rc = 1;
  do {
    rc &= lt_emit_u8(lt, *value);
  } while (*(value++));
  return (rc);
}


x86 assembly (clang, -O0):
<lt_emit_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <lt_emit_u8@plt>
and    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
cmpb   $0x0,(%rax)
jne    1127 <lt_emit_string+0x17>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_emit_string>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x1,%ebp
nop
movsbl (%rbx),%esi
mov    %r14,%rdi
call   1030 <lt_emit_u8@plt>
and    %eax,%ebp
cmpb   $0x0,(%rbx)
lea    0x1(%rbx),%rbx
jne    1120 <lt_emit_string+0x10>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.lt_trace = type { i32 }
define i32 @lt_emit_string(%struct.lt_trace* %0, i8* %1) {
%3 = alloca %struct.lt_trace*
%4 = alloca i8*
%5 = alloca i32
store %struct.lt_trace* %0, %struct.lt_trace** %3
store i8* %1, i8** %4
store i32 1, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load %struct.lt_trace*, %struct.lt_trace** %3
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = call i32 @lt_emit_u8(%struct.lt_trace* %7, i8 signext %9)
%11 = load i32, i32* %5
%12 = and i32 %11, %10
store i32 %12, i32* %5
br label %13
13: ; preds = %6
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %4
%16 = load i8, i8* %14
%17 = icmp ne i8 %16, 0
br i1 %17, label %6, label %18
18: ; preds = %13
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
%struct.lt_trace = type { i32 }
define i32 @lt_emit_string(%struct.lt_trace* %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = phi i32 [ 1, %2 ], [ %8, %3 ]
%6 = load i8, i8* %4
%7 = tail call i32 @lt_emit_u8(%struct.lt_trace* %0, i8 signext %6)
%8 = and i32 %7, %5
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = load i8, i8* %4
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i32 %8
}
int search(int *nums, int numsSize, int target) {
  for (int i = 0; i < numsSize; ++i) {
    if (nums[i] == target)
      return i;
  }
  return -1;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <search+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <search+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <search+0x5a>
jmp    1145 <search+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <search+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <search+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <search+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <search+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
/* Variables and functions */
int jsonp_isnint(char const *, int);
int jsonp_isint(const char *s) { return jsonp_isnint(s, 4096); }


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

x86 assembly (clang, -O2):
<jsonp_isint>:
mov    $0x1000,%esi
jmp    1030 <jsonp_isnint@plt>

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

LLVM IR (-O2):
define i32 @jsonp_isint(i8* %0) {
%2 = tail call i32 @jsonp_isnint(i8* %0, i32 4096)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ osaf_abort(int);
int pthread_mutex_unlock(int /*<<< orphan*/ *);
void osaf_mutex_unlock_ordie(pthread_mutex_t *io_mutex) {
  int result = pthread_mutex_unlock(io_mutex);
  if (result != 0)
    osaf_abort(result);
}


x86 assembly (clang, -O0):
<osaf_mutex_unlock_ordie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pthread_mutex_unlock@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114a <osaf_mutex_unlock_ordie+0x2a>
mov    -0xc(%rbp),%edi
call   1040 <osaf_abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<osaf_mutex_unlock_ordie>:
push   %rax
call   1030 <pthread_mutex_unlock@plt>
test   %eax,%eax
je     1132 <osaf_mutex_unlock_ordie+0x12>
mov    %eax,%edi
pop    %rax
jmp    1040 <osaf_abort@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @osaf_mutex_unlock_ordie(i32* %0) {
%2 = tail call i32 @pthread_mutex_unlock(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @osaf_abort(i32 %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _clear_error_stack();
unsigned int _get_dbg_level();
unsigned int get_dbg_level(void) {
  { _clear_error_stack(); };
  return (_get_dbg_level());
}


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

x86 assembly (clang, -O2):
<get_dbg_level>:
push   %rax
xor    %eax,%eax
call   1030 <_clear_error_stack@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <_get_dbg_level@plt>

LLVM IR (-O0):
define i32 @get_dbg_level() {
%1 = call i32 (...) @_clear_error_stack()
%2 = call i32 (...) @_get_dbg_level()
ret i32 %2
}

LLVM IR (-O2):
define i32 @get_dbg_level() {
%1 = tail call i32 (...) @_clear_error_stack()
%2 = tail call i32 (...) @_get_dbg_level()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, double, double,
                           double, double);
void writeEntry(FILE *log, char *type, double oldX, double oldY, double newX,
                double newY) {
  fprintf(log, "%4s (%7.3f,%7.3f)-(%7.3f,%7.3f)\n", type, oldX, oldY, newX,
          newY);
}


x86 assembly (clang, -O0):
<writeEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
lea    0xea9(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeEntry>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%4s (%7.3f,%7.3f)-(%7.3f,%7.3f)\0A\00"
define void @writeEntry(i32* %0, i8* %1, double %2, double %3, double %4, double %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32* %0, i32** %7
store i8* %1, i8** %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = load double, double* %9
%16 = load double, double* %10
%17 = load double, double* %11
%18 = load double, double* %12
%19 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %14, double %15, double %16, double %17, double %18)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%4s (%7.3f,%7.3f)-(%7.3f,%7.3f)\0A\00"
define void @writeEntry(i32* nocapture %0, i8* %1, double %2, double %3, double %4, double %5) {
%7 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, double %2, double %3, double %4, double %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ tag_enable(int);
int /*<<< orphan*/ tag_read_sessionreg(int, char *);
int tag_get_ns_reg(void) {
  char regdata = 0;
  tag_enable(1);
  if (!tag_read_sessionreg(6, &regdata)) {
    regdata = 0xFF;
  }
  tag_enable(0);
  return regdata;
}


x86 assembly (clang, -O0):
<tag_get_ns_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <tag_enable@plt>
mov    $0x6,%edi
lea    -0x1(%rbp),%rsi
call   1040 <tag_read_sessionreg@plt>
cmp    $0x0,%eax
jne    1151 <tag_get_ns_reg+0x31>
movb   $0xff,-0x1(%rbp)
xor    %edi,%edi
call   1030 <tag_enable@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_get_ns_reg>:
push   %rax
movb   $0x0,0x7(%rsp)
mov    $0x1,%edi
call   1030 <tag_enable@plt>
lea    0x7(%rsp),%rsi
mov    $0x6,%edi
call   1040 <tag_read_sessionreg@plt>
test   %eax,%eax
jne    1148 <tag_get_ns_reg+0x28>
movb   $0xff,0x7(%rsp)
xor    %edi,%edi
call   1030 <tag_enable@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tag_get_ns_reg() {
%1 = alloca i8
store i8 0, i8* %1
%2 = tail call i32 @tag_enable(i32 1)
%3 = call i32 @tag_read_sessionreg(i32 6, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i8 -1, i8* %1
br label %6
6: ; preds = %5, %0
%7 = call i32 @tag_enable(i32 0)
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ motif_init();
int /*<<< orphan*/ motifaux_init();
int /*<<< orphan*/ x_init();
int /*<<< orphan*/ xaux_init();
int /*<<< orphan*/ xtaux_init();
pi_init() {
  x_init();
  xaux_init();
  xtaux_init();
  motif_init();
  motifaux_init();
}


x86 assembly (clang, -O0):
<pi_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <x_init@plt>
mov    $0x0,%al
call   1040 <xaux_init@plt>
mov    $0x0,%al
call   1050 <xtaux_init@plt>
mov    $0x0,%al
call   1030 <motif_init@plt>
mov    $0x0,%al
call   1070 <motifaux_init@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi_init>:
push   %rax
xor    %eax,%eax
call   1060 <x_init@plt>
xor    %eax,%eax
call   1040 <xaux_init@plt>
xor    %eax,%eax
call   1050 <xtaux_init@plt>
xor    %eax,%eax
call   1030 <motif_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <motifaux_init@plt>

LLVM IR (-O0):
define i32 @pi_init() {
%1 = alloca i32
%2 = call i32 (...) @x_init()
%3 = call i32 (...) @xaux_init()
%4 = call i32 (...) @xtaux_init()
%5 = call i32 (...) @motif_init()
%6 = call i32 (...) @motifaux_init()
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @pi_init() {
%1 = tail call i32 (...) @x_init()
%2 = tail call i32 (...) @xaux_init()
%3 = tail call i32 (...) @xtaux_init()
%4 = tail call i32 (...) @motif_init()
%5 = tail call i32 (...) @motifaux_init()
ret i32 undef
}
int test_imm_A7int16_reg(short val) {
  return ((val) & (-0xA7 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A7int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff59,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A7int16_reg>:
test   $0xff59,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A7int16_reg(i16 signext %0) {
%2 = and i16 %0, -167
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
unsigned long int dec_bin(unsigned long int n) {
  unsigned long int rem = 0;
  unsigned long int i = 1;
  unsigned long int binary = 0;
  while (n != 0) {
    rem = n % 2;
    n /= 2;
    binary += rem * i;
    i *= 10;
  }
  return binary;
}


x86 assembly (clang, -O0):
<dec_bin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1162 <dec_bin+0x62>
mov    -0x8(%rbp),%rax
and    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <dec_bin+0x20>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dec_bin>:
test   %rdi,%rdi
je     1130 <dec_bin+0x30>
mov    $0x1,%ecx
xor    %eax,%eax
mov    %rdi,%rdx
nop
mov    %edi,%esi
and    $0x1,%esi
shr    %rdx
imul   %rcx,%rsi
add    %rsi,%rax
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
cmp    $0x1,%rdi
mov    %rdx,%rdi
ja     1110 <dec_bin+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @dec_bin(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
store i64 1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %9, %1
%7 = load i64, i64* %2
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load i64, i64* %2
%11 = urem i64 %10, 2
store i64 %11, i64* %3
%12 = load i64, i64* %2
%13 = udiv i64 %12, 2
store i64 %13, i64* %2
%14 = load i64, i64* %3
%15 = load i64, i64* %4
%16 = mul i64 %14, %15
%17 = load i64, i64* %5
%18 = add i64 %17, %16
store i64 %18, i64* %5
%19 = load i64, i64* %4
%20 = mul i64 %19, 10
store i64 %20, i64* %4
br label %6
21: ; preds = %6
%22 = load i64, i64* %5
ret i64 %22
}

LLVM IR (-O2):
define i64 @dec_bin(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %10, %3 ], [ 0, %1 ]
%5 = phi i64 [ %11, %3 ], [ 1, %1 ]
%6 = phi i64 [ %8, %3 ], [ %0, %1 ]
%7 = and i64 %6, 1
%8 = lshr i64 %6, 1
%9 = mul nuw nsw i64 %7, %5
%10 = add i64 %4, %9
%11 = mul i64 %5, 10
%12 = icmp ult i64 %6, 2
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i64 [ 0, %1 ], [ %10, %3 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
void OGSleep(int is) { sleep(is); }


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

x86 assembly (clang, -O2):
<OGSleep>:
jmp    1030 <sleep@plt>

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

LLVM IR (-O2):
define void @OGSleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
int skip_atoi_c(const char **s) {
  int i, c;
  const char *p_str = *s;
  for (i = 0; '0' <= (c = *p_str) && c <= '9'; ++p_str)
    i = i * 10 + c - '0';
  *s = p_str;
  return i;
}


x86 assembly (clang, -O0):
<skip_atoi_c>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%edx
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
mov    $0x30,%ecx
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
jg     1140 <skip_atoi_c+0x40>
cmpl   $0x39,-0x10(%rbp)
setle  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1150 <skip_atoi_c+0x50>
jmp    116e <skip_atoi_c+0x6e>
imul   $0xa,-0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111a <skip_atoi_c+0x1a>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_atoi_c>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
lea    -0x30(%rdx),%esi
xor    %eax,%eax
cmp    $0x9,%sil
ja     113d <skip_atoi_c+0x3d>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %dl,%edx
lea    (%rax,%rax,4),%eax
lea    (%rdx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl 0x1(%rcx),%edx
add    $0x1,%rcx
lea    -0x30(%rdx),%esi
cmp    $0xa,%sil
jb     1120 <skip_atoi_c+0x20>
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @skip_atoi_c(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = add i8 %3, -48
%5 = icmp ult i8 %4, 10
br i1 %5, label %6, label %18
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %3, %1 ]
%8 = phi i8* [ %14, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = zext i8 %7 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = getelementptr inbounds i8, i8* %8, i64 1
%15 = load i8, i8* %14
%16 = add i8 %15, -48
%17 = icmp ult i8 %16, 10
br i1 %17, label %6, label %18
18: ; preds = %6, %1
%19 = phi i32 [ 0, %1 ], [ %13, %6 ]
%20 = phi i8* [ %2, %1 ], [ %14, %6 ]
store i8* %20, i8** %0
ret i32 %19
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int umask(int /*<<< orphan*/);
int octave_umask_wrapper(mode_t mode) { return umask(mode); }


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

x86 assembly (clang, -O2):
<octave_umask_wrapper>:
jmp    1030 <umask@plt>

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

LLVM IR (-O2):
define i32 @octave_umask_wrapper(i32 %0) {
%2 = tail call i32 @umask(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ read_archive(int, int, char **, char, int);
void extract(int index, int argc, char **argv, int verbose) {
  read_archive(index, argc, argv, 'x', verbose);
}


x86 assembly (clang, -O0):
<extract>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%r8d
mov    $0x78,%ecx
call   1030 <read_archive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract>:
mov    %ecx,%r8d
mov    $0x78,%ecx
jmp    1030 <read_archive@plt>

LLVM IR (-O0):
define void @extract(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i8**, i8*** %7
%12 = load i32, i32* %8
%13 = call i32 @read_archive(i32 %9, i32 %10, i8** %11, i8 signext 120, i32 %12)
ret void
}

LLVM IR (-O2):
define void @extract(i32 %0, i32 %1, i8** %2, i32 %3) {
%5 = tail call i32 @read_archive(i32 %0, i32 %1, i8** %2, i8 signext 120, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void logger_info(char *msg) { printf("INFO - %s\n", msg); }


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

x86 assembly (clang, -O2):
<logger_info>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"INFO - %s\0A\00"
define void @logger_info(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int ls_cost_nm7_n_out(void) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @ls_cost_nm7_n_out() {
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ setup_parent(char *, int, char **);
int main(int argc, char *argv[]) { setup_parent("shm-sync", argc, argv); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
call   1030 <setup_parent@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"shm-sync\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setup_parent(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0, i8** %1)
ret i32 0
}
int XUngrabPointer() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @XUngrabPointer() {
ret i32 0
}
int biosig_blockwrite_physical_samples(int handle, double *buf) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @biosig_blockwrite_physical_samples(i32 %0, double* nocapture readnone %1) {
ret i32 -1
}
/* Type definitions */
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
};

/* Variables and functions */
int connect(int, int /*<<< orphan*/, int /*<<< orphan*/);
int sockutil_cfg_conn(int sock, struct addrinfo *arp) {
  return connect(sock, arp->ai_addr, arp->ai_addrlen);
}


x86 assembly (clang, -O0):
<sockutil_cfg_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1030 <connect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockutil_cfg_conn>:
mov    (%rsi),%edx
mov    0x4(%rsi),%esi
jmp    1030 <connect@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32 }
define i32 @sockutil_cfg_conn(i32 %0, %struct.addrinfo* %1) {
%3 = alloca i32
%4 = alloca %struct.addrinfo*
store i32 %0, i32* %3
store %struct.addrinfo* %1, %struct.addrinfo** %4
%5 = load i32, i32* %3
%6 = load %struct.addrinfo*, %struct.addrinfo** %4
%7 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.addrinfo*, %struct.addrinfo** %4
%10 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @connect(i32 %5, i32 %8, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32 }
define i32 @sockutil_cfg_conn(i32 %0, %struct.addrinfo* nocapture %1) {
%3 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %1, i64 0, i32 1
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @connect(i32 %0, i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *copy_str(const char *old) {
  char *str;
  if (old == NULL)
    return NULL;
  str = malloc(strlen(old) + 1);
  strcpy(str, old);
  return str;
}


x86 assembly (clang, -O0):
<copy_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <copy_str+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1182 <copy_str+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_str>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     115a <copy_str+0x2a>
mov    %rdi,%rbx
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
jmp    115d <copy_str+0x2d>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copy_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %17
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %10, 1
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %8, %7
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @copy_str(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = add nsw i64 %4, 1
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @strcpy(i8* %6, i8* %0)
br label %8
8: ; preds = %1, %3
%9 = phi i8* [ %6, %3 ], [ null, %1 ]
ret i8* %9
}
int _gnix_notifier_init(struct gnix_mr_notifier *mrn) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.gnix_mr_notifier = type opaque
define i32 @_gnix_notifier_init(%struct.gnix_mr_notifier* nocapture readnone %0) {
ret i32 0
}