xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sys_exit(int);
void exit(int exit_code) { sys_exit(exit_code); }


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

x86 assembly (clang, -O2):
<exit>:
push   %rax
call   1030 <sys_exit@plt>

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

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @sys_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *p = malloc(sizeof(int));
  int x;
  int i;
  if (i == 4711)
    p = &x;
  free(p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x1267,-0x18(%rbp)
jne    1152 <main+0x32>
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32* @malloc(i32 4)
store i32* %5, i32** %2
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 4711
br i1 %7, label %8, label %9
8: ; preds = %0
store i32* %3, i32** %2
br label %9
9: ; preds = %8, %0
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @free(i32* %1)
ret i32 0
}
void init_led(void) {
  (*(volatile unsigned long *)0x56000050) &=
      ~((3 << (4 * 2)) | (3 << (5 * 2)) | (3 << (6 * 2)));
  (*(volatile unsigned long *)0x56000050) |=
      (1 << (4 * 2)) | (1 << (5 * 2)) | (1 << (6 * 2));
}


x86 assembly (clang, -O0):
<init_led>:
push   %rbp
mov    %rsp,%rbp
mov    $0x56000050,%eax
mov    (%rax),%rcx
and    $0xffffffffffffc0ff,%rcx
mov    $0x56000050,%eax
mov    %rcx,(%rax)
mov    $0x56000050,%eax
mov    (%rax),%rcx
or     $0x1500,%rcx
mov    $0x56000050,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_led>:
andq   $0xffffffffffffc0ff,0x56000050
56 ff c0 ff ff
orq    $0x1500,0x56000050
ret

