xunge/DecIR huggingface dataset:
int main() {
  int i, j;
  int sum = 0;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      sum += 1;
    }
  }
  return sum;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    115e <main+0x5e>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    114b <main+0x4b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <main+0x2a>
jmp    1150 <main+0x50>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 100
}
/* Variables and functions */
char *getValue(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *value;
  value = getValue("INCREMENT");
  printf("El valor es: %s\n", value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <getValue@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <getValue@plt>
lea    0xed6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"INCREMENT\00"
@.str.1 = [17 x i8] c"El valor es: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @getValue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"INCREMENT\00"
@.str.1 = [17 x i8] c"El valor es: %s\0A\00"
define i32 @main() {
%1 = tail call i8* @getValue(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
void dump_IO(char *buffer, int size) {}


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

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

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

LLVM IR (-O2):
define void @dump_IO(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ mtrace();
int /*<<< orphan*/ test_echo_server();
int main() {
  mtrace();
  test_echo_server();
  getchar();
  getchar();
  getchar();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @mtrace()
%3 = call i32 (...) @test_echo_server()
%4 = call i32 (...) @getchar()
%5 = call i32 (...) @getchar()
%6 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mtrace()
%2 = tail call i32 (...) @test_echo_server()
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 (...) @getchar()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int NetLogClose(int log_socket) {
  close(log_socket);
  return 1;
}


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

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

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

LLVM IR (-O2):
define i32 @NetLogClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 1
}
/* Variables and functions */
char *lookup(char *, int, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *des = lookup("../dict/oxford/oxford-gb", 721264, 39429, "book");
  printf("%s", des);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0xb0170,%esi
mov    $0x9a05,%edx
lea    0xed2(%rip),%rcx
call   1040 <lookup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeea(%rip),%rcx
mov    $0xb0170,%esi
mov    $0x9a05,%edx
call   1040 <lookup@plt>
lea    0xed9(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"../dict/oxford/oxford-gb\00"
@.str.1 = [5 x i8] c"book\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @lookup(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 721264, i32 39429, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"../dict/oxford/oxford-gb\00"
@.str.1 = [5 x i8] c"book\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = tail call i8* @lookup(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 721264, i32 39429, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ rlCloseAgentConnection();
int /*<<< orphan*/ rlCloseEnvironmentConnection();
int /*<<< orphan*/ rlCloseExperimentConnection();
void rlDisconnectSystems() {
  rlCloseAgentConnection();
  rlCloseEnvironmentConnection();
  rlCloseExperimentConnection();
}


x86 assembly (clang, -O0):
<rlDisconnectSystems>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <rlCloseAgentConnection@plt>
mov    $0x0,%al
call   1030 <rlCloseEnvironmentConnection@plt>
mov    $0x0,%al
call   1040 <rlCloseExperimentConnection@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlDisconnectSystems>:
push   %rax
xor    %eax,%eax
call   1050 <rlCloseAgentConnection@plt>
xor    %eax,%eax
call   1030 <rlCloseEnvironmentConnection@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <rlCloseExperimentConnection@plt>

LLVM IR (-O0):
define void @rlDisconnectSystems() {
%1 = call i32 (...) @rlCloseAgentConnection()
%2 = call i32 (...) @rlCloseEnvironmentConnection()
%3 = call i32 (...) @rlCloseExperimentConnection()
ret void
}

LLVM IR (-O2):
define void @rlDisconnectSystems() {
%1 = tail call i32 (...) @rlCloseAgentConnection()
%2 = tail call i32 (...) @rlCloseEnvironmentConnection()
%3 = tail call i32 (...) @rlCloseExperimentConnection()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
int socket(int, int, int);
int Socket(int family, int type, int protocol) {
  int n;
  if ((n = socket(family, type, protocol)) < 0) {
    err_sys("socket error");
  }
  return (n);
}


x86 assembly (clang, -O0):
<Socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <socket@plt>
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
jge    1157 <Socket+0x37>
lea    0xeae(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Socket>:
push   %rbx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1138 <Socket+0x18>
lea    0xecd(%rip),%rdi
call   1030 <err_sys@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"socket error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 @socket(i32 %8, i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@.str = [13 x i8] c"socket error\00"
define i32 @Socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @socket(i32 %0, i32 %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @err_sys(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __u64;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ update_hash_half(int /*<<< orphan*/ *, int);
void update_hash_word(__u64 *key, __u32 word) {
  update_hash_half(key, (word >> 16) & 0xffff);
  update_hash_half(key, word & 0xffff);
}


x86 assembly (clang, -O0):
<update_hash_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sar    $0x10,%esi
and    $0xffff,%esi
call   1030 <update_hash_half@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
and    $0xffff,%esi
call   1030 <update_hash_half@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_hash_word>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
shr    $0x10,%esi
call   1030 <update_hash_half@plt>
movzwl %bx,%esi
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <update_hash_half@plt>

LLVM IR (-O0):
define void @update_hash_word(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = ashr i32 %6, 16
%8 = and i32 %7, 65535
%9 = call i32 @update_hash_half(i32* %5, i32 %8)
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = and i32 %11, 65535
%13 = call i32 @update_hash_half(i32* %10, i32 %12)
ret void
}

LLVM IR (-O2):
define void @update_hash_word(i32* %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = tail call i32 @update_hash_half(i32* %0, i32 %3)
%5 = and i32 %1, 65535
%6 = tail call i32 @update_hash_half(i32* %0, i32 %5)
ret void
}
void CFGMR3QueryGCPtrDef(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryGCPtrDef() {
ret void
}
void _native_LED_GREEN_ON(void) {}


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

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

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

LLVM IR (-O2):
define void @_native_LED_GREEN_ON() {
ret void
}
void gtk_text_view_set_justification() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_set_justification() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned Kit_BitMask(int nBits) {
  assert(nBits <= 32);
  return ~((~(unsigned)0) << nBits);
}


x86 assembly (clang, -O0):
<Kit_BitMask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_BitMask>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x21,%ebx
setl   %dil
call   1030 <assert@plt>
mov    $0xffffffff,%eax
mov    %ebx,%ecx
shl    %cl,%eax
not    %eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Kit_BitMask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 32
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = shl i32 -1, %7
%9 = xor i32 %8, -1
ret i32 %9
}

LLVM IR (-O2):
define i32 @Kit_BitMask(i32 %0) {
%2 = icmp slt i32 %0, 33
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = shl nsw i32 -1, %0
%6 = xor i32 %5, -1
ret i32 %6
}
/* Variables and functions */
int PAPI_ipc(float *, float *, long long *, float *);
void PAPIF_IPC(float *rtime, float *ptime, long long *ins, float *ipc,
               int *check) {
  *check = PAPI_ipc(rtime, ptime, ins, ipc);
}


x86 assembly (clang, -O0):
<PAPIF_IPC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_ipc@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PAPIF_IPC>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_ipc@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @PAPIF_IPC(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_ipc(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int /*<<< orphan*/, char *, char *, char *, int);
void gmx_rxs(int nodeid, void *buf, int bufsize) {
  fatal_error(0, "Routine %s called in %s, %d", "gmx_rxs",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/"
              "tests/test_07/network.c",
              164);
}


x86 assembly (clang, -O0):
<gmx_rxs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %edi,%edi
lea    0xed5(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xeeb(%rip),%rcx
mov    $0xa4,%r8d
call   1030 <fatal_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gmx_rxs>:
lea    0xee9(%rip),%rsi
lea    0xefe(%rip),%rdx
lea    0xeff(%rip),%rcx
xor    %edi,%edi
mov    $0xa4,%r8d
jmp    1030 <fatal_error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [8 x i8] c"gmx_rxs\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_rxs(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 164)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Routine %s called in %s, %d\00"
@.str.1 = [8 x i8] c"gmx_rxs\00"
@.str.2 = [148 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chadi-akel/cere/refs/heads/master/tests/test_07/network.c\00"
define void @gmx_rxs(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @fatal_error(i32 0, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([148 x i8], [148 x i8]* @.str.2, i64 0, i64 0), i32 164)
ret void
}
int platform_state_group_gid(const struct platform_state_group *s) {
  return -1;
}


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

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

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

LLVM IR (-O2):
%struct.platform_state_group = type opaque
define i32 @platform_state_group_gid(%struct.platform_state_group* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello, world! From Helllo2\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [28 x i8] c"Hello, world! From Helllo2\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [27 x i8] c"Hello, world! From Helllo2\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int d2eq(void *key1, void *key2) {
  return (((double *)key1)[0] == ((double *)key2)[0]) &&
         (((double *)key1)[1] == ((double *)key2)[1]);
}


x86 assembly (clang, -O0):
<d2eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
ucomisd (%rcx),%xmm0
mov    %al,-0x11(%rbp)
jne    114a <d2eq+0x4a>
jp     114a <d2eq+0x4a>
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd 0x8(%rax),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2eq>:
movsd  (%rdi),%xmm0
ucomisd (%rsi),%xmm0
jne    1120 <d2eq+0x20>
jp     1120 <d2eq+0x20>
movsd  0x8(%rsi),%xmm0
cmpeqsd 0x8(%rdi),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @d2eq(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 = bitcast i8* %5 to double*
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to double*
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = fcmp oeq double %8, %12
br i1 %13, label %14, label %24
14: ; preds = %2
%15 = load i8*, i8** %3
%16 = bitcast i8* %15 to double*
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = load double, double* %17
%19 = load i8*, i8** %4
%20 = bitcast i8* %19 to double*
%21 = getelementptr inbounds double, double* %20, i64 1
%22 = load double, double* %21
%23 = fcmp oeq double %18, %22
br label %24
24: ; preds = %14, %2
%25 = phi i1 [ false, %2 ], [ %23, %14 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @d2eq(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 8
%10 = bitcast i8* %9 to double*
%11 = load double, double* %10
%12 = getelementptr inbounds i8, i8* %1, i64 8
%13 = bitcast i8* %12 to double*
%14 = load double, double* %13
%15 = fcmp oeq double %11, %14
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %8, %2
%18 = phi i32 [ 0, %2 ], [ %16, %8 ]
ret i32 %18
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void EMACTimestampPPSPeriodSet(uint32_t ui32Base, uint32_t ui32Period,
                               uint32_t ui32Width) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000760))) = ui32Period;
  (*((volatile uint32_t *)(ui32Base + 0x00000764))) = ui32Width;
}


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

x86 assembly (clang, -O2):
<EMACTimestampPPSPeriodSet>:
mov    %rsi,0x760(%rdi)
mov    %rdx,0x764(%rdi)
ret

LLVM IR (-O0):
define void @EMACTimestampPPSPeriodSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = add nsw i64 %8, 1888
%10 = inttoptr i64 %9 to i64*
store volatile i64 %7, i64* %10
%11 = load i64, i64* %6
%12 = load i64, i64* %4
%13 = add nsw i64 %12, 1892
%14 = inttoptr i64 %13 to i64*
store volatile i64 %11, i64* %14
ret void
}

LLVM IR (-O2):
define void @EMACTimestampPPSPeriodSet(i64 %0, i64 %1, i64 %2) {
%4 = add nsw i64 %0, 1888
%5 = inttoptr i64 %4 to i64*
store volatile i64 %1, i64* %5
%6 = add nsw i64 %0, 1892
%7 = inttoptr i64 %6 to i64*
store volatile i64 %2, i64* %7
ret void
}
unsigned long ulongFindMaxHex(unsigned short i) {
  unsigned long b;
  for (b = 16; i > 1; i--)
    b *= b;
  return b;
}


x86 assembly (clang, -O0):
<ulongFindMaxHex>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movq   $0x10,-0x10(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x1,%eax
jle    113e <ulongFindMaxHex+0x3e>
mov    -0x10(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x2(%rbp),%ax
add    $0xffff,%ax
mov    %ax,-0x2(%rbp)
jmp    1113 <ulongFindMaxHex+0x13>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulongFindMaxHex>:
mov    $0x10,%eax
cmp    $0x2,%di
jb     116a <ulongFindMaxHex+0x6a>
lea    -0x1(%rdi),%edx
add    $0xfffffffe,%edi
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x7,%di
jae    1123 <ulongFindMaxHex+0x23>
mov    $0x10,%eax
jmp    1156 <ulongFindMaxHex+0x56>
and    $0xfff8,%edx
mov    $0x10,%eax
xchg   %ax,%ax
imul   %rax,%rax
imul   %rax,%rax
imul   %rax,%rax
imul   %rax,%rax
imul   %rax,%rax
imul   %rax,%rax
imul   %rax,%rax
imul   %rax,%rax
add    $0xfff8,%dx
jne    1130 <ulongFindMaxHex+0x30>
test   %cx,%cx
je     116a <ulongFindMaxHex+0x6a>
nopl   0x0(%rax,%rax,1)
imul   %rax,%rax
add    $0xffff,%cx
jne    1160 <ulongFindMaxHex+0x60>
ret

LLVM IR (-O0):
define i64 @ulongFindMaxHex(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i64
store i16 %0, i16* %2
store i64 16, i64* %3
br label %4
4: ; preds = %12, %1
%5 = load i16, i16* %2
%6 = zext i16 %5 to i32
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i64, i64* %3
%10 = load i64, i64* %3
%11 = mul i64 %10, %9
store i64 %11, i64* %3
br label %12
12: ; preds = %8
%13 = load i16, i16* %2
%14 = add i16 %13, -1
store i16 %14, i16* %2
br label %4
15: ; preds = %4
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @ulongFindMaxHex(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 1
br i1 %2, label %3, label %33
3: ; preds = %1
%4 = add i16 %0, -1
%5 = add i16 %0, -2
%6 = and i16 %4, 7
%7 = icmp ult i16 %5, 7
br i1 %7, label %23, label %8
8: ; preds = %3
%9 = and i16 %4, -8
br label %10
10: ; preds = %10, %8
%11 = phi i64 [ 16, %8 ], [ %20, %10 ]
%12 = phi i16 [ 0, %8 ], [ %21, %10 ]
%13 = mul i64 %11, %11
%14 = mul i64 %13, %13
%15 = mul i64 %14, %14
%16 = mul i64 %15, %15
%17 = mul i64 %16, %16
%18 = mul i64 %17, %17
%19 = mul i64 %18, %18
%20 = mul i64 %19, %19
%21 = add i16 %12, 8
%22 = icmp eq i16 %21, %9
br i1 %22, label %23, label %10
23: ; preds = %10, %3
%24 = phi i64 [ undef, %3 ], [ %20, %10 ]
%25 = phi i64 [ 16, %3 ], [ %20, %10 ]
%26 = icmp eq i16 %6, 0
br i1 %26, label %33, label %27
27: ; preds = %23, %27
%28 = phi i64 [ %30, %27 ], [ %25, %23 ]
%29 = phi i16 [ %31, %27 ], [ 0, %23 ]
%30 = mul i64 %28, %28
%31 = add i16 %29, 1
%32 = icmp eq i16 %31, %6
br i1 %32, label %33, label %27
33: ; preds = %23, %27, %1
%34 = phi i64 [ 16, %1 ], [ %24, %23 ], [ %30, %27 ]
ret i64 %34
}
void debug_captured() {
  int x = 10;
#pragma clang __debug captured
  {
    if (x) {
    }
  }
  if (x) {
  }
#pragma clang __debug captured
  {
    for (int i = 0; i < x; ++i) {
    }
    if (x) {
    }
  }
  if (x) {
  }
}


x86 assembly (clang, -O0):
<debug_captured>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1160 <__captured_stmt>
cmpl   $0x0,-0x4(%rbp)
je     112f <debug_captured+0x2f>
jmp    112f <debug_captured+0x2f>
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
call   1180 <__captured_stmt.1>
cmpl   $0x0,-0x4(%rbp)
je     114f <debug_captured+0x4f>
jmp    114f <debug_captured+0x4f>
add    $0x20,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nop

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

LLVM IR (-O0):
%struct.anon = type { i32* }
%struct.anon.0 = type { i32* }
define void @debug_captured() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca %struct.anon.0
store i32 10, i32* %1
%4 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 0
store i32* %1, i32** %4
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %0
%9 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %3, i32 0, i32 0
store i32* %1, i32** %9
%10 = load i32, i32* %1
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
br label %13
13: ; preds = %12, %8
ret void
}
define internal void @__captured_stmt(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 0
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
ret void
}
define internal void @__captured_stmt.1(%struct.anon.0* %0) {
%2 = alloca %struct.anon.0*
%3 = alloca i32
store %struct.anon.0* %0, %struct.anon.0** %2
%4 = load %struct.anon.0*, %struct.anon.0** %2
store i32 0, i32* %3
br label %5
5: ; preds = %12, %1
%6 = load i32, i32* %3
%7 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %4, i32 0, i32 0
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = icmp slt i32 %6, %9
br i1 %10, label %11, label %15
11: ; preds = %5
br label %12
12: ; preds = %11
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %5
15: ; preds = %5
%16 = getelementptr inbounds %struct.anon.0, %struct.anon.0* %4, i32 0, i32 0
%17 = load i32*, i32** %16
%18 = load i32, i32* %17
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
br label %21
21: ; preds = %20, %15
ret void
}

LLVM IR (-O2):
define void @debug_captured() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_volume_from_linear() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_volume_from_linear"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"NOT IMPLEMENTED:pa_sw_volume_from_linear\0A\00"
define i32 @pa_sw_volume_from_linear() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [41 x i8] c"NOT IMPLEMENTED:pa_sw_volume_from_linear\00"
define i32 @pa_sw_volume_from_linear() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void main() {
  int i;
  for (i = 0; i < 5; i = i + 1) {
    foo();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113e <main+0x2e>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = call i32 (...) @foo()
br label %7
7: ; preds = %5
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
store i32 %9, i32* %1
br label %2
10: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @foo()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @foo()
%4 = tail call i32 (...) @foo()
%5 = tail call i32 (...) @foo()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ CPU_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ CPU_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ pthread_setaffinity_np(int /*<<< orphan*/, int,
                                          int /*<<< orphan*/ *);
void set_thread_affinity(pthread_t t, int cpu) {
  cpu_set_t cpuset;
  CPU_ZERO(&cpuset);
  CPU_SET(cpu, &cpuset);
  pthread_setaffinity_np(t, sizeof(cpu_set_t), &cpuset);
}


x86 assembly (clang, -O0):
<set_thread_affinity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <CPU_ZERO@plt>
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1050 <CPU_SET@plt>
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
lea    -0xc(%rbp),%rdx
call   1030 <pthread_setaffinity_np@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_thread_affinity>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <CPU_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <CPU_SET@plt>
mov    %ebp,%edi
mov    $0x4,%esi
mov    %r14,%rdx
call   1030 <pthread_setaffinity_np@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @set_thread_affinity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 @CPU_ZERO(i32* %5)
%7 = load i32, i32* %4
%8 = call i32 @CPU_SET(i32 %7, i32* %5)
%9 = load i32, i32* %3
%10 = call i32 @pthread_setaffinity_np(i32 %9, i32 4, i32* %5)
ret void
}

LLVM IR (-O2):
define void @set_thread_affinity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @CPU_ZERO(i32* %3)
%6 = call i32 @CPU_SET(i32 %1, i32* %3)
%7 = call i32 @pthread_setaffinity_np(i32 %0, i32 4, i32* %3)
ret void
}
void reboot_now(void) {
  const int PM_PASSWORD = 0x5a000000;
  const int PM_RSTC_WRCFG_FULL_RESET = 0x00000020;
  unsigned int *PM_WDOG = (unsigned int *)(0x20000000UL + 0x00100024);
  unsigned int *PM_RSTC = (unsigned int *)(0x20000000UL + 0x0010001c);
  *PM_WDOG = PM_PASSWORD | 1;
  *PM_RSTC = PM_PASSWORD | PM_RSTC_WRCFG_FULL_RESET;
  while (1)
    ;
}


x86 assembly (clang, -O0):
<reboot_now>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5a000000,-0x4(%rbp)
movl   $0x20,-0x8(%rbp)
mov    $0x20100024,%eax
mov    %rax,-0x10(%rbp)
mov    $0x2010001c,%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5a000001,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x5a000020,(%rax)
jmp    1138 <reboot_now+0x38>

x86 assembly (clang, -O2):
<reboot_now>:
movl   $0x5a000001,0x20100024
movl   $0x5a000020,0x2010001c
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <reboot_now+0x20>

LLVM IR (-O0):
define void @reboot_now() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 1509949440, i32* %1
store i32 32, i32* %2
store i32* inttoptr (i64 537919524 to i32*), i32** %3
store i32* inttoptr (i64 537919516 to i32*), i32** %4
%5 = load i32*, i32** %3
store i32 1509949441, i32* %5
%6 = load i32*, i32** %4
store i32 1509949472, i32* %6
br label %7
7: ; preds = %0, %7
br label %7
}

LLVM IR (-O2):
define void @reboot_now() {
store i32 1509949441, i32* inttoptr (i64 537919524 to i32*)
store i32 1509949472, i32* inttoptr (i64 537919516 to i32*)
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world!");
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello world!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"Hello world!\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
exeq(p) struct { int f, com; } * p;
{ return (doex(p->com)); }


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

x86 assembly (clang, -O2):
<exeq>:
mov    0x4(%rdi),%edi
xor    %eax,%eax
jmp    1030 <doex@plt>

LLVM IR (-O0):
%struct.anon = type { i32, i32 }
define i32 @exeq(%struct.anon* %0) {
%2 = alloca %struct.anon*
store %struct.anon* %0, %struct.anon** %2
%3 = load %struct.anon*, %struct.anon** %2
%4 = getelementptr inbounds %struct.anon, %struct.anon* %3, i32 0, i32 1
%5 = load i32, i32* %4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @doex to i32 (i32, ...)*)(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
%struct.anon = type { i32, i32 }
define i32 @exeq(%struct.anon* nocapture %0) {
%2 = getelementptr inbounds %struct.anon, %struct.anon* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @doex to i32 (i32, ...)*)(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef unsigned long long uint64_t;

/* Variables and functions */
int crq_is_closed(uint64_t t) { return (t & (1ull << 63)) != 0; }


x86 assembly (clang, -O0):
<crq_is_closed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x8000000000000000,%rax
and    -0x8(%rbp),%rax
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crq_is_closed>:
mov    %rdi,%rax
shr    $0x3f,%rax
ret

LLVM IR (-O0):
define i32 @crq_is_closed(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -9223372036854775808
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @crq_is_closed(i64 %0) {
%2 = lshr i64 %0, 63
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ execl(char *, char *, char *, int /*<<< orphan*/ *);
void main(void) {
  execl("/bin/cat", "/bin/cat", "/etc/manpage_pass/manpage1", NULL);
}


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

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rdx
mov    %rdi,%rsi
xor    %ecx,%ecx
jmp    1030 <execl@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"/bin/cat\00"
@.str.1 = [27 x i8] c"/etc/manpage_pass/manpage1\00"
define void @main() {
%1 = call i32 @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"/bin/cat\00"
@.str.1 = [27 x i8] c"/etc/manpage_pass/manpage1\00"
define void @main() {
%1 = tail call i32 @execl(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
scalar_t__ xmalloc(size_t);
char *xstrndup(const char *str, size_t maxl) {
  char *new;
  assert(maxl >= 0);
  new = (char *)xmalloc((maxl + 1) * sizeof(char));
  strncpy(new, str, maxl);
  new[maxl] = '\0';
  return new;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
shl    $0x0,%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
mov    $0x1,%edi
call   1050 <assert@plt>
lea    0x1(%r15),%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = icmp uge i64 %6, 0
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = load i64, i64* %4
%11 = add i64 %10, 1
%12 = mul i64 %11, 1
%13 = call i64 @xmalloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i64, i64* %4
%18 = call i32 @strncpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %5
%20 = load i64, i64* %4
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8 0, i8* %21
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
define i8* @xstrndup(i8* %0, i64 %1) {
%3 = tail call i32 @assert(i32 1)
%4 = add i64 %1, 1
%5 = tail call i64 @xmalloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i32 @strncpy(i8* %6, i8* %0, i64 %1)
%8 = getelementptr inbounds i8, i8* %6, i64 %1
store i8 0, i8* %8
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int i;
  for (i = 0; i < argc; ++i)
    printf("%s\n", argv[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115f <main+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1145 <main+0x35>
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *xmalloc(size_t);
void *xzalloc(size_t size) {
  void *p = xmalloc(size);
  memset(p, 0, size);
  return p;
}


x86 assembly (clang, -O0):
<xzalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xzalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xzalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @xmalloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @memset(i8* %6, i32 0, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @xzalloc(i64 %0) {
%2 = tail call i8* @xmalloc(i64 %0)
%3 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
ret i8* %2
}
/* Variables and functions */
int SIGTSTP;
char fcn1(int val) { return (val == SIGTSTP); }


x86 assembly (clang, -O0):
<fcn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fcn1>:
mov    0x2ee1(%rip),%rax
cmp    %edi,(%rax)
sete   %al
ret

LLVM IR (-O0):
@SIGTSTP = global i32 0
define signext i8 @fcn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGTSTP
%5 = icmp eq i32 %3, %4
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
@SIGTSTP = global i32 0
define signext i8 @fcn1(i32 %0) {
%2 = load i32, i32* @SIGTSTP
%3 = icmp eq i32 %2, %0
%4 = zext i1 %3 to i8
ret i8 %4
}
int lms_rand() {
  static unsigned long next = 1;
  next = next * 1103515245 + 12345;
  return (unsigned int)(next / 65536) % 32768;
}


x86 assembly (clang, -O0):
<lms_rand>:
push   %rbp
mov    %rsp,%rbp
imul   $0x41c64e6d,0x2f11(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
mov    %rax,0x2f04(%rip)
mov    0x2efd(%rip),%rax
shr    $0x10,%rax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lms_rand>:
imul   $0x41c64e6d,0x2f15(%rip),%rax
6d 4e c6 41
add    $0x3039,%rax
mov    %rax,0x2f08(%rip)
shr    $0x10,%eax
and    $0x7fff,%eax
ret

LLVM IR (-O0):
@lms_rand.next = internal global i64 1
define i32 @lms_rand() {
%1 = load i64, i64* @lms_rand.next
%2 = mul i64 %1, 1103515245
%3 = add i64 %2, 12345
store i64 %3, i64* @lms_rand.next
%4 = load i64, i64* @lms_rand.next
%5 = udiv i64 %4, 65536
%6 = trunc i64 %5 to i32
%7 = urem i32 %6, 32768
ret i32 %7
}

LLVM IR (-O2):
@lms_rand.next = internal unnamed_addr global i64 1
define i32 @lms_rand() {
%1 = load i64, i64* @lms_rand.next
%2 = mul i64 %1, 1103515245
%3 = add i64 %2, 12345
store i64 %3, i64* @lms_rand.next
%4 = trunc i64 %3 to i32
%5 = lshr i32 %4, 16
%6 = and i32 %5, 32767
ret i32 %6
}