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

/* Variables and functions */
void to_bytes(uint32_t val, uint8_t *bytes) {
  bytes[0] = (uint8_t)val;
  bytes[1] = (uint8_t)(val >> 8);
  bytes[2] = (uint8_t)(val >> 16);
  bytes[3] = (uint8_t)(val >> 24);
}


x86 assembly (clang, -O0):
<to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_bytes>:
movslq %edi,%rax
mov    %rax,(%rsi)
mov    %eax,%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    %rcx,0x8(%rsi)
mov    %eax,%ecx
sar    $0x10,%ecx
movslq %ecx,%rcx
mov    %rcx,0x10(%rsi)
sar    $0x18,%eax
cltq
mov    %rax,0x18(%rsi)
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
unsigned long ftell(int /*<<< orphan*/ *);
unsigned long get_filesize(const char *path) {
  FILE *fp;
  fp = fopen(path, "r");
  fseek(fp, 0L, SEEK_END);
  unsigned long sz = ftell(fp);
  return sz;
}


x86 assembly (clang, -O0):
<get_filesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e8d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_filesize>:
push   %rbx
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i64 @get_filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = load i32, i32* @SEEK_END
%9 = call i32 @fseek(i32* %7, i64 0, i32 %8)
%10 = load i32*, i32** %3
%11 = call i64 @ftell(i32* %10)
store i64 %11, i64* %4
%12 = load i64, i64* %4
ret i64 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@SEEK_END = global i32 0
define i64 @get_filesize(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @SEEK_END
%4 = tail call i32 @fseek(i32* %2, i64 0, i32 %3)
%5 = tail call i64 @ftell(i32* %2)
ret i64 %5
}
/* Variables and functions */
unsigned int getParameter(unsigned int, int);
unsigned int readMessage(unsigned int, unsigned int);
unsigned int wrapper_readMailBox(unsigned int pc, unsigned int sp,
                                 unsigned int spsr) {
  unsigned int nBuz = getParameter(sp, 0);
  unsigned int messageDir = getParameter(sp, 1);
  sp = readMessage(nBuz, messageDir);
  return sp;
}


x86 assembly (clang, -O0):
<wrapper_readMailBox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1040 <getParameter@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
call   1040 <getParameter@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <readMessage@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrapper_readMailBox>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %esi,%edi
xor    %esi,%esi
call   1040 <getParameter@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    $0x1,%esi
call   1040 <getParameter@plt>
mov    %ebp,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <readMessage@plt>

