xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int semget(int /*<<< orphan*/, int /*<<< orphan*/, int);
void opensem(int *sid, key_t key) {
  if ((*sid = semget(key, 0, 0666)) == -1) {
    printf("Semaphore set does not exist!\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<opensem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
xor    %esi,%esi
mov    $0x1b6,%edx
call   1030 <semget@plt>
mov    -0x8(%rbp),%rcx
mov    %eax,(%rcx)
cmp    $0xffffffff,%eax
jne    1173 <opensem+0x43>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opensem>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
xor    %esi,%esi
mov    $0x1b6,%edx
call   1030 <semget@plt>
mov    %eax,(%rbx)
cmp    $0xffffffff,%eax
je     114b <opensem+0x1b>
pop    %rbx
ret
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Semaphore set does not exist!\0A\00"
define void @opensem(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 = call i32 @semget(i32 %5, i32 0, i32 438)
%7 = load i32*, i32** %3
store i32 %6, i32* %7
%8 = icmp eq i32 %6, -1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@str = [30 x i8] c"Semaphore set does not exist!\00"
define void @opensem(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @semget(i32 %1, i32 0, i32 438)
store i32 %3, i32* %0
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
ret void
}
int minimo(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<minimo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <minimo+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <minimo+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimo>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @minimo(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
float exp2f(float);
float __ocl_native_exp2_float(float src) { return exp2f(src); }


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

x86 assembly (clang, -O2):
<__ocl_native_exp2_float>:
jmp    1030 <exp2f@plt>

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

LLVM IR (-O2):
define float @__ocl_native_exp2_float(float %0) {
%2 = tail call float @exp2f(float %0)
ret float %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmaprequest_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xmaprequest.send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xmaprequest_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmaprequest_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmaprequest_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void test_init(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<test_init>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_init() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_init() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Variables and functions */
int cmToIn(float);
float mToIn(float m) { return cmToIn(m * 100) / 100; }


x86 assembly (clang, -O0):
<mToIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
call   1030 <cmToIn@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mToIn>:
push   %rax
mulss  0xee7(%rip),%xmm0
call   1030 <cmToIn@plt>
cltq
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x25,%rax
add    %ecx,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mToIn(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 1.000000e+02
%5 = call i32 @cmToIn(float %4)
%6 = sdiv i32 %5, 100
%7 = sitofp i32 %6 to float
ret float %7
}

LLVM IR (-O2):
define float @mToIn(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = tail call i32 @cmToIn(float %2)
%4 = sdiv i32 %3, 100
%5 = sitofp i32 %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void uninstall_sigfpe_handler(void) { signal(SIGFPE, SIG_DFL); }


x86 assembly (clang, -O0):
<uninstall_sigfpe_handler>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninstall_sigfpe_handler>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
jmp    1030 <signal@plt>

LLVM IR (-O0):
@SIGFPE = global i32 0
@SIG_DFL = global i32 0
define void @uninstall_sigfpe_handler() {
%1 = load i32, i32* @SIGFPE
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@SIGFPE = global i32 0
@SIG_DFL = global i32 0
define void @uninstall_sigfpe_handler() {
%1 = load i32, i32* @SIGFPE
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void encode_u32(uint8_t *p, uint32_t v) {
  p[3] = v & 0xff;
  v >>= 8;
  p[2] = v & 0xff;
  v >>= 8;
  p[1] = v & 0xff;
  v >>= 8;
  p[0] = v & 0xff;
}


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

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

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

LLVM IR (-O2):
define void @encode_u32(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %3, i32* %4
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %9, i32* %10
%11 = lshr i32 %1, 24
store i32 %11, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ serial_read();
int serial_getchar(FILE *stream) { return (int)serial_read(); }


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

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

LLVM IR (-O0):
define i32 @serial_getchar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i64 (...) @serial_read()
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @serial_getchar(i32* nocapture readnone %0) {
%2 = tail call i64 (...) @serial_read()
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
char tolower(char);
char *lower(char *s) {
  char *ptr = s;
  while ((*ptr = tolower(*ptr)) != 0)
    ptr++;
  return s;
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    -0x10(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1153 <lower+0x43>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <lower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <lower+0x10>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @lower(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %12, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call signext i8 @tolower(i8 signext %7)
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = sext i8 %8 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %5
15: ; preds = %5
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
define i8* @lower(i8* returned %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call signext i8 @tolower(i8 signext %4)
store i8 %5, i8* %3
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xea() {
  Assert_real((islower(234) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              1175, ("islower should be 0 for 0xea"));
}


x86 assembly (clang, -O0):
<t_islower_0xea>:
push   %rbp
mov    %rsp,%rbp
mov    $0xea,%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x497,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_islower_0xea>:
push   %rax
mov    $0xea,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x497,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xea\00"
define void @t_islower_0xea() {
%1 = call i64 @islower(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xea\00"
define void @t_islower_0xea() {
%1 = tail call i64 @islower(i32 234)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void tosMemory_pokeChar(int base, int offs, char value) {
  *((char *)(base + offs)) = value;
}


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

x86 assembly (clang, -O2):
<tosMemory_pokeChar>:
movslq %esi,%rax
movslq %edi,%rcx
mov    %dl,(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @tosMemory_pokeChar(i32 %0, i32 %1, i8 signext %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 i8, i8* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = add nsw i32 %8, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8 %7, i8* %12
ret void
}

LLVM IR (-O2):
define void @tosMemory_pokeChar(i32 %0, i32 %1, i8 signext %2) {
%4 = add nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
store i8 %2, i8* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_8_le(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(double *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_double_le(const uint8_t *src, uint32_t offs,
                                      double *dst) {
  uint64_t tmp = ivory_serialize_unpack_prim_8_le(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_double_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_8_le@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_double_le>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_8_le@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_double_le(i32* %0, i32 %1, double* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store double* %2, double** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_8_le(i32* %11)
store i32 %12, i32* %7
%13 = load double*, double** %6
%14 = call i32 @memcpy(double* %13, i32* %7, i32 8)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_double_le(i32* %0, i32 %1, double* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_8_le(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(double* %2, i32* %4, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dummy(int *);
void unsure(void) {
  int x;
  int z = x;
  dummy(&x);
  int y = x + 1;
}


x86 assembly (clang, -O0):
<unsure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <dummy@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsure>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <dummy@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @unsure() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
store i32 %4, i32* %2
%5 = call i32 @dummy(i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
ret void
}

LLVM IR (-O2):
define void @unsure() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @dummy(i32* %1)
ret void
}
/* Variables and functions */
char *strpbrk(char *, char const *);
char *strim_0(char *str) {
  static const char ws[] = "\b\e\f\n\r\t\v\x9b";
  char *p;
  if ((p = strpbrk(str, ws)))
    *p = 0;
  return str;
}


x86 assembly (clang, -O0):
<strim_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1141 <strim_0+0x31>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strim_0>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strpbrk@plt>
test   %rax,%rax
je     1128 <strim_0+0x18>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@strim_0.ws = internal constant [9 x i8] c"\08\1B\0C\0A\0D\09\0B\9B\00"
define i8* @strim_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strpbrk(i8* %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @strim_0.ws, i64 0, i64 0))
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8 0, i8* %8
br label %9
9: ; preds = %7, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@strim_0.ws = internal constant [9 x i8] c"\08\1B\0C\0A\0D\09\0B\9B\00"
define i8* @strim_0(i8* returned %0) {
%2 = tail call i8* @strpbrk(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @strim_0.ws, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ daemonInotify(int, char **);
int main(int argc, char *argv[]) { daemonInotify(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),%edi
mov    -0x10(%rbp),%rsi
call   1030 <daemonInotify@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 @daemonInotify(i32 %5, i8** %6)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @daemonInotify(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x = __VERIFIER_nondet_int();
  while (x > 0 && x < 100) {
    int old_x = x;
    x = __VERIFIER_nondet_int();
    if (x < 2 * old_x + 10) {
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    1142 <main+0x32>
cmpl   $0x64,-0x8(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1152 <main+0x42>
jmp    1180 <main+0x70>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    $0xa,%ecx
cmp    %ecx,%eax
jge    117b <main+0x6b>
jmp    1180 <main+0x70>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rbx),%eax
cmp    $0x62,%eax
ja     113b <main+0x2b>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
lea    (%rbx,%rbx,1),%ecx
add    $0xa,%ecx
mov    %eax,%ebx
cmp    %ecx,%eax
jge    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 100
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ false, %5 ], [ %10, %8 ]
br i1 %12, label %13, label %23
13: ; preds = %11
%14 = load i32, i32* %2
store i32 %14, i32* %3
%15 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = mul nsw i32 2, %17
%19 = add nsw i32 %18, 10
%20 = icmp slt i32 %16, %19
br i1 %20, label %21, label %22
21: ; preds = %13
br label %23
22: ; preds = %13
br label %5
23: ; preds = %21, %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
br label %2
2: ; preds = %6, %0
%3 = phi i32 [ %1, %0 ], [ %7, %6 ]
%4 = add i32 %3, -1
%5 = icmp ult i32 %4, 99
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = tail call i32 (...) @__VERIFIER_nondet_int()
%8 = shl nuw nsw i32 %3, 1
%9 = add nuw nsw i32 %8, 10
%10 = icmp slt i32 %7, %9
br i1 %10, label %11, label %2
11: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
void *malloc(size_t const);
void *__AllocateMemory(const size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<__AllocateMemory>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @__AllocateMemory(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
char *exec(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *get_mpd() {
  static char ret[250] = {0};
  static char *res = NULL;
  res = exec("mpc current -f \"[%{F##808080}\ue61a title%{F##FFFFFF} %title% "
             "%{F##808080}artist %{F##FFFFFF}%artist%[ %{F##808080}album "
             "%{F##FFFFFF}%album%] %{F##808080}]\"");
  strcpy(ret, res);
  free(res);
  return ret;
}


x86 assembly (clang, -O0):
<get_mpd>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1050 <exec@plt>
mov    %rax,0x3009(%rip)
mov    0x3002(%rip),%rsi
lea    0x2efb(%rip),%rdi
call   1040 <strcpy@plt>
mov    0x2fef(%rip),%rdi
call   1030 <free@plt>
lea    0x2ee3(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mpd>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <exec@plt>
mov    %rax,0x300c(%rip)
lea    0x2f05(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
mov    0x2ff3(%rip),%rdi
call   1030 <free@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@get_mpd.ret = internal global [250 x i8] zeroinitializer
@get_mpd.res = internal global i8* null
@.str = [154 x i8] c"mpc current -f \22[%{F#}\EE\98\9A title%{F##FFFFFF} %title% %{F#}artist %{F##FFFFFF}%artist%[ %{F#}album %{F##FFFFFF}%album%] %{F#}]\22\00"
define i8* @get_mpd() {
%1 = call i8* @exec(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
store i8* %1, i8** @get_mpd.res
%2 = load i8*, i8** @get_mpd.res
%3 = call i32 @strcpy(i8* getelementptr inbounds ([250 x i8], [250 x i8]* @get_mpd.ret, i64 0, i64 0), i8* %2)
%4 = load i8*, i8** @get_mpd.res
%5 = call i32 @free(i8* %4)
ret i8* getelementptr inbounds ([250 x i8], [250 x i8]* @get_mpd.ret, i64 0, i64 0)
}

LLVM IR (-O2):
@get_mpd.ret = internal global [250 x i8] zeroinitializer
@get_mpd.res = internal unnamed_addr global i8* null
@.str = [154 x i8] c"mpc current -f \22[%{F#}\EE\98\9A title%{F##FFFFFF} %title% %{F#}artist %{F##FFFFFF}%artist%[ %{F#}album %{F##FFFFFF}%album%] %{F#}]\22\00"
define i8* @get_mpd() {
%1 = tail call i8* @exec(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
store i8* %1, i8** @get_mpd.res
%2 = tail call i32 @strcpy(i8* getelementptr inbounds ([250 x i8], [250 x i8]* @get_mpd.ret, i64 0, i64 0), i8* %1)
%3 = load i8*, i8** @get_mpd.res
%4 = tail call i32 @free(i8* %3)
ret i8* getelementptr inbounds ([250 x i8], [250 x i8]* @get_mpd.ret, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncmp(char const *, char const *, int /*<<< orphan*/);
int string_begins_with(const char *buf, const char *start) {
  return !strncmp(buf, start, strlen(start));
}


x86 assembly (clang, -O0):
<string_begins_with>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_begins_with>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @string_begins_with(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @string_begins_with(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ X509_SIG;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_PKCS8;
scalar_t__ i2d_X509_SIG;
int PEM_write_bio_PKCS8(BIO *bp, X509_SIG *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_SIG, PEM_STRING_PKCS8, bp,
                            x, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_PKCS8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%rdi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_PKCS8>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_X509_SIG = global i64 0
@PEM_STRING_PKCS8 = global i32 0
define i32 @PEM_write_bio_PKCS8(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_X509_SIG
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_PKCS8
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_X509_SIG = global i64 0
@PEM_STRING_PKCS8 = global i32 0
define i32 @PEM_write_bio_PKCS8(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_X509_SIG
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_PKCS8
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
int findProcessTableEntry(int segment) { return (segment / 0x1000) - 2; }


x86 assembly (clang, -O0):
<findProcessTableEntry>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1000,%ecx
cltd
idiv   %ecx
sub    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findProcessTableEntry>:
lea    0xfff(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0xc,%eax
add    $0xfffffffe,%eax
ret

LLVM IR (-O0):
define i32 @findProcessTableEntry(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 4096
%5 = sub nsw i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @findProcessTableEntry(i32 %0) {
%2 = sdiv i32 %0, 4096
%3 = add nsw i32 %2, -2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ c_printch(char, int);
void printch(char c) { c_printch(c, 0x0F); }


x86 assembly (clang, -O0):
<printch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xf,%esi
movsbl -0x1(%rbp),%edi
call   1030 <c_printch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printch>:
mov    $0xf,%esi
jmp    1030 <c_printch@plt>

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

LLVM IR (-O2):
define void @printch(i8 signext %0) {
%2 = tail call i32 @c_printch(i8 signext %0, i32 15)
ret void
}
__attribute__((no)) int no_stack_frame(void) {
  char buffer[100];
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @no_stack_frame() {
%1 = alloca [100 x i8]
ret i32 0
}

LLVM IR (-O2):
define i32 @no_stack_frame() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  printf("0 || 0 = %d\n", 0 || 0);
  printf("0 || 1 = %d\n", 0 || 1);
  printf("1 || 0 = %d\n", 1 || 0);
  printf("1 || 1 = %d\n", 1 || 1);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"0 || 0 = %d\0A\00"
@.str.1 = [13 x i8] c"0 || 1 = %d\0A\00"
@.str.2 = [13 x i8] c"1 || 0 = %d\0A\00"
@.str.3 = [13 x i8] c"1 || 1 = %d\0A\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"0 || 0 = %d\0A\00"
@.str.1 = [13 x i8] c"0 || 1 = %d\0A\00"
@.str.2 = [13 x i8] c"1 || 0 = %d\0A\00"
@.str.3 = [13 x i8] c"1 || 1 = %d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret void
}
/* Type definitions */
struct r_list {
  int dummy;
};
struct r_link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ r_link_del(struct r_link *);
int /*<<< orphan*/ r_list_add(struct r_list *, struct r_link *);
void r_list_move(struct r_list *list, struct r_link *link) {
  do {
    ;
  } while (0);
  r_link_del(link);
  r_list_add(list, link);
  do {
    ;
  } while (0);
}


x86 assembly (clang, -O0):
<r_list_move>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
jmp    1135 <r_list_move+0x15>
mov    -0x10(%rbp),%rdi
call   1040 <r_link_del@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <r_list_add@plt>
jmp    1150 <r_list_move+0x30>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_list_move>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <r_link_del@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <r_list_add@plt>

LLVM IR (-O0):
%struct.r_list = type { i32 }
%struct.r_link = type { i32 }
define void @r_list_move(%struct.r_list* %0, %struct.r_link* %1) {
%3 = alloca %struct.r_list*
%4 = alloca %struct.r_link*
store %struct.r_list* %0, %struct.r_list** %3
store %struct.r_link* %1, %struct.r_link** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load %struct.r_link*, %struct.r_link** %4
%8 = call i32 @r_link_del(%struct.r_link* %7)
%9 = load %struct.r_list*, %struct.r_list** %3
%10 = load %struct.r_link*, %struct.r_link** %4
%11 = call i32 @r_list_add(%struct.r_list* %9, %struct.r_link* %10)
br label %12
12: ; preds = %6
br label %13
13: ; preds = %12
ret void
}

LLVM IR (-O2):
%struct.r_list = type { i32 }
%struct.r_link = type { i32 }
define void @r_list_move(%struct.r_list* %0, %struct.r_link* %1) {
%3 = tail call i32 @r_link_del(%struct.r_link* %1)
%4 = tail call i32 @r_list_add(%struct.r_list* %0, %struct.r_link* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int test3(int i) { bar(); }


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

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

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

LLVM IR (-O2):
define i32 @test3(i32 %0) {
%2 = tail call i32 (...) @bar()
ret i32 undef
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int timediff(struct timeval *large, struct timeval *small) {
  return (((large->tv_sec * 1000 * 1000) + large->tv_usec) -
          ((small->tv_sec * 1000 * 1000) + small->tv_usec));
}


x86 assembly (clang, -O0):
<timediff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3e8,(%rax),%eax
imul   $0x3e8,%eax,%eax
mov    -0x8(%rbp),%rcx
add    0x4(%rcx),%eax
mov    -0x10(%rbp),%rcx
imul   $0x3e8,(%rcx),%ecx
imul   $0x3e8,%ecx,%ecx
mov    -0x10(%rbp),%rdx
add    0x4(%rdx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timediff>:
mov    (%rdi),%ecx
mov    0x4(%rdi),%eax
sub    (%rsi),%ecx
imul   $0xf4240,%ecx,%ecx
sub    0x4(%rsi),%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @timediff(%struct.timeval* %0, %struct.timeval* %1) {
%3 = alloca %struct.timeval*
%4 = alloca %struct.timeval*
store %struct.timeval* %0, %struct.timeval** %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load %struct.timeval*, %struct.timeval** %3
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = mul nsw i32 %8, 1000
%10 = load %struct.timeval*, %struct.timeval** %3
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = add nsw i32 %9, %12
%14 = load %struct.timeval*, %struct.timeval** %4
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = mul nsw i32 %16, 1000
%18 = mul nsw i32 %17, 1000
%19 = load %struct.timeval*, %struct.timeval** %4
%20 = getelementptr inbounds %struct.timeval, %struct.timeval* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = add nsw i32 %18, %21
%23 = sub nsw i32 %13, %22
ret i32 %23
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @timediff(%struct.timeval* nocapture %0, %struct.timeval* nocapture %1) {
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sub i32 %4, %8
%12 = mul i32 %11, 1000000
%13 = sub i32 %6, %10
%14 = add i32 %13, %12
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ g_writeln(char *);
int out_params(void) {
  g_writeln("");
  g_writeln("xrdp rsa key gen utility examples");
  g_writeln("  xrdp-keygen xrdp ['path and file name' | auto]");
  g_writeln("  xrdp-keygen test");
  g_writeln("");
  return 0;
}


x86 assembly (clang, -O0):
<out_params>:
push   %rbp
mov    %rsp,%rbp
lea    0xf37(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xed9(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xeef(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xf14(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xf07(%rip),%rdi
call   1030 <g_writeln@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_params>:
push   %rbx
lea    0xf3a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <g_writeln@plt>
lea    0xed9(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xeef(%rip),%rdi
call   1030 <g_writeln@plt>
lea    0xf14(%rip),%rdi
call   1030 <g_writeln@plt>
mov    %rbx,%rdi
call   1030 <g_writeln@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"xrdp rsa key gen utility examples\00"
@.str.2 = [49 x i8] c" xrdp-keygen xrdp ['path and file name' | auto]\00"
@.str.3 = [19 x i8] c" xrdp-keygen test\00"
define i32 @out_params() {
%1 = call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @g_writeln(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @g_writeln(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @g_writeln(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [34 x i8] c"xrdp rsa key gen utility examples\00"
@.str.2 = [49 x i8] c" xrdp-keygen xrdp ['path and file name' | auto]\00"
@.str.3 = [19 x i8] c" xrdp-keygen test\00"
define i32 @out_params() {
%1 = tail call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @g_writeln(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @g_writeln(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @g_writeln(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @g_writeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
double julian_increment_hours_double(double julian, double hours) {
  double julian_increment;
  julian_increment = hours / 24.0;
  return julian + julian_increment;
}


x86 assembly (clang, -O0):
<julian_increment_hours_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xee5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_increment_hours_double>:
divsd  0xef8(%rip),%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @julian_increment_hours_double(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = fdiv double %6, 2.400000e+01
store double %7, double* %5
%8 = load double, double* %3
%9 = load double, double* %5
%10 = fadd double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @julian_increment_hours_double(double %0, double %1) {
%3 = fdiv double %1, 2.400000e+01
%4 = fadd double %3, %0
ret double %4
}
/* Variables and functions */
scalar_t__ Fork();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 1;
  if (Fork() == 0)
    printf("printf1: x=%d\n", ++x);
  printf("printf2: x=%d\n", --x);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Fork@plt>
cmp    $0x0,%rax
jne    116c <main+0x3c>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    %esi,-0x8(%rbp)
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%esi
add    $0xffffffff,%esi
mov    %esi,-0x8(%rbp)
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <Fork@plt>
test   %rax,%rax
jne    1155 <main+0x25>
lea    0xeba(%rip),%rdi
mov    $0x2,%esi
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"printf1: x=%d\0A\00"
@.str.1 = [15 x i8] c"printf2: x=%d\0A\00"
define i32 @main() {
%1 = tail call i64 (...) @Fork()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 2)
br label %5
5: ; preds = %3, %0
%6 = phi i32 [ 1, %3 ], [ 0, %0 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ print_hex(unsigned long);
int /*<<< orphan*/ print_string(char *);
void print_address(const void *a) {
  print_string("0x");
  print_hex((unsigned long)a);
}


x86 assembly (clang, -O0):
<print_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <print_string@plt>
mov    -0x8(%rbp),%rdi
call   1040 <print_hex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_address>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <print_string@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <print_hex@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"0x\00"
define void @print_address(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = call i32 @print_hex(i64 %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"0x\00"
define void @print_address(i8* %0) {
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = ptrtoint i8* %0 to i64
%4 = tail call i32 @print_hex(i64 %3)
ret void
}