xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ cctools_fatal(char *);
void *realloc(void *, size_t);
void *xxrealloc(void *ptr, size_t nsize) {
  void *result = realloc(ptr, nsize);
  if (nsize > 0 && result == NULL)
    cctools_fatal("out of memory");
  return result;
}


x86 assembly (clang, -O0):
<xxrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1163 <xxrealloc+0x43>
cmpq   $0x0,-0x18(%rbp)
jne    1163 <xxrealloc+0x43>
lea    0xea2(%rip),%rdi
call   1030 <cctools_fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xxrealloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <realloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1145 <xxrealloc+0x25>
test   %r14,%r14
jne    1145 <xxrealloc+0x25>
lea    0xec0(%rip),%rdi
call   1030 <cctools_fatal@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @xxrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i64, i64* %4
%10 = icmp ugt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @cctools_fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %14, %11, %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define noalias i8* @xxrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp ne i64 %1, 0
%5 = icmp eq i8* %3, null
%6 = and i1 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @cctools_fatal(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
char get_letter() {
  char input[1024];
  char c = 0;
  int i = 0;
  for (i = 0; i < 1024; i++)
    input[i] = 0;
  scanf("%s", input);
  c = input[0];
  return c;
}


x86 assembly (clang, -O0):
<get_letter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movb   $0x0,-0x401(%rbp)
movl   $0x0,-0x408(%rbp)
movl   $0x0,-0x408(%rbp)
cmpl   $0x400,-0x408(%rbp)
jge    1169 <get_letter+0x59>
movslq -0x408(%rbp),%rax
movb   $0x0,-0x400(%rbp,%rax,1)
mov    -0x408(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x408(%rbp)
jmp    1136 <get_letter+0x26>
lea    -0x400(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <scanf@plt>
mov    -0x400(%rbp),%al
mov    %al,-0x401(%rbp)
movsbl -0x401(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_letter>:
push   %rbx
sub    $0x400,%rsp
mov    %rsp,%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xebf(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%al
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define signext i8 @get_letter() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8, i8* %3
ret i8 %5
}
void AYUVToVURow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @AYUVToVURow_Any_NEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void assertEquals(int expected, int actual) {
  if (expected != actual) {
    printf("fail: expected %d, got %d\n", expected, actual);
  }
}


x86 assembly (clang, -O0):
<assertEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     113c <assertEquals+0x2c>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertEquals>:
mov    %esi,%edx
cmp    %esi,%edi
jne    1117 <assertEquals+0x7>
ret
mov    %edi,%esi
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"fail: expected %d, got %d\0A\00"
define void @assertEquals(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 = icmp ne i32 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"fail: expected %d, got %d\0A\00"
define void @assertEquals(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %6
6: ; preds = %4, %2
ret void
}
void dump_cleanup(struct pci_access *__attribute__((unused)) a) {}


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

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

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

LLVM IR (-O2):
%struct.pci_access = type opaque
define void @dump_cleanup(%struct.pci_access* nocapture %0) {
ret void
}
/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
void clear_buffer() {
  int c;
  while ((c = fgetc(stdin)) != '\n' && c != EOF)
    ;
  return;
}


x86 assembly (clang, -O0):
<clear_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x4(%rbp)
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     114b <clear_buffer+0x3b>
mov    -0x4(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
test   $0x1,%al
jne    115b <clear_buffer+0x4b>
jmp    1160 <clear_buffer+0x50>
jmp    1118 <clear_buffer+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_buffer>:
push   %r14
push   %rbx
push   %rax
mov    0x2ecd(%rip),%r14
mov    0x2ebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14),%edi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1141 <clear_buffer+0x31>
cmp    (%rbx),%eax
jne    1130 <clear_buffer+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdin = global i32 0
@EOF = global i32 0
define void @clear_buffer() {
%1 = alloca i32
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* @stdin
%4 = call i32 @fgetc(i32 %3)
store i32 %4, i32* %1
%5 = icmp ne i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* %1
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
ret void
}

LLVM IR (-O2):
@stdin = global i32 0
@EOF = global i32 0
define void @clear_buffer() {
br label %1
1: ; preds = %1, %0
%2 = load i32, i32* @stdin
%3 = tail call i32 @fgetc(i32 %2)
%4 = icmp ne i32 %3, 10
%5 = load i32, i32* @EOF
%6 = icmp ne i32 %3, %5
%7 = select i1 %4, i1 %6, i1 false
br i1 %7, label %1, label %8
8: ; preds = %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
long double wcstod(int /*<<< orphan*/ const *, int /*<<< orphan*/ **);
long double wcstold(const wchar_t *nptr, wchar_t **endptr) {
  return wcstod(nptr, endptr);
}


x86 assembly (clang, -O0):
<wcstold>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wcstod@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcstold>:
jmp    1030 <wcstod@plt>

LLVM IR (-O0):
define x86_fp80 @wcstold(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 = call x86_fp80 @wcstod(i32* %5, i32** %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @wcstold(i32* %0, i32** %1) {
%3 = tail call x86_fp80 @wcstod(i32* %0, i32** %1)
ret x86_fp80 %3
}
void INT_Excep_CAN1_TXM1(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN1_TXM1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sendBlink(int, int, int, int);
int /*<<< orphan*/ sendConf(int, int);
void setPurpleStill(int sockfd) {
  sendConf(sockfd, (1 << 7) | (1 << 3) | (3 << 1));
  sendBlink(sockfd, 0x11, 201, 200);
}


x86 assembly (clang, -O0):
<setPurpleStill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8e,%esi
call   1040 <sendConf@plt>
mov    -0x4(%rbp),%edi
mov    $0x11,%esi
mov    $0xc9,%edx
mov    $0xc8,%ecx
call   1030 <sendBlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setPurpleStill>:
push   %rbx
mov    %edi,%ebx
mov    $0x8e,%esi
call   1040 <sendConf@plt>
mov    %ebx,%edi
mov    $0x11,%esi
mov    $0xc9,%edx
mov    $0xc8,%ecx
pop    %rbx
jmp    1030 <sendBlink@plt>

LLVM IR (-O0):
define void @setPurpleStill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sendConf(i32 %3, i32 142)
%5 = load i32, i32* %2
%6 = call i32 @sendBlink(i32 %5, i32 17, i32 201, i32 200)
ret void
}

LLVM IR (-O2):
define void @setPurpleStill(i32 %0) {
%2 = tail call i32 @sendConf(i32 %0, i32 142)
%3 = tail call i32 @sendBlink(i32 %0, i32 17, i32 201, i32 200)
ret void
}
unsigned int setbits(unsigned int x, int p, int n, unsigned int y) {
  unsigned int y_mask = ~(~0 << n);
  y = (y & y_mask) << p - n;
  unsigned int x_mask = ~0 << p - n ^ ~(~0 << p);
  x = x & x_mask;
  return x | y;
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
xor    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%eax
mov    %edx,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %esi,%r8d
not    %edx
and    %eax,%edx
mov    %esi,%eax
sub    %ecx,%eax
mov    %eax,%ecx
shl    %cl,%edx
mov    $0xffffffff,%esi
shl    %cl,%esi
mov    $0xffffffff,%eax
mov    %r8d,%ecx
shl    %cl,%eax
xor    %esi,%eax
not    %eax
and    %edi,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
%12 = shl i32 -1, %11
%13 = xor i32 %12, -1
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = and i32 %14, %15
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = sub nsw i32 %17, %18
%20 = shl i32 %16, %19
store i32 %20, i32* %8
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
%24 = shl i32 -1, %23
%25 = load i32, i32* %6
%26 = shl i32 -1, %25
%27 = xor i32 %26, -1
%28 = xor i32 %24, %27
store i32 %28, i32* %10
%29 = load i32, i32* %5
%30 = load i32, i32* %10
%31 = and i32 %29, %30
store i32 %31, i32* %5
%32 = load i32, i32* %5
%33 = load i32, i32* %8
%34 = or i32 %32, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 -1, %2
%6 = xor i32 %5, -1
%7 = and i32 %6, %3
%8 = sub nsw i32 %1, %2
%9 = shl i32 %7, %8
%10 = shl nsw i32 -1, %8
%11 = shl nsw i32 -1, %1
%12 = xor i32 %11, %10
%13 = xor i32 %12, -1
%14 = and i32 %13, %0
%15 = or i32 %14, %9
ret i32 %15
}
int jacFun_work(int *sz_arg, int *sz_res, int *sz_iw, int *sz_w) {
  if (sz_arg)
    *sz_arg = 2;
  if (sz_res)
    *sz_res = 2;
  if (sz_iw)
    *sz_iw = 0;
  if (sz_w)
    *sz_w = 24;
  return 0;
}


x86 assembly (clang, -O0):
<jacFun_work>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1129 <jacFun_work+0x29>
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x10(%rbp)
je     113e <jacFun_work+0x3e>
mov    -0x10(%rbp),%rax
movl   $0x2,(%rax)
cmpq   $0x0,-0x18(%rbp)
je     1153 <jacFun_work+0x53>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
cmpq   $0x0,-0x20(%rbp)
je     1168 <jacFun_work+0x68>
mov    -0x20(%rbp),%rax
movl   $0x18,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jacFun_work>:
test   %rdi,%rdi
je     110b <jacFun_work+0xb>
movl   $0x2,(%rdi)
test   %rsi,%rsi
je     1116 <jacFun_work+0x16>
movl   $0x2,(%rsi)
test   %rdx,%rdx
je     1121 <jacFun_work+0x21>
movl   $0x0,(%rdx)
test   %rcx,%rcx
je     112c <jacFun_work+0x2c>
movl   $0x18,(%rcx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @jacFun_work(i32* writeonly %0, i32* writeonly %1, i32* writeonly %2, i32* writeonly %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %7, label %6
6: ; preds = %4
store i32 2, i32* %0
br label %7
7: ; preds = %6, %4
%8 = icmp eq i32* %1, null
br i1 %8, label %10, label %9
9: ; preds = %7
store i32 2, i32* %1
br label %10
10: ; preds = %9, %7
%11 = icmp eq i32* %2, null
br i1 %11, label %13, label %12
12: ; preds = %10
store i32 0, i32* %2
br label %13
13: ; preds = %12, %10
%14 = icmp eq i32* %3, null
br i1 %14, label %16, label %15
15: ; preds = %13
store i32 24, i32* %3
br label %16
16: ; preds = %15, %13
ret i32 0
}
void freeFromEcoToX86(unsigned char *p) {
  int i;
  conv4FromEcoToX86(p);
  p += 4;
  for (i = 0; i < 500; i++) {
    conv4FromEcoToX86(p);
    p += 4;
  }
}


x86 assembly (clang, -O0):
<freeFromEcoToX86>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <conv4FromEcoToX86@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jge    116c <freeFromEcoToX86+0x5c>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <conv4FromEcoToX86@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <freeFromEcoToX86+0x2a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeFromEcoToX86>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <conv4FromEcoToX86@plt>
mov    $0x4,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%r14,%rbx,1),%rdi
xor    %eax,%eax
call   1030 <conv4FromEcoToX86@plt>
add    $0x4,%rbx
cmp    $0x7d4,%ebx
jne    1130 <freeFromEcoToX86+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @freeFromEcoToX86(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @conv4FromEcoToX86 to i32 (i8*, ...)*)(i8* %4)
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 4
store i8* %7, i8** %2
store i32 0, i32* %3
br label %8
8: ; preds = %16, %1
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 500
br i1 %10, label %11, label %19
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @conv4FromEcoToX86 to i32 (i8*, ...)*)(i8* %12)
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 4
store i8* %15, i8** %2
br label %16
16: ; preds = %11
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %8
19: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @freeFromEcoToX86(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @conv4FromEcoToX86 to i32 (i8*, ...)*)(i8* %0)
br label %3
3: ; preds = %1, %3
%4 = phi i8* [ %0, %1 ], [ %6, %3 ]
%5 = phi i32 [ 0, %1 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 4
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @conv4FromEcoToX86 to i32 (i8*, ...)*)(i8* %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 500
br i1 %9, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int foo(int, int);
int main(int argc, char *const argv[]) { return foo(1, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <foo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
jmp    1030 <foo@plt>

LLVM IR (-O0):
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 @foo(i32 1, i32 2)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @foo(i32 1, i32 2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ lprintf(int /*<<< orphan*/, char *);
void exit_usage(int code) {
  lprintf(0, "Usage: mgetty [-x debug] [-s speed] [-r] line");
  exit(code);
}


x86 assembly (clang, -O0):
<exit_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
lea    0xecc(%rip),%rsi
call   1040 <lprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<exit_usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rsi
xor    %edi,%edi
call   1040 <lprintf@plt>
mov    %ebx,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"Usage: mgetty [-x debug] [-s speed] [-r] line\00"
define void @exit_usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @lprintf(i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@.str = [46 x i8] c"Usage: mgetty [-x debug] [-s speed] [-r] line\00"
define void @exit_usage(i32 %0) {
%2 = tail call i32 @lprintf(i32 0, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x42() {
  Assert_real((isprint(66)),
              "/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_isprint.c",
              335, ("isprint should be 1 for B"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x42>:
push   %rax
mov    $0x42,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x14f,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for B\00"
define void @t_isprint_0x42() {
%1 = call i32 @isprint(i32 66)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for B\00"
define void @t_isprint_0x42() {
%1 = tail call i32 @isprint(i32 66)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putendl(char *);
int /*<<< orphan*/ ft_putnbr(int);
void ft_putnbrendl(int nb) {
  ft_putnbr(nb);
  ft_putendl("");
}


x86 assembly (clang, -O0):
<ft_putnbrendl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <ft_putnbr@plt>
lea    0xec6(%rip),%rdi
call   1030 <ft_putendl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbrendl>:
push   %rax
call   1040 <ft_putnbr@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <ft_putendl@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @ft_putnbrendl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ft_putnbr(i32 %3)
%5 = call i32 @ft_putendl(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @ft_putnbrendl(i32 %0) {
%2 = tail call i32 @ft_putnbr(i32 %0)
%3 = tail call i32 @ft_putendl(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned int log2_int(unsigned int x) {
  unsigned int ans = 0;
  while (x >>= 1)
    ans++;
  return ans;
}


x86 assembly (clang, -O0):
<log2_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     112e <log2_int+0x2e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <log2_int+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2_int>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <log2_int+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <log2_int+0x10>
ret

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

LLVM IR (-O2):
define i32 @log2_int(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void successcallback(void *value, int size) { printf("Success callback\n"); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Success callback\0A\00"
define void @successcallback(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"Success callback\00"
define void @successcallback(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t rotl(const uint32_t x, const unsigned n) {
  return (x << n) | (x >> (32 - n));
}


x86 assembly (clang, -O0):
<rotl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%eax
ret

LLVM IR (-O0):
define i32 @rotl(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 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 32, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 32, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__44__IO__makeInput();
void Msp430Adc12ImplP__Port64__makeInput(void) {
  HplMsp430GeneralIOP__44__IO__makeInput();
}


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

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

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

LLVM IR (-O2):
define void @Msp430Adc12ImplP__Port64__makeInput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__44__IO__makeInput()
ret void
}
int test_imm_74int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x74 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_74int64_midword_mem>:
testb  $0x74,0x2(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_74int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7602176
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void version(void) {
  printf("bin2tap v.1.2"
         "\nCopyright (C) 2004 mike/zeroteam\n");
  printf("Wassup, wct demomakers! Have fun!\n");
}


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

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0b(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"bin2tap v.1.2\0ACopyright (C) 2004 mike/zeroteam\0A\00"
@.str.1 = [35 x i8] c"Wassup, wct demomakers! Have fun!\0A\00"
define void @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [47 x i8] c"bin2tap v.1.2\0ACopyright (C) 2004 mike/zeroteam\00"
@str.2 = [34 x i8] c"Wassup, wct demomakers! Have fun!\00"
define void @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.2, i64 0, i64 0))
ret void
}
int searchGameProcess() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @searchGameProcess() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int corner_write(unsigned char *cornertable, FILE *output) {
  int written;
  written = fwrite(cornertable, 1, 44089920, output);
  if (written < 44089920)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<corner_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2a0c240,%edx
call   1030 <fwrite@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x2a0c240,-0x1c(%rbp)
jge    1153 <corner_write+0x43>
movl   $0x0,-0x4(%rbp)
jmp    115a <corner_write+0x4a>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<corner_write>:
push   %rax
mov    %rsi,%rcx
mov    $0x1,%esi
mov    $0x2a0c240,%edx
call   1030 <fwrite@plt>
xor    %ecx,%ecx
cmp    $0x2a0c240,%eax
setge  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @corner_write(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @fwrite(i8* %0, i32 1, i32 44089920, i32* %1)
%4 = icmp sgt i32 %3, 44089919
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ A7_command_writeport(char *);
void A7board_println(char *command) {
  A7_command_writeport(command);
  A7_command_writeport("\n");
}


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

x86 assembly (clang, -O2):
<A7board_println>:
push   %rax
call   1030 <A7_command_writeport@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <A7_command_writeport@plt>

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

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define void @A7board_println(i8* %0) {
%2 = tail call i32 @A7_command_writeport(i8* %0)
%3 = tail call i32 @A7_command_writeport(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int epoll_create1(int /*<<< orphan*/);
int main(void) { return epoll_create1(0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
jmp    1030 <epoll_create1@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @epoll_create1(i32 0)
ret i32 %1
}
/* Variables and functions */
size_t random_integer(int /*<<< orphan*/, unsigned int const);
char *random_choice_string(char *strings[], const unsigned int length) {
  return strings[random_integer(0, length - 1)];
}


x86 assembly (clang, -O0):
<random_choice_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1030 <random_integer@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    (%rax,%rcx,8),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_choice_string>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffff,%esi
xor    %edi,%edi
call   1030 <random_integer@plt>
mov    (%rbx,%rax,8),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @random_choice_string(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
store i8** %0, i8*** %3
store i32 %1, i32* %4
%5 = load i8**, i8*** %3
%6 = load i32, i32* %4
%7 = sub i32 %6, 1
%8 = call i64 @random_integer(i32 0, i32 %7)
%9 = getelementptr inbounds i8*, i8** %5, i64 %8
%10 = load i8*, i8** %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @random_choice_string(i8** nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = tail call i64 @random_integer(i32 0, i32 %3)
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
ret i8* %6
}
void imx_src_prepare_restart(void) {}


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

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

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

LLVM IR (-O2):
define void @imx_src_prepare_restart() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, size_t, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *malloc(size_t);
void *worker(void *arg) {
  FILE *fp = fopen("/dev/zero", "r");
  size_t size = 1024 * 1024 * sizeof(char);
  char *buffer = malloc(size);
  while (true) {
    fread(buffer, size, 1, fp);
  }
  free(buffer);
  return NULL;
}


x86 assembly (clang, -O0):
<worker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
movq   $0x100000,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
jmp    1168 <worker+0x38>

x86 assembly (clang, -O2):
<worker>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    $0x100000,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x100000,%esi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    %r14,%rcx
call   1030 <fread@plt>
jmp    1160 <worker+0x30>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/zero\00"
@.str.1 = [2 x i8] c"r\00"
define i8* @worker(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %2
%6 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %3
store i64 1048576, i64* %4
%7 = load i64, i64* %4
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %5
br label %9
9: ; preds = %1, %9
%10 = load i8*, i8** %5
%11 = load i64, i64* %4
%12 = load i32*, i32** %3
%13 = call i32 @fread(i8* %10, i64 %11, i32 1, i32* %12)
br label %9
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/zero\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i8* @worker(i8* nocapture readnone %0) {
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call dereferenceable_or_null(1048576) i8* @malloc(i64 1048576)
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @fread(i8* %3, i64 1048576, i32 1, i32* %2)
br label %4
}
int isspace(c)
unsigned char c;
{ return c == ' ' || c == '\t' || isreturn(c); }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1156 <isspace+0x46>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x2(%rbp)
je     1156 <isspace+0x46>
movzbl -0x1(%rbp),%edi
mov    $0x0,%al
call   1030 <isreturn@plt>
cmp    $0x0,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
mov    $0x1,%eax
cmp    $0x9,%dil
je     1121 <isspace+0x11>
cmp    $0x20,%dil
jne    1122 <isspace+0x12>
ret
push   %rax
movzbl %dil,%edi
xor    %eax,%eax
call   1030 <isreturn@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = trunc i32 %0 to i8
switch i8 %2, label %3 [
i8 32, label %8
i8 9, label %8
]
3: ; preds = %1
%4 = and i32 %0, 255
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @isreturn to i32 (i32, ...)*)(i32 %4)
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %1, %3
%9 = phi i32 [ 1, %1 ], [ %7, %3 ], [ 1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
void perror_exit(const char *str, const char *name) {
  fprintf(stderr,
          "String \"%s\" is not a valid positive integer!\n"
          "\n"
          "Usage: %s [NUM_TERMS] [NUM_THREADS]\n"
          "If NUM_TERMS is not given default value will be used.\n"
          "NUM_THREADS has no effect for sequential application version\n",
          str, name);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<perror_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<perror_exit>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [198 x i8] c"String \22%s\22 is not a valid positive integer!\0A\0AUsage: %s [NUM_TERMS] [NUM_THREADS]\0AIf NUM_TERMS is not given default value will be used.\0ANUM_THREADS has no effect for sequential application version\0A\00"
@EXIT_FAILURE = global i32 0
define void @perror_exit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([198 x i8], [198 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [198 x i8] c"String \22%s\22 is not a valid positive integer!\0A\0AUsage: %s [NUM_TERMS] [NUM_THREADS]\0AIf NUM_TERMS is not given default value will be used.\0ANUM_THREADS has no effect for sequential application version\0A\00"
@EXIT_FAILURE = global i32 0
define void @perror_exit(i8* %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([198 x i8], [198 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
void RTAvlrFileOffsetGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlrFileOffsetGetBestFit() {
ret void
}
void m12mo_startCapture(void) { return; }


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

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

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

LLVM IR (-O2):
define void @m12mo_startCapture() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func5(int, int);
main() { func5(3, 5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <func5@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <func5@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @func5(i32 3, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @func5(i32 3, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int *p = NULL;
  *p = 100;
  printf("Value of *p : %d\n", *p);
  return 0;
}


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

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [18 x i8] c"Value of *p : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = load i32*, i32** %2
store i32 100, i32* %3
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
unsigned long long align64(unsigned long long offset,
                           unsigned long long alignment) {
  unsigned long long mask = ~(alignment - 1);
  return (offset + (alignment - 1)) & mask;
}


x86 assembly (clang, -O0):
<align64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
add    %rcx,%rax
and    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align64>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @align64(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = xor i64 %7, -1
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = sub i64 %10, 1
%12 = add i64 %9, %11
%13 = load i64, i64* %5
%14 = and i64 %12, %13
ret i64 %14
}

LLVM IR (-O2):
define i64 @align64(i64 %0, i64 %1) {
%3 = sub i64 0, %1
%4 = add i64 %0, -1
%5 = add i64 %4, %1
%6 = and i64 %5, %3
ret i64 %6
}