LLVM IR (-O0):
define i32 @wrapper_readMailBox(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = call i32 @getParameter(i32 %9, i32 0)
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = call i32 @getParameter(i32 %11, i32 1)
store i32 %12, i32* %8
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = call i32 @readMessage(i32 %13, i32 %14)
store i32 %15, i32* %5
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @wrapper_readMailBox(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @getParameter(i32 %1, i32 0)
%5 = tail call i32 @getParameter(i32 %1, i32 1)
%6 = tail call i32 @readMessage(i32 %4, i32 %5)
ret i32 %6
}
unsigned _longshr(unsigned low, unsigned high, char shift) {
  if (shift == 0)
    return low;
  return (low >> shift) | (high << ((2 * (sizeof(unsigned) * 4)) - shift));
}


x86 assembly (clang, -O0):
<_longshr>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
movsbl -0xd(%rbp),%eax
cmp    $0x0,%eax
jne    1127 <_longshr+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1149 <_longshr+0x49>
mov    -0x8(%rbp),%eax
movsbl -0xd(%rbp),%ecx
shr    %cl,%eax
mov    -0xc(%rbp),%edx
movsbq -0xd(%rbp),%rsi
mov    $0x20,%ecx
sub    %rsi,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_longshr>:
mov    %edi,%eax
test   %dl,%dl
je     110b <_longshr+0xb>
mov    %edx,%ecx
shrd   %cl,%esi,%eax
ret

LLVM IR (-O0):
define i32 @_longshr(i32 %0, i32 %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8 %2, i8* %7
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %25
13: ; preds = %3
%14 = load i32, i32* %5
%15 = load i8, i8* %7
%16 = sext i8 %15 to i32
%17 = lshr i32 %14, %16
%18 = load i32, i32* %6
%19 = load i8, i8* %7
%20 = sext i8 %19 to i64
%21 = sub i64 32, %20
%22 = trunc i64 %21 to i32
%23 = shl i32 %18, %22
%24 = or i32 %17, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %13, %11
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @_longshr(i32 %0, i32 %1, i8 signext %2) {
%4 = icmp eq i8 %2, 0
br i1 %4, label %12, label %5
5: ; preds = %3
%6 = zext i8 %2 to i32
%7 = lshr i32 %0, %6
%8 = sext i8 %2 to i32
%9 = sub nsw i32 32, %8
%10 = shl i32 %1, %9
%11 = or i32 %10, %7
br label %12
12: ; preds = %3, %5
%13 = phi i32 [ %11, %5 ], [ %0, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ *stderr;
int /*<<< orphan*/ *stdout;
void helpAndLeave(const char *progname, int status) {
  FILE *stream = stderr;
  if (status == EXIT_SUCCESS) {
    stream = stdout;
  }
  fprintf(stream, "Usage: %s <seconds>\n", progname);
  exit(status);
}


x86 assembly (clang, -O0):
<helpAndLeave>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2e89(%rip),%rcx
cmp    (%rcx),%eax
jne    115d <helpAndLeave+0x3d>
mov    0x2e82(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0xc(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<helpAndLeave>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rdx
mov    0x2ea3(%rip),%rax
cmp    %esi,(%rax)
jne    113a <helpAndLeave+0x1a>
mov    0x2ea0(%rip),%rax
jmp    1141 <helpAndLeave+0x21>
mov    0x2e9f(%rip),%rax
mov    (%rax),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [21 x i8] c"Usage: %s <seconds>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32*, i32** @stderr
store i32* %6, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* @EXIT_SUCCESS
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32*, i32** @stdout
store i32* %11, i32** %5
br label %12
12: ; preds = %10, %2
%13 = load i32*, i32** %5
%14 = load i8*, i8** %3
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = load i32, i32* %4
%17 = call i32 @exit(i32 %16)
unreachable
}

LLVM IR (-O2):
@stderr = global i32* null
@EXIT_SUCCESS = global i32 0
@stdout = global i32* null
@.str = [21 x i8] c"Usage: %s <seconds>\0A\00"
define void @helpAndLeave(i8* %0, i32 %1) {
%3 = load i32, i32* @EXIT_SUCCESS
%4 = icmp eq i32 %3, %1
%5 = load i32*, i32** @stdout
%6 = load i32*, i32** @stderr
%7 = select i1 %4, i32* %5, i32* %6
%8 = tail call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = tail call i32 @exit(i32 %1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ init_ui();
int /*<<< orphan*/ main_menu();
int /*<<< orphan*/ run_game();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  init_ui();
  while (1) {
    main_menu();
    run_game();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1030 <init_ui@plt>
mov    $0x0,%al
call   1070 <main_menu@plt>
mov    $0x0,%al
call   1060 <run_game@plt>
jmp    1176 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1030 <init_ui@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <main_menu@plt>
xor    %eax,%eax
call   1060 <run_game@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
%4 = call i32 (...) @init_ui()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @main_menu()
%7 = call i32 (...) @run_game()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @init_ui()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @main_menu()
%6 = tail call i32 (...) @run_game()
br label %4
}
/* Variables and functions */
int /*<<< orphan*/ displayMenuEntry(int, char *);
void displayMenu() {
  displayMenuEntry(1, "Addition");
  displayMenuEntry(2, "Substraction");
  displayMenuEntry(3, "Multiplication");
  displayMenuEntry(4, "Exit");
}


x86 assembly (clang, -O0):
<displayMenu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x2,%edi
lea    0xed8(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x3,%edi
lea    0xed4(%rip),%rsi
call   1030 <displayMenuEntry@plt>
mov    $0x4,%edi
lea    0xed2(%rip),%rsi
call   1030 <displayMenuEntry@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayMenu>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
call   1030 <displayMenuEntry@plt>
lea    0xee0(%rip),%rsi
mov    $0x2,%edi
call   1030 <displayMenuEntry@plt>
lea    0xedc(%rip),%rsi
mov    $0x3,%edi
call   1030 <displayMenuEntry@plt>
lea    0xeda(%rip),%rsi
mov    $0x4,%edi
pop    %rax
jmp    1030 <displayMenuEntry@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"Addition\00"
@.str.1 = [13 x i8] c"Substraction\00"
@.str.2 = [15 x i8] c"Multiplication\00"
@.str.3 = [5 x i8] c"Exit\00"
define void @displayMenu() {
%1 = call i32 @displayMenuEntry(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @displayMenuEntry(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @displayMenuEntry(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @displayMenuEntry(i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"Addition\00"
@.str.1 = [13 x i8] c"Substraction\00"
@.str.2 = [15 x i8] c"Multiplication\00"
@.str.3 = [5 x i8] c"Exit\00"
define void @displayMenu() {
%1 = tail call i32 @displayMenuEntry(i32 1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @displayMenuEntry(i32 2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @displayMenuEntry(i32 3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @displayMenuEntry(i32 4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret void
}
void rop3_215_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T ^ S;
  stk1 = *D & stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_215_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_215_1_1>:
mov    (%rdi),%al
mov    %edx,%ecx
or     %sil,%cl
not    %cl
and    %al,%sil
or     %cl,%sil
and    %dl,%al
or     %sil,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_215_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = xor i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = and i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_215_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = or i8 %2, %1
%6 = xor i8 %5, -1
%7 = and i8 %4, %1
%8 = or i8 %7, %6
%9 = and i8 %4, %2
%10 = or i8 %8, %9
store i8 %10, i8* %0
ret void
}
/* Variables and functions */
int atoi(char *);
int matoi(char *string) { return atoi(string); }


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

x86 assembly (clang, -O2):
<matoi>:
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
define i32 @matoi(i8* nocapture %0) {
%2 = tail call i32 @atoi(i8* %0)
ret i32 %2
}
int main() {
  int i;
  int j;
  i = 0;
  while (i < 100) {
    j = 0;
    while (j < 1) {
      j = j + 0;
    }
    i = i + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1149 <main+0x49>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    113b <main+0x3b>
mov    -0xc(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main+0x23>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O2):
int leastOf(int x, int y) {
  if (x > y)
    return y;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @leastOf(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void aeron_free(void *ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @aeron_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
long long L_floor(double v) { return (long long)floor(v); }


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

x86 assembly (clang, -O2):
<L_floor>:
jmp    1030 <floor@plt>

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

LLVM IR (-O2):
define i64 @L_floor(double %0) {
%2 = tail call i64 @floor(double %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
void strapp(char *dest, char c) {
  char str[] = "\0\0";
  str[0] = c;
  str[1] = '\0';
  strcat(dest, str);
}


x86 assembly (clang, -O0):
<strapp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1030 <memset@plt>
mov    -0x9(%rbp),%al
mov    %al,-0xc(%rbp)
movb   $0x0,-0xb(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strapp>:
push   %rax
mov    %sil,0x5(%rsp)
movw   $0x0,0x6(%rsp)
lea    0x5(%rsp),%rsi
call   1030 <strcat@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @strapp(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca [3 x i8]
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = bitcast [3 x i8]* %5 to i8*
%7 = load i8, i8* %4
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
store i8 %7, i8* %8
%9 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 1
store i8 0, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds [3 x i8], [3 x i8]* %5, i64 0, i64 0
%12 = call i32 @strcat(i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
define void @strapp(i8* %0, i8 signext %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 2
store i8 0, i8* %5
store i8 %1, i8* %4
%6 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = call i32 @strcat(i8* %0, i8* %4)
ret void
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char *, int, unsigned char *, int, int, int);
unsigned int vp8_sad4x4_c(unsigned char *src_ptr, int src_stride,
                          unsigned char *ref_ptr, int ref_stride, int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, 4, 4);
}


x86 assembly (clang, -O0):
<vp8_sad4x4_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    $0x4,%r9d
mov    %r9d,%r8d
call   1030 <sad_mx_n_c@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad4x4_c>:
mov    $0x4,%r8d
mov    $0x4,%r9d
jmp    1030 <sad_mx_n_c@plt>

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

LLVM IR (-O2):
define i32 @vp8_sad4x4_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 4, i32 4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void print_usage(void) {
  fprintf(stdout,
          "Kvazaar usage: -i and --input-res to set input, -o to set output\n"
          "               --help for more information\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [109 x i8] c"Kvazaar usage: -i and --input-res to set input, -o to set output\0A --help for more information\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [109 x i8] c"Kvazaar usage: -i and --input-res to set input, -o to set output\0A --help for more information\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *Map_Description(void) {
  return "The `Map` type is an iterable that applies some callable to to each "
         "item in another iterable and returns the result. This can be useful "
         "to "
         "make more concise iteration when there are callback functions "
         "available."
         "\n\n"
         "If the mapping callable is a purely side-effect callable it is "
         "possible "
         "to use the `call` function on the `Map` object directly for a quick "
         "way "
         "to perform the iteration."
         "\n\n"
         "One downside of `Map` is that the `iter_type` becomes unknown (there "
         "is "
         "no way to know what type the callable will return so some objects "
         "such "
         "as `Array`s may revert to using `Ref` as the object type when "
         "assigned a "
         "`Map`.";
}


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

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

LLVM IR (-O0):
@.str = [607 x i8] c"The `Map` type is an iterable that applies some callable to to each item in another iterable and returns the result. This can be useful to make more concise iteration when there are callback functions available.\0A\0AIf the mapping callable is a purely side-effect callable it is possible to use the `call` function on the `Map` object directly for a quick way to perform the iteration.\0A\0AOne downside of `Map` is that the `iter_type` becomes unknown (there is no way to know what type the callable will return so some objects such as `Array`s may revert to using `Ref` as the object type when assigned a `Map`.\00"
define i8* @Map_Description() {
ret i8* getelementptr inbounds ([607 x i8], [607 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [607 x i8] c"The `Map` type is an iterable that applies some callable to to each item in another iterable and returns the result. This can be useful to make more concise iteration when there are callback functions available.\0A\0AIf the mapping callable is a purely side-effect callable it is possible to use the `call` function on the `Map` object directly for a quick way to perform the iteration.\0A\0AOne downside of `Map` is that the `iter_type` becomes unknown (there is no way to know what type the callable will return so some objects such as `Array`s may revert to using `Ref` as the object type when assigned a `Map`.\00"
define i8* @Map_Description() {
ret i8* getelementptr inbounds ([607 x i8], [607 x i8]* @.str, i64 0, i64 0)
}
signed char fn6(signed char x, unsigned long long y) { return x << y; }


x86 assembly (clang, -O0):
<fn6>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn6>:
mov    %rsi,%rcx
movzbl %dil,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define signext i8 @fn6(i8 signext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @fn6(i8 signext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = trunc i32 %5 to i8
ret i8 %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t f20_39(uint32_t x, uint32_t y, uint32_t z) { return (x ^ z) ^ y; }


x86 assembly (clang, -O0):
<f20_39>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
xor    -0xc(%rbp),%eax
xor    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f20_39>:
mov    %edi,%eax
xor    %esi,%eax
xor    %edx,%eax
ret

LLVM IR (-O0):
define i32 @f20_39(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = xor i32 %7, %8
%10 = load i32, i32* %5
%11 = xor i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @f20_39(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %1, %0
%5 = xor i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int *f(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 1;
  int *z = f(x);
  printf("%d", *z);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32* @f(i32 1)
%2 = load i32, i32* %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int fork();
int /*<<< orphan*/ marker();
int main(void) {
  int pid;
  pid = fork();
  if (pid == 0) {
    exit(0);
  } else {
  }
  pid = fork();
  if (pid == 0) {
    exit(0);
  } else {
  }
  pid = fork();
  if (pid == 0) {
    exit(0);
  } else {
  }
  marker();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1153 <main+0x23>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1158 <main+0x28>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1173 <main+0x43>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1178 <main+0x48>
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1193 <main+0x63>
xor    %edi,%edi
call   1030 <exit@plt>
jmp    1198 <main+0x68>
mov    $0x0,%al
call   1050 <marker@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     115d <main+0x2d>
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     115d <main+0x2d>
xor    %eax,%eax
call   1040 <fork@plt>
test   %eax,%eax
je     115d <main+0x2d>
xor    %eax,%eax
call   1050 <marker@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @fork()
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %5
%11 = tail call i32 (...) @fork()
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @exit(i32 0)
unreachable
15: ; preds = %10
%16 = tail call i32 (...) @marker()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, int);
void nocrash_fgetc() {
  FILE *f;
  int i;
  f = fopen("this_file_doesnt_exist", "r");
  if (f) {
    i = fgetc(f);
    printf("i =%i\n", i);
    fclose(f);
  }
}


x86 assembly (clang, -O0):
<nocrash_fgetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     118e <nocrash_fgetc+0x4e>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nocrash_fgetc>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     117b <nocrash_fgetc+0x3b>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <fgetc@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"i =%i\0A\00"
define void @nocrash_fgetc() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %13
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @fgetc(i32* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = load i32*, i32** %1
%12 = call i32 @fclose(i32* %11)
br label %13
13: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"this_file_doesnt_exist\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"i =%i\0A\00"
define void @nocrash_fgetc() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = tail call i32 @fgetc(i32* %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 @fclose(i32* %1)
br label %7
7: ; preds = %3, %0
ret void
}
void command_release(void) {
  printf("%s, %s, %d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/"
         "base-usage/make_study/command.c",
         __func__, 32);
  release();
}


x86 assembly (clang, -O0):
<command_release>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xf77(%rip),%rdx
mov    $0x20,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <release@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_release>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xf7a(%rip),%rdx
mov    $0x20,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <release@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/command.c\00"
@__func__.command_release = [16 x i8] c"command_release\00"
define void @command_release() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.command_release, i64 0, i64 0), i32 32)
%2 = call i32 (...) @release()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, %s, %d\0A\00"
@.str.1 = [164 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sczzq/symmetrical-spoon/refs/heads/master/base-usage/make_study/command.c\00"
@__func__.command_release = [16 x i8] c"command_release\00"
define void @command_release() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([164 x i8], [164 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.command_release, i64 0, i64 0), i32 32)
%2 = tail call i32 (...) @release()
ret void
}
int main(void) {
  void *buf = calloc(14, sizeof(int));
  strcpy(buf, "Hello, world!");
  printf("%s\n", buf);
  free(buf);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
movabs $0x77202c6f6c6c6548,%rax
2c 20 77
mov    %rax,(%rbx)
movabs $0x21646c726f7720,%rax
mov    %rax,0x6(%rbx)
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(56) i8* @calloc(i64 14, i64 4)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(14) %1, i8* align 1 dereferenceable(14) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i64 14, i1 false)
%2 = tail call i32 @puts(i8* dereferenceable(1) %1)
tail call void @free(i8* %1)
ret i32 0
}
int find_eob(short *x) {
  int idx = 0;
  for (int i = 0; i < 64; ++i) {
    if (x[i] != 0) {
      idx = i + 1;
    }
  }
  return idx;
}


x86 assembly (clang, -O0):
<find_eob>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x40,-0x10(%rbp)
jge    1151 <find_eob+0x51>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movswl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
je     113e <find_eob+0x3e>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <find_eob+0x43>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <find_eob+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_eob>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpw   $0x0,(%rdi,%rcx,2)
lea    0x1(%rcx),%edx
cmove  %eax,%edx
lea    0x2(%rcx),%esi
cmpw   $0x0,0x2(%rdi,%rcx,2)
cmove  %edx,%esi
lea    0x3(%rcx),%eax
cmpw   $0x0,0x4(%rdi,%rcx,2)
cmove  %esi,%eax
cmpw   $0x0,0x6(%rdi,%rcx,2)
lea    0x4(%rcx),%rdx
cmovne %edx,%eax
mov    %rdx,%rcx
cmp    $0x40,%rdx
jne    1110 <find_eob+0x10>
ret

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

LLVM IR (-O2):
define i32 @find_eob(i16* nocapture %0) {
br label %3
2: ; preds = %3
ret i32 %29
3: ; preds = %3, %1
%4 = phi i64 [ 0, %1 ], [ %27, %3 ]
%5 = phi i32 [ 0, %1 ], [ %29, %3 ]
%6 = getelementptr inbounds i16, i16* %0, i64 %4
%7 = load i16, i16* %6
%8 = icmp eq i16 %7, 0
%9 = or i64 %4, 1
%10 = trunc i64 %9 to i32
%11 = select i1 %8, i32 %5, i32 %10
%12 = getelementptr inbounds i16, i16* %0, i64 %9
%13 = load i16, i16* %12
%14 = icmp eq i16 %13, 0
%15 = or i64 %4, 2
%16 = trunc i64 %15 to i32
%17 = select i1 %14, i32 %11, i32 %16
%18 = getelementptr inbounds i16, i16* %0, i64 %15
%19 = load i16, i16* %18
%20 = icmp eq i16 %19, 0
%21 = or i64 %4, 3
%22 = trunc i64 %21 to i32
%23 = select i1 %20, i32 %17, i32 %22
%24 = getelementptr inbounds i16, i16* %0, i64 %21
%25 = load i16, i16* %24
%26 = icmp eq i16 %25, 0
%27 = add nuw nsw i64 %4, 4
%28 = trunc i64 %27 to i32
%29 = select i1 %26, i32 %23, i32 %28
%30 = icmp eq i64 %27, 64
br i1 %30, label %2, label %3
}
/* Variables and functions */
size_t cwk_path_join_and_normalize_multiple(char const **, char *, size_t);
size_t cwk_path_normalize(const char *path, char *buffer, size_t buffer_size) {
  const char *paths[2];
  paths[0] = path;
  paths[1] = NULL;
  return cwk_path_join_and_normalize_multiple(paths, buffer, buffer_size);
}


x86 assembly (clang, -O0):
<cwk_path_normalize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <cwk_path_join_and_normalize_multiple@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwk_path_normalize>:
sub    $0x18,%rsp
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rdi
call   1030 <cwk_path_join_and_normalize_multiple@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i64 @cwk_path_normalize(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca [2 x i8*]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
store i8* %8, i8** %9
%10 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 1
store i8* null, i8** %10
%11 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i64 @cwk_path_join_and_normalize_multiple(i8** %11, i8* %12, i64 %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @cwk_path_normalize(i8* %0, i8* %1, i64 %2) {
%4 = alloca [2 x i8*]
%5 = bitcast [2 x i8*]* %4 to i8*
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
store i8* %0, i8** %6
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 1
store i8* null, i8** %7
%8 = call i64 @cwk_path_join_and_normalize_multiple(i8** %6, i8* %1, i64 %2)
ret i64 %8
}
UpdateDisplay(f, t, flag, iscastle) short f, t, flag, iscastle;
{}


x86 assembly (clang, -O0):
<UpdateDisplay>:
push   %rbp
mov    %rsp,%rbp
mov    %ecx,%eax
mov    %edx,%ecx
mov    %esi,%edx
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @UpdateDisplay(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
%10 = trunc i32 %0 to i16
%11 = trunc i32 %1 to i16
%12 = trunc i32 %2 to i16
%13 = trunc i32 %3 to i16
store i16 %10, i16* %6
store i16 %11, i16* %7
store i16 %12, i16* %8
store i16 %13, i16* %9
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @UpdateDisplay(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 undef
}
main() {
  f(1 << 35);
  f(1U << 35);
  f(1L << 35);
  f(1LU << 35);
  f(1ULL << 35);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <f@plt>
mov    $0x0,%al
call   1030 <f@plt>
movabs $0x800000000,%rdi
mov    $0x0,%al
call   1030 <f@plt>
movabs $0x800000000,%rdi
mov    $0x0,%al
call   1030 <f@plt>
movabs $0x800000000,%rdi
mov    $0x0,%al
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
call   1030 <f@plt>
movabs $0x800000000,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <f@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <f@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 poison)
%2 = call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 poison)
%3 = call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 34359738368)
%4 = call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 34359738368)
%5 = call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 34359738368)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 poison)
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @f to i32 (i32, ...)*)(i32 poison)
%3 = tail call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 34359738368)
%4 = tail call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 34359738368)
%5 = tail call i32 (i64, ...) bitcast (i32 (...)* @f to i32 (i64, ...)*)(i64 34359738368)
ret i32 0
}