LLVM IR (-O0):
define void @init_led() {
%1 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%2 = and i64 %1, -16129
store volatile i64 %2, i64* inttoptr (i64 1442840656 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%4 = or i64 %3, 5376
store volatile i64 %4, i64* inttoptr (i64 1442840656 to i64*)
ret void
}

LLVM IR (-O2):
define void @init_led() {
%1 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%2 = and i64 %1, -16129
store volatile i64 %2, i64* inttoptr (i64 1442840656 to i64*)
%3 = load volatile i64, i64* inttoptr (i64 1442840656 to i64*)
%4 = or i64 %3, 5376
store volatile i64 %4, i64* inttoptr (i64 1442840656 to i64*)
ret void
}
void ECRYPT_init(void *arg1, void *arg2, void *arg3, void *arg4, void *arg5) {
  return;
}


x86 assembly (clang, -O0):
<ECRYPT_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @ECRYPT_init(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @ECRYPT_init(i8* nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
int parse_multiplier(const char *s_multiplier) {
  switch (s_multiplier[0]) {
  case 'b':
    return 1;
  case 'k':
    return 1024;
  case 'm':
    return 1048576;
  case 'g':
    return 1073741824;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<parse_multiplier>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0xb,%eax
ja     1165 <parse_multiplier+0x65>
mov    -0x18(%rbp),%rax
lea    0xed4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    116c <parse_multiplier+0x6c>
movl   $0x400,-0x4(%rbp)
jmp    116c <parse_multiplier+0x6c>
movl   $0x100000,-0x4(%rbp)
jmp    116c <parse_multiplier+0x6c>
movl   $0x40000000,-0x4(%rbp)
jmp    116c <parse_multiplier+0x6c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_multiplier>:
movsbl (%rdi),%ecx
add    $0xffffff9e,%ecx
cmp    $0xb,%ecx
ja     1126 <parse_multiplier+0x26>
mov    $0x1,%eax
lea    0xee9(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    $0x40000000,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x400,%eax
ret
mov    $0x100000,%eax
ret

LLVM IR (-O0):
define i32 @parse_multiplier(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %12 [
i32 98, label %8
i32 107, label %9
i32 109, label %10
i32 103, label %11
]
8: ; preds = %1
store i32 1, i32* %2
br label %13
9: ; preds = %1
store i32 1024, i32* %2
br label %13
10: ; preds = %1
store i32 1048576, i32* %2
br label %13
11: ; preds = %1
store i32 1073741824, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @parse_multiplier(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
switch i32 %3, label %7 [
i32 98, label %8
i32 107, label %4
i32 109, label %5
i32 103, label %6
]
4: ; preds = %1
br label %8
5: ; preds = %1
br label %8
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %1, %7, %6, %5, %4
%9 = phi i32 [ -1, %7 ], [ 1073741824, %6 ], [ 1048576, %5 ], [ 1024, %4 ], [ 1, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int uint64_t;
struct buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ put32be(struct buffer *, int);
void put64be(struct buffer *input, uint64_t val) {
  put32be(input, val >> 32);
  put32be(input, val);
}


x86 assembly (clang, -O0):
<put64be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x20,%ecx
sar    %cl,%esi
call   1030 <put32be@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <put32be@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put64be>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <put32be@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <put32be@plt>

LLVM IR (-O0):
%struct.buffer = type { i32 }
define void @put64be(%struct.buffer* %0, i32 %1) {
%3 = alloca %struct.buffer*
%4 = alloca i32
store %struct.buffer* %0, %struct.buffer** %3
store i32 %1, i32* %4
%5 = load %struct.buffer*, %struct.buffer** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 32
%8 = call i32 @put32be(%struct.buffer* %5, i32 %7)
%9 = load %struct.buffer*, %struct.buffer** %3
%10 = load i32, i32* %4
%11 = call i32 @put32be(%struct.buffer* %9, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.buffer = type { i32 }
define void @put64be(%struct.buffer* %0, i32 %1) {
%3 = tail call i32 @put32be(%struct.buffer* %0, i32 poison)
%4 = tail call i32 @put32be(%struct.buffer* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ twoDsim_processEvent();
void process_event(void) { twoDsim_processEvent(); }


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

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

LLVM IR (-O0):
define void @process_event() {
%1 = call i32 (...) @twoDsim_processEvent()
ret void
}

LLVM IR (-O2):
define void @process_event() {
%1 = tail call i32 (...) @twoDsim_processEvent()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int chdir(char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ report_test2(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                int /*<<< orphan*/, char *);
void chdir_empty(void) {
  int rv;
  rv = chdir("");
  report_test2(rv, errno, EINVAL, 0, "chdir to empty string");
}


x86 assembly (clang, -O0):
<chdir_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee6(%rip),%rdi
call   1040 <chdir@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
mov    0x2e8e(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
lea    0xeab(%rip),%r8
call   1030 <report_test2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chdir_empty>:
push   %rax
lea    0xeed(%rip),%rdi
call   1040 <chdir@plt>
mov    0x2eac(%rip),%rcx
mov    (%rcx),%esi
mov    0x2e9b(%rip),%rcx
mov    (%rcx),%edx
lea    0xeba(%rip),%r8
mov    %eax,%edi
xor    %ecx,%ecx
pop    %rax
jmp    1030 <report_test2@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@errno = global i32 0
@EINVAL = global i32 0
@.str.1 = [22 x i8] c"chdir to empty string\00"
define void @chdir_empty() {
%1 = alloca i32
%2 = call i32 @chdir(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = load i32, i32* @errno
%5 = load i32, i32* @EINVAL
%6 = call i32 @report_test2(i32 %3, i32 %4, i32 %5, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@errno = global i32 0
@EINVAL = global i32 0
@.str.1 = [22 x i8] c"chdir to empty string\00"
define void @chdir_empty() {
%1 = tail call i32 @chdir(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = load i32, i32* @EINVAL
%4 = tail call i32 @report_test2(i32 %1, i32 %2, i32 %3, i32 0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void display_date_time() { return; }


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

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

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

LLVM IR (-O2):
define void @display_date_time() {
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ filename_size(char *, int, struct tm const *);
void filename_size_day(char *buf, int level, const struct tm *ts) {
  filename_size(buf, level, ts);
}


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

x86 assembly (clang, -O2):
<filename_size_day>:
jmp    1030 <filename_size@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @filename_size_day(i8* %0, i32 %1, %struct.tm* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca %struct.tm*
store i8* %0, i8** %4
store i32 %1, i32* %5
store %struct.tm* %2, %struct.tm** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load %struct.tm*, %struct.tm** %6
%10 = call i32 @filename_size(i8* %7, i32 %8, %struct.tm* %9)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @filename_size_day(i8* %0, i32 %1, %struct.tm* %2) {
%4 = tail call i32 @filename_size(i8* %0, i32 %1, %struct.tm* %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long subwindow;
};
typedef TYPE_1__ XButtonPressedEvent;

/* Variables and functions */
void set_XButtonPressedEvent_subwindow(void *_p, unsigned long _v) {
  ((XButtonPressedEvent *)_p)->subwindow = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XButtonPressedEvent_subwindow>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XButtonPressedEvent_subwindow(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int int16_t;

/* Variables and functions */
uint32_t bitCount_fun_int16_t(int16_t x) {
  uint32_t r = x & 1;
  for (x = x >> 1 & 0x7fff; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0x7fff,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <bitCount_fun_int16_t+0x42>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111e <bitCount_fun_int16_t+0x1e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_int16_t>:
mov    %edi,%eax
and    $0x1,%eax
shr    %edi
and    $0x7fff,%edi
je     1130 <bitCount_fun_int16_t+0x30>
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %edi,%edx
and    $0x1,%edx
add    %edx,%eax
shr    %ecx
cmp    $0x1,%edi
mov    %ecx,%edi
ja     1120 <bitCount_fun_int16_t+0x20>
ret

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

LLVM IR (-O2):
define i32 @bitCount_fun_int16_t(i32 %0) {
%2 = and i32 %0, 1
%3 = lshr i32 %0, 1
%4 = and i32 %3, 32767
%5 = icmp eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1, %6
%7 = phi i32 [ %10, %6 ], [ %2, %1 ]
%8 = phi i32 [ %11, %6 ], [ %4, %1 ]
%9 = and i32 %8, 1
%10 = add nuw nsw i32 %7, %9
%11 = lshr i32 %8, 1
%12 = icmp ult i32 %8, 2
br i1 %12, label %13, label %6
13: ; preds = %6, %1
%14 = phi i32 [ %2, %1 ], [ %10, %6 ]
ret i32 %14
}
/* Type definitions */
typedef int uint64_t;
struct pcg_state_128 {
  int dummy;
};

/* Variables and functions */
int pcg_oneseq_128_xsh_rs_64_random_r(struct pcg_state_128 *);
uint64_t pcg_oneseq_128_xsh_rs_64_boundedrand_r(struct pcg_state_128 *rng,
                                                uint64_t bound) {
  uint64_t threshold = -bound % bound;
  for (;;) {
    uint64_t r = pcg_oneseq_128_xsh_rs_64_random_r(rng);
    if (r >= threshold)
      return r % bound;
  }
}


x86 assembly (clang, -O0):
<pcg_oneseq_128_xsh_rs_64_boundedrand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pcg_oneseq_128_xsh_rs_64_random_r@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     1152 <pcg_oneseq_128_xsh_rs_64_boundedrand_r+0x42>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret
jmp    112b <pcg_oneseq_128_xsh_rs_64_boundedrand_r+0x1b>

x86 assembly (clang, -O2):
<pcg_oneseq_128_xsh_rs_64_boundedrand_r>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <pcg_oneseq_128_xsh_rs_64_random_r@plt>
test   %eax,%eax
js     1120 <pcg_oneseq_128_xsh_rs_64_boundedrand_r+0x10>
cltd
idiv   %ebp
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_oneseq_128_xsh_rs_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
%3 = alloca %struct.pcg_state_128*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.pcg_state_128* %0, %struct.pcg_state_128** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 0, %7
%9 = load i32, i32* %4
%10 = srem i32 %8, %9
store i32 %10, i32* %5
br label %11
11: ; preds = %21, %2
%12 = load %struct.pcg_state_128*, %struct.pcg_state_128** %3
%13 = call i32 @pcg_oneseq_128_xsh_rs_64_random_r(%struct.pcg_state_128* %12)
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %5
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %11
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = srem i32 %18, %19
ret i32 %20
21: ; preds = %11
br label %11
}

LLVM IR (-O2):
%struct.pcg_state_128 = type { i32 }
define i32 @pcg_oneseq_128_xsh_rs_64_boundedrand_r(%struct.pcg_state_128* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i32 @pcg_oneseq_128_xsh_rs_64_random_r(%struct.pcg_state_128* %0)
%5 = icmp sgt i32 %4, -1
br i1 %5, label %6, label %3
6: ; preds = %3
%7 = srem i32 %4, %1
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
ule() { callrts("ccule"); }


x86 assembly (clang, -O0):
<ule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <callrts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccule\00"
define i32 @ule() {
%1 = alloca i32
%2 = call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccule\00"
define i32 @ule() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long timevalToUll(struct timeval);
unsigned long long getTimeNowUs() {
  struct timeval timeNow;
  gettimeofday(&timeNow, NULL);
  return timevalToUll(timeNow);
}


x86 assembly (clang, -O0):
<getTimeNowUs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
call   1040 <timevalToUll@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTimeNowUs>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <timevalToUll@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i64 @getTimeNowUs() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = call i64 @timevalToUll(i32 %4)
ret i64 %5
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i64 @getTimeNowUs() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i64 @timevalToUll(i32 %5)
ret i64 %6
}
/* Variables and functions */
int momrand_genrand_int32();
double momrand_genrand_res53(void) {
  unsigned long a = momrand_genrand_int32() >> 5,
                b = momrand_genrand_int32() >> 6;
  return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
}


x86 assembly (clang, -O0):
<momrand_genrand_res53>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %al,-0x11(%rbp)
call   1030 <momrand_genrand_int32@plt>
mov    %eax,%ecx
mov    -0x11(%rbp),%al
sar    $0x5,%ecx
movslq %ecx,%rcx
mov    %rcx,-0x8(%rbp)
call   1030 <momrand_genrand_int32@plt>
sar    $0x6,%eax
cltq
mov    %rax,-0x10(%rbp)
movaps 0xeca(%rip),%xmm3
movq   -0x8(%rbp),%xmm0
punpckldq %xmm3,%xmm0
movapd 0xec9(%rip),%xmm2
subpd  %xmm2,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movq   -0x10(%rbp),%xmm1
punpckldq %xmm3,%xmm1
subpd  %xmm2,%xmm1
movaps %xmm1,%xmm2
unpckhpd %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe6a(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<momrand_genrand_res53>:
push   %rbx
xor    %eax,%eax
call   1030 <momrand_genrand_int32@plt>
sar    $0x5,%eax
movslq %eax,%rbx
xor    %eax,%eax
call   1030 <momrand_genrand_int32@plt>
sar    $0x6,%eax
cltq
movq   %rbx,%xmm1
movdqa 0xec9(%rip),%xmm2
punpckldq %xmm2,%xmm1
movapd 0xecd(%rip),%xmm3
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm0
unpckhpd %xmm1,%xmm0
addsd  %xmm1,%xmm0
movq   %rax,%xmm1
punpckldq %xmm2,%xmm1
subpd  %xmm3,%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
mulsd  0xeb0(%rip),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
mulsd  0xea8(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define double @momrand_genrand_res53() {
%1 = alloca i64
%2 = alloca i64
%3 = call i32 (...) @momrand_genrand_int32()
%4 = ashr i32 %3, 5
%5 = sext i32 %4 to i64
store i64 %5, i64* %1
%6 = call i32 (...) @momrand_genrand_int32()
%7 = ashr i32 %6, 6
%8 = sext i32 %7 to i64
store i64 %8, i64* %2
%9 = load i64, i64* %1
%10 = uitofp i64 %9 to double
%11 = load i64, i64* %2
%12 = uitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %10, double 0x4190000000000000, double %12)
%14 = fmul double %13, 0x3CA0000000000000
ret double %14
}

LLVM IR (-O2):
define double @momrand_genrand_res53() {
%1 = tail call i32 (...) @momrand_genrand_int32()
%2 = ashr i32 %1, 5
%3 = sext i32 %2 to i64
%4 = tail call i32 (...) @momrand_genrand_int32()
%5 = ashr i32 %4, 6
%6 = sext i32 %5 to i64
%7 = uitofp i64 %3 to double
%8 = uitofp i64 %6 to double
%9 = tail call double @llvm.fmuladd.f64(double %7, double 0x4190000000000000, double %8)
%10 = fmul double %9, 0x3CA0000000000000
ret double %10
}
const char *zlibVersion() { return "0.95P"; }


x86 assembly (clang, -O0):
<zlibVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zlibVersion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [6 x i8] c"0.95P\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.95P\00"
define i8* @zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int getpid();
int /*<<< orphan*/ printf(char *, char const *, int, int /*<<< orphan*/, int,
                          int /*<<< orphan*/);
int /*<<< orphan*/ pthread_self();
int syscall(int /*<<< orphan*/);
void print_id(const char *str) {
  pid_t pid;
  pthread_t tid;
  int stid;
  pid = getpid();
  tid = pthread_self();
  stid = syscall(SYS_gettid);
  printf("%s - PID: %i - TID(lib): %lu - TID(sys): %lu - (0x%x) \n", str, pid,
         tid, stid, tid);
}


x86 assembly (clang, -O0):
<print_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1060 <pthread_self@plt>
mov    %eax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <syscall@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_id>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <pthread_self@plt>
mov    %eax,%ebx
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
call   1050 <syscall@plt>
lea    0xe92(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
mov    %ebx,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
@.str = [56 x i8] c"%s - PID: %i - TID(lib): %lu - TID(sys): %lu - (0x%x) \0A\00"
define void @print_id(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = call i32 (...) @getpid()
store i32 %6, i32* %3
%7 = call i32 (...) @pthread_self()
store i32 %7, i32* %4
%8 = load i32, i32* @SYS_gettid
%9 = call i32 @syscall(i32 %8)
store i32 %9, i32* %5
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %11, i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
@.str = [56 x i8] c"%s - PID: %i - TID(lib): %lu - TID(sys): %lu - (0x%x) \0A\00"
define void @print_id(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 (...) @pthread_self()
%4 = load i32, i32* @SYS_gettid
%5 = tail call i32 @syscall(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2, i32 %3, i32 %5, i32 %3)
ret void
}
unsigned int res_string2type(const char *type_string) {
  unsigned int type = type_string[0] << 24 | type_string[1] << 16 |
                      type_string[2] << 8 | type_string[3];
  return (type);
}


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

x86 assembly (clang, -O2):
<res_string2type>:
movzbl (%rdi),%eax
shl    $0x18,%eax
movsbl 0x1(%rdi),%ecx
shl    $0x10,%ecx
or     %eax,%ecx
movsbl 0x2(%rdi),%edx
shl    $0x8,%edx
movsbl 0x3(%rdi),%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @res_string2type(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = shl nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int world(int a) {
  if (a > 10)
    return 10;
  else if (a > 5)
    return 5;
  else
    return 0;
}


x86 assembly (clang, -O0):
<world>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jle    111d <world+0x1d>
movl   $0xa,-0x4(%rbp)
jmp    113a <world+0x3a>
cmpl   $0x5,-0x8(%rbp)
jle    1133 <world+0x33>
movl   $0x5,-0x4(%rbp)
jmp    113a <world+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<world>:
xor    %eax,%eax
cmp    $0x6,%edi
setge  %al
cmp    $0xb,%edi
lea    (%rax,%rax,4),%ecx
mov    $0xa,%eax
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @world(i32 %0) {
%2 = icmp sgt i32 %0, 10
%3 = icmp sgt i32 %0, 5
%4 = select i1 %3, i32 5, i32 0
%5 = select i1 %2, i32 10, i32 %4
ret i32 %5
}
int glmMinIndex3f(float a, float b, float c, int i1, int i2, int i3) {
  if (a < b) {
    if (a < c)
      return i1;
    else
      return i3;
  } else {
    if (b < c)
      return i2;
    else
      return i3;
  }
}


x86 assembly (clang, -O0):
<glmMinIndex3f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %esi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1158 <glmMinIndex3f+0x58>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    114d <glmMinIndex3f+0x4d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <glmMinIndex3f+0x7c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <glmMinIndex3f+0x7c>
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1176 <glmMinIndex3f+0x76>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <glmMinIndex3f+0x7c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmMinIndex3f>:
ucomiss %xmm0,%xmm2
cmovbe %edx,%edi
ucomiss %xmm1,%xmm2
mov    %esi,%eax
cmovbe %edx,%eax
ucomiss %xmm0,%xmm1
cmova  %edi,%eax
ret

LLVM IR (-O0):
define i32 @glmMinIndex3f(float %0, float %1, float %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store float %0, float* %8
store float %1, float* %9
store float %2, float* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%14 = load float, float* %8
%15 = load float, float* %9
%16 = fcmp olt float %14, %15
br i1 %16, label %17, label %25
17: ; preds = %6
%18 = load float, float* %8
%19 = load float, float* %10
%20 = fcmp olt float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i32, i32* %11
store i32 %22, i32* %7
br label %33
23: ; preds = %17
%24 = load i32, i32* %13
store i32 %24, i32* %7
br label %33
25: ; preds = %6
%26 = load float, float* %9
%27 = load float, float* %10
%28 = fcmp olt float %26, %27
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = load i32, i32* %12
store i32 %30, i32* %7
br label %33
31: ; preds = %25
%32 = load i32, i32* %13
store i32 %32, i32* %7
br label %33
33: ; preds = %31, %29, %23, %21
%34 = load i32, i32* %7
ret i32 %34
}

LLVM IR (-O2):
define i32 @glmMinIndex3f(float %0, float %1, float %2, i32 %3, i32 %4, i32 %5) {
%7 = fcmp olt float %0, %1
%8 = fcmp olt float %0, %2
%9 = select i1 %8, i32 %3, i32 %5
%10 = fcmp olt float %1, %2
%11 = select i1 %10, i32 %4, i32 %5
%12 = select i1 %7, i32 %9, i32 %11
ret i32 %12
}
/* Type definitions */
struct catmc_atomic_signed_short {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct catmc_atomic_signed_short *);
void catmc_atomic_signed_short_destroy(
    struct catmc_atomic_signed_short *wrapper) {
  free(wrapper);
}


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

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

LLVM IR (-O0):
%struct.catmc_atomic_signed_short = type { i32 }
define void @catmc_atomic_signed_short_destroy(%struct.catmc_atomic_signed_short* %0) {
%2 = alloca %struct.catmc_atomic_signed_short*
store %struct.catmc_atomic_signed_short* %0, %struct.catmc_atomic_signed_short** %2
%3 = load %struct.catmc_atomic_signed_short*, %struct.catmc_atomic_signed_short** %2
%4 = call i32 @free(%struct.catmc_atomic_signed_short* %3)
ret void
}

LLVM IR (-O2):
%struct.catmc_atomic_signed_short = type { i32 }
define void @catmc_atomic_signed_short_destroy(%struct.catmc_atomic_signed_short* nocapture %0) {
%2 = tail call i32 @free(%struct.catmc_atomic_signed_short* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char const *);
int /*<<< orphan*/ unlink(char const *);
void death(const char *msg, FILE *fdesc, const char *fname) {
  printf(msg);
  fclose(fdesc);
  unlink(fname);
  exit(1);
}


x86 assembly (clang, -O0):
<death>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<death>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   1030 <unlink@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
define void @death(i8* nocapture %0, i32* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) %0)
%5 = tail call i32 @fclose(i32* %1)
%6 = tail call i32 @unlink(i8* %2)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x53() {
  Assert_real((isupper(83)),
              "/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_isupper.c",
              420, ("isupper should be 1 for S"));
}


x86 assembly (clang, -O0):
<t_isupper_0x53>:
push   %rbp
mov    %rsp,%rbp
mov    $0x53,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x1a4,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x53>:
push   %rax
mov    $0x53,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x1a4,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for S\00"
define void @t_isupper_0x53() {
%1 = call i32 @isupper(i32 83)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for S\00"
define void @t_isupper_0x53() {
%1 = tail call i32 @isupper(i32 83)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 420, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int aioPoll(int);
int aioSleep(int microSeconds) { return aioPoll(microSeconds); }


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

x86 assembly (clang, -O2):
<aioSleep>:
jmp    1030 <aioPoll@plt>

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

LLVM IR (-O2):
define i32 @aioSleep(i32 %0) {
%2 = tail call i32 @aioPoll(i32 %0)
ret i32 %2
}
int do_e() { return 1; }


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

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

LLVM IR (-O0):
define i32 @do_e() {
ret i32 1
}

LLVM IR (-O2):
define i32 @do_e() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ err_template(int, char *);
void errFork(int n_error) {
  err_template(n_error, "\nFalha ao criar processo filho\n");
}


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

x86 assembly (clang, -O2):
<errFork>:
lea    0xee9(%rip),%rsi
jmp    1030 <err_template@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0AFalha ao criar processo filho\0A\00"
define void @errFork(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @err_template(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"\0AFalha ao criar processo filho\0A\00"
define void @errFork(i32 %0) {
%2 = tail call i32 @err_template(i32 %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ pid_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int daemonize(void) {
  pid_t pid;
  pid = fork();
  if (pid > 0) {
    exit(0);
  }
  if (pid < 0) {
    fprintf(stderr, "fork() failed!\n");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<daemonize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jle    1155 <daemonize+0x25>
xor    %edi,%edi
call   1040 <exit@plt>
cmpq   $0x0,-0x10(%rbp)
jge    1181 <daemonize+0x51>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1188 <daemonize+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daemonize>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jg     115f <daemonize+0x2f>
mov    $0x1,%eax
js     1146 <daemonize+0x16>
pop    %rcx
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"fork() failed!\0A\00"
define i32 @daemonize() {
%1 = alloca i32
%2 = alloca i64
%3 = call i64 (...) @fork()
store i64 %3, i64* %2
%4 = load i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
8: ; preds = %0
%9 = load i64, i64* %2
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %15
14: ; preds = %8
store i32 1, i32* %1
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"fork() failed!\0A\00"
define i32 @daemonize() {
%1 = tail call i64 (...) @fork()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = icmp slt i64 %1, 0
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %5, %7
%11 = phi i32 [ 0, %7 ], [ 1, %5 ]
ret i32 %11
}
imm0adrx1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if (22 <= (((unsigned int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rdx
mov    $0x16,%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
ja     113b <imm0adrx1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <imm0adrx1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adrx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpl   $0x16,0xa98ac7(,%rcx,4)
16
setae  %al
ret

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

LLVM IR (-O2):
define i32 @imm0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp ugt i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ checkAllBusesPrint();
int /*<<< orphan*/ checkAllBusesWright();
int /*<<< orphan*/ iopl(int);
int main() {
  iopl(3);
  checkAllBusesPrint();
  checkAllBusesWright();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
call   1030 <iopl@plt>
xor    %eax,%eax
call   1050 <checkAllBusesPrint@plt>
xor    %eax,%eax
call   1040 <checkAllBusesWright@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @iopl(i32 3)
%2 = tail call i32 (...) @checkAllBusesPrint()
%3 = tail call i32 (...) @checkAllBusesWright()
ret i32 0
}
int f(int s, int c, int i) {
  int a1, a2, a3, x1, x2, x3, x;
  a1 = i * s;
  x1 = c + a1;
  i = i - 2;
  a2 = i * s;
  x2 = c + a2;
  if (x2 > 6)
    i = i - 2;
  i = i - 2;
  a3 = i * s;
  x3 = c + a3;
  x = x1 + x2 + x3;
  return x;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x6,-0x20(%rbp)
jle    114f <f+0x4f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    -0x2(%rdx),%r8d
mov    %r8d,%ecx
imul   %edi,%ecx
add    %esi,%ecx
lea    -0x4(%rdx),%eax
cmp    $0x7,%ecx
cmovl  %r8d,%eax
add    %eax,%edx
add    $0xfffffffe,%edx
imul   %edi,%edx
lea    (%rcx,%rsi,2),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
store i32 %16, i32* %7
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = add nsw i32 %17, %18
store i32 %19, i32* %10
%20 = load i32, i32* %6
%21 = sub nsw i32 %20, 2
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = load i32, i32* %4
%24 = mul nsw i32 %22, %23
store i32 %24, i32* %8
%25 = load i32, i32* %5
%26 = load i32, i32* %8
%27 = add nsw i32 %25, %26
store i32 %27, i32* %11
%28 = load i32, i32* %11
%29 = icmp sgt i32 %28, 6
br i1 %29, label %30, label %33
30: ; preds = %3
%31 = load i32, i32* %6
%32 = sub nsw i32 %31, 2
store i32 %32, i32* %6
br label %33
33: ; preds = %30, %3
%34 = load i32, i32* %6
%35 = sub nsw i32 %34, 2
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = load i32, i32* %4
%38 = mul nsw i32 %36, %37
store i32 %38, i32* %9
%39 = load i32, i32* %5
%40 = load i32, i32* %9
%41 = add nsw i32 %39, %40
store i32 %41, i32* %12
%42 = load i32, i32* %10
%43 = load i32, i32* %11
%44 = add nsw i32 %42, %43
%45 = load i32, i32* %12
%46 = add nsw i32 %44, %45
store i32 %46, i32* %13
%47 = load i32, i32* %13
ret i32 %47
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2) {
%4 = add i32 %2, -2
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %5, %1
%7 = icmp sgt i32 %6, 6
%8 = add nsw i32 %2, -4
%9 = select i1 %7, i32 %8, i32 %4
%10 = shl i32 %1, 1
%11 = add i32 %4, %9
%12 = mul i32 %11, %0
%13 = add i32 %6, %10
%14 = add i32 %13, %12
ret i32 %14
}