xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ConvertToReversePolish(char *);
int InterpretReversePolish();
int EvaluateExpression(char *Expression) {
  ConvertToReversePolish(Expression);
  return InterpretReversePolish();
}


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

x86 assembly (clang, -O2):
<EvaluateExpression>:
push   %rax
call   1040 <ConvertToReversePolish@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <InterpretReversePolish@plt>

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

LLVM IR (-O2):
define i32 @EvaluateExpression(i8* %0) {
%2 = tail call i32 @ConvertToReversePolish(i8* %0)
%3 = tail call i32 (...) @InterpretReversePolish()
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sargv;

/* Variables and functions */
int /*<<< orphan*/ anal_command(int, char **);
int make_argv(char *, int, char **);
void exec_mon_cmd(char *ptr) {
  char *sargv[10];
  int sargc;
  sargc = make_argv(ptr, sizeof(sargv) / sizeof(sargv[0]), sargv);
  if (sargc != 0)
    anal_command(sargc, sargv);
}


x86 assembly (clang, -O0):
<exec_mon_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rdx
mov    $0xa,%esi
call   1040 <make_argv@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1157 <exec_mon_cmd+0x37>
mov    -0x64(%rbp),%edi
lea    -0x60(%rbp),%rsi
call   1030 <anal_command@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_mon_cmd>:
sub    $0x58,%rsp
mov    %rsp,%rdx
mov    $0xa,%esi
call   1040 <make_argv@plt>
test   %eax,%eax
je     113f <exec_mon_cmd+0x1f>
mov    %rsp,%rsi
mov    %eax,%edi
call   1030 <anal_command@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
define void @exec_mon_cmd(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8*]
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%7 = call i32 @make_argv(i8* %5, i32 10, i8** %6)
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %4
%12 = getelementptr inbounds [10 x i8*], [10 x i8*]* %3, i64 0, i64 0
%13 = call i32 @anal_command(i32 %11, i8** %12)
br label %14
14: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
define void @exec_mon_cmd(i8* %0) {
%2 = alloca [10 x i8*]
%3 = bitcast [10 x i8*]* %2 to i8*
%4 = getelementptr inbounds [10 x i8*], [10 x i8*]* %2, i64 0, i64 0
%5 = call i32 @make_argv(i8* %0, i32 10, i8** %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @anal_command(i32 %5, i8** %4)
br label %9
9: ; preds = %7, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
void on_open() { printf("lid opened, %d\n", time(NULL)); }


x86 assembly (clang, -O0):
<on_open>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_open>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"lid opened, %d\0A\00"
define void @on_open() {
%1 = call i32 @time(i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"lid opened, %d\0A\00"
define void @on_open() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int DRV_BACKUP_SYS_FILE(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_BACKUP_SYS_FILE() {
ret i32 0
}
void abort(void) {
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <abort+0x9>
jmp    1109 <abort+0x9>

x86 assembly (clang, -O2):
<abort>:
jmp    1100 <abort>

LLVM IR (-O0):
define void @abort() {
br label %1
1: ; preds = %1, %0
br label %1
}

LLVM IR (-O2):
define void @abort() {
br label %1
1: ; preds = %1, %0
br label %1
}
extern int evaluationClose(void *data) {
  (void)data;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @evaluationClose(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int padcon_get_dobldobl_hessian_step(double *step) {
  int fail;
  int precision = 1;
  int *b;
  fail = _ada_use_c2phc4c(888, &precision, b, step, 0);
  return fail;
}


x86 assembly (clang, -O0):
<padcon_get_dobldobl_hessian_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    $0x378,%edi
lea    -0x10(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<padcon_get_dobldobl_hessian_step>:
push   %rax
mov    %rdi,%rcx
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x378,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @padcon_get_dobldobl_hessian_step(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store double* %0, double** %2
store i32 1, i32* %4
%6 = load i32*, i32** %5
%7 = load double*, double** %2
%8 = call i32 @_ada_use_c2phc4c(i32 888, i32* %4, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @padcon_get_dobldobl_hessian_step(double* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = call i32 @_ada_use_c2phc4c(i32 888, i32* %2, i32* undef, double* %0, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ COLS;
int /*<<< orphan*/ LINES;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  srand(time(NULL));
  initscr();
  printw("Window size is %d,%d (row,col).\n", LINES, COLS);
  refresh();
  getch();
  endwin();
  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   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1030 <initscr@plt>
mov    0x2e4b(%rip),%rax
mov    (%rax),%esi
mov    0x2e3a(%rip),%rax
mov    (%rax),%edx
lea    0xe51(%rip),%rdi
call   1050 <printw@plt>
mov    $0x0,%al
call   1070 <refresh@plt>
mov    $0x0,%al
call   1080 <getch@plt>
mov    $0x0,%al
call   1090 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1030 <initscr@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%esi
mov    0x2e4a(%rip),%rax
mov    (%rax),%edx
lea    0xe61(%rip),%rdi
call   1050 <printw@plt>
xor    %eax,%eax
call   1070 <refresh@plt>
xor    %eax,%eax
call   1080 <getch@plt>
xor    %eax,%eax
call   1090 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Window size is %d,%d (row,col).\0A\00"
@LINES = global i32 0
@COLS = global i32 0
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 (...) @initscr()
%5 = load i32, i32* @LINES
%6 = load i32, i32* @COLS
%7 = call i32 @printw(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @getch()
%10 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Window size is %d,%d (row,col).\0A\00"
@LINES = global i32 0
@COLS = global i32 0
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @initscr()
%4 = load i32, i32* @LINES
%5 = load i32, i32* @COLS
%6 = tail call i32 @printw(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = tail call i32 (...) @refresh()
%8 = tail call i32 (...) @getch()
%9 = tail call i32 (...) @endwin()
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char intToBCD(uint8_t num) {
  return (((num / 10) << 4) & 0xF0) + ((num % 10) & 0x0F);
}


x86 assembly (clang, -O0):
<intToBCD>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
and    $0xf0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
and    $0xf,%edx
add    %edx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToBCD>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
and    $0xf,%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @intToBCD(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = and i32 %5, 240
%7 = load i32, i32* %2
%8 = srem i32 %7, 10
%9 = and i32 %8, 15
%10 = add nsw i32 %6, %9
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @intToBCD(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = and i32 %4, 15
%6 = or i32 %3, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}
void foo38() {}


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

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

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

LLVM IR (-O2):
define void @foo38() {
ret void
}
void link_error7() {}


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

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

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

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

/* Variables and functions */
int syscall_cp(int, int /*<<< orphan*/ const *, int);
int sigsuspend(const sigset_t *mask) { return syscall_cp(179, mask, 8); }


x86 assembly (clang, -O0):
<sigsuspend>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0xb3,%edi
mov    $0x8,%edx
call   1030 <syscall_cp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigsuspend>:
mov    %rdi,%rsi
mov    $0xb3,%edi
mov    $0x8,%edx
jmp    1030 <syscall_cp@plt>

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

LLVM IR (-O2):
define i32 @sigsuspend(i32* %0) {
%2 = tail call i32 @syscall_cp(i32 179, i32* %0, i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ MUSIC_Pause();
void MUS_PauseSong(int handle) { MUSIC_Pause(); }


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

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

LLVM IR (-O0):
define void @MUS_PauseSong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @MUSIC_Pause()
ret void
}

LLVM IR (-O2):
define void @MUS_PauseSong(i32 %0) {
%2 = tail call i32 (...) @MUSIC_Pause()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t getArrayI(int32_t *arr, int idx) { return arr[idx]; }


x86 assembly (clang, -O0):
<getArrayI>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getArrayI>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @getArrayI(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @getArrayI(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
double exp(float);
float raw_sigmoid_function(float x) { return 1.0 / (1.0 + exp(-x)); }


x86 assembly (clang, -O0):
<raw_sigmoid_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
movsd  0xec4(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  0xeb8(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_sigmoid_function>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
addsd  %xmm1,%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @raw_sigmoid_function(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
%5 = call double @exp(float %4)
%6 = fadd double 1.000000e+00, %5
%7 = fdiv double 1.000000e+00, %6
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @raw_sigmoid_function(float %0) {
%2 = fneg float %0
%3 = tail call double @exp(float %2)
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fptrunc double %5 to float
ret float %6
}
/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ munmap(void *, size_t);
void unmapmem(void **pmem, size_t size) {
  if (*pmem == MAP_FAILED) {
    return;
  }
  munmap(*pmem, size);
  *pmem = MAP_FAILED;
}


x86 assembly (clang, -O0):
<unmapmem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x2eb2(%rip),%rcx
cmp    (%rcx),%rax
jne    113c <unmapmem+0x2c>
jmp    115d <unmapmem+0x4d>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <munmap@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unmapmem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    0x2ebf(%rip),%r14
cmp    (%r14),%rdi
je     1131 <unmapmem+0x21>
call   1030 <munmap@plt>
mov    (%r14),%rax
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@MAP_FAILED = global i8* null
define void @unmapmem(i8** %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 = load i8*, i8** %5
%7 = load i8*, i8** @MAP_FAILED
%8 = icmp eq i8* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
br label %17
10: ; preds = %2
%11 = load i8**, i8*** %3
%12 = load i8*, i8** %11
%13 = load i64, i64* %4
%14 = call i32 @munmap(i8* %12, i64 %13)
%15 = load i8*, i8** @MAP_FAILED
%16 = load i8**, i8*** %3
store i8* %15, i8** %16
br label %17
17: ; preds = %10, %9
ret void
}

LLVM IR (-O2):
@MAP_FAILED = global i8* null
define void @unmapmem(i8** nocapture %0, i64 %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** @MAP_FAILED
%5 = icmp eq i8* %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @munmap(i8* %3, i64 %1)
%8 = load i8*, i8** @MAP_FAILED
store i8* %8, i8** %0
br label %9
9: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Pop();
int /*<<< orphan*/ Push(int /*<<< orphan*/);
int CmdUnaryMinus(void) {
  Push(-Pop());
  return 0;
}


x86 assembly (clang, -O0):
<CmdUnaryMinus>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <Pop@plt>
xor    %edi,%edi
sub    %eax,%edi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdUnaryMinus>:
push   %rax
xor    %eax,%eax
call   1030 <Pop@plt>
neg    %eax
mov    %eax,%edi
call   1040 <Push@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CmdUnaryMinus() {
%1 = call i32 (...) @Pop()
%2 = sub nsw i32 0, %1
%3 = call i32 @Push(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @CmdUnaryMinus() {
%1 = tail call i32 (...) @Pop()
%2 = sub nsw i32 0, %1
%3 = tail call i32 @Push(i32 %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_generic_event_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int format_event(int /*<<< orphan*/ *);
int dbg_handle_event(void *ignored, xcb_connection_t *c,
                     xcb_generic_event_t *e) {
  return format_event(e);
}


x86 assembly (clang, -O0):
<dbg_handle_event>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <format_event@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_handle_event>:
mov    %rdx,%rdi
jmp    1030 <format_event@plt>

LLVM IR (-O0):
define i32 @dbg_handle_event(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = call i32 @format_event(i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @dbg_handle_event(i8* nocapture readnone %0, i32* nocapture readnone %1, i32* %2) {
%4 = tail call i32 @format_event(i32* %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char getc(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
int /*<<< orphan*/ ungetc(char, int /*<<< orphan*/ *);
void __scan_space(FILE *stream) {
  char c;
  while (isspace(c = getc(stream)))
    ;
  ungetc(c, stream);
}


x86 assembly (clang, -O0):
<__scan_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     115f <__scan_space+0x2f>
jmp    113c <__scan_space+0xc>
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
movsbl %al,%edi
call   1040 <ungetc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__scan_space>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <getc@plt>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <isspace@plt>
test   %rax,%rax
jne    1140 <__scan_space+0x10>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <ungetc@plt>

LLVM IR (-O0):
define void @__scan_space(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
br label %4
4: ; preds = %9, %1
%5 = load i32*, i32** %2
%6 = call signext i8 @getc(i32* %5)
store i8 %6, i8* %3
%7 = call i64 @isspace(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %3
%12 = load i32*, i32** %2
%13 = call i32 @ungetc(i8 signext %11, i32* %12)
ret void
}

LLVM IR (-O2):
define void @__scan_space(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 @getc(i32* %0)
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
%7 = tail call i32 @ungetc(i8 signext %3, i32* %0)
ret void
}
/* Variables and functions */
int minCost(int **, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int cost[3][3] = {{1, 2, 3}, {4, 8, 2}, {1, 5, 3}};
  printf("%d \n", minCost(cost, 2, 2));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x24,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <minCost@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <minCost@plt>
lea    0xec6(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.cost = [3 x [3 x i32]] [[3 x i32] [i32 1, i32 2, i32 3], [3 x i32] [i32 4, i32 8, i32 2], [3 x i32] [i32 1, i32 5, i32 3]]
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca [3 x [3 x i32]]
%2 = bitcast [3 x [3 x i32]]* %1 to i8*
%3 = bitcast [3 x [3 x i32]]* %1 to i32**
%4 = call i32 @minCost(i32** %3, i32 2, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void nonpreload_test2() { printf("Test2: intercept called - success\n"); }


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"Test2: intercept called - success\0A\00"
define void @nonpreload_test2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"Test2: intercept called - success\00"
define void @nonpreload_test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free_events();
void event_exit(void) { free_events(); }


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

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

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

LLVM IR (-O2):
define void @event_exit() {
%1 = tail call i32 (...) @free_events()
ret void
}
void pendfunc2(int x) {
  asm("    .global "
      "set_point2"
      "\n"
      "set_point2"
      ":\n"
      "    call "
      "foo"
      "\n");
}


x86 assembly (clang, -O0):
<pendfunc2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)

x86 assembly (clang, -O2):
<pendfunc2>:
call   1030 <foo@plt>
ret

LLVM IR (-O0):
define void @pendfunc2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret void
}

LLVM IR (-O2):
define void @pendfunc2(i32 %0) {
tail call void asm sideeffect " .global set_point2\0Aset_point2:\0A call foo\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(char, int);
int ioctl(int, int /*<<< orphan*/);
int nvme_verify_chr(int);
int nvme_ns_rescan(int fd) {
  int ret;
  ret = nvme_verify_chr(fd);
  if (ret)
    return ret;
  return ioctl(fd, _IO('N', 0x46));
}


x86 assembly (clang, -O0):
<nvme_ns_rescan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <nvme_verify_chr@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115b <nvme_ns_rescan+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117d <nvme_ns_rescan+0x4d>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x4e,%edi
mov    $0x46,%esi
call   1030 <_IO@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvme_ns_rescan>:
push   %rbx
mov    %edi,%ebx
call   1050 <nvme_verify_chr@plt>
test   %eax,%eax
je     113e <nvme_ns_rescan+0xe>
pop    %rbx
ret
mov    $0x4e,%edi
mov    $0x46,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @nvme_ns_rescan(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @nvme_verify_chr(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @_IO(i8 signext 78, i32 70)
%14 = call i32 @ioctl(i32 %12, i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @nvme_ns_rescan(i32 %0) {
%2 = tail call i32 @nvme_verify_chr(i32 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @_IO(i8 signext 78, i32 70)
%6 = tail call i32 @ioctl(i32 %0, i32 %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ %2, %1 ]
ret i32 %8
}
/* Variables and functions */
int Log2Ceil(unsigned long);
unsigned long NextPowerOfTwo(unsigned long x) { return 1 << Log2Ceil(x); }


x86 assembly (clang, -O0):
<NextPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Log2Ceil@plt>
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NextPowerOfTwo>:
push   %rax
call   1030 <Log2Ceil@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%edx
movslq %edx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @NextPowerOfTwo(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @Log2Ceil(i64 %3)
%5 = shl i32 1, %4
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @NextPowerOfTwo(i64 %0) {
%2 = tail call i32 @Log2Ceil(i64 %0)
%3 = shl nuw i32 1, %2
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int err_syntax12_parse();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("yyparse() = %d\n", err_syntax12_parse());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [16 x i8] c"yyparse() = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @err_syntax12_parse()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void xcsv_read_internal_style(const char *style_buf) {}


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

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

LLVM IR (-O0):
define void @xcsv_read_internal_style(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @xcsv_read_internal_style(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int d, e;
  unsigned int getbits(unsigned int, int, int);
  d = 11;
  e = getbits(d, 3, 2);
  printf("%u\n", e);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xb,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1040 <getbits@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xb,%edi
mov    $0x3,%esi
mov    $0x2,%edx
call   1040 <getbits@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @getbits(i32 11, i32 3, i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int numberOfPlayersInZone(short, short *);
char checkIfZoneFighting(short zone, short *world) {
  if (numberOfPlayersInZone(zone, world) > 1) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkIfZoneFighting>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ax
mov    -0x10(%rbp),%rsi
movswl %ax,%edi
call   1030 <numberOfPlayersInZone@plt>
cmp    $0x1,%eax
jle    1145 <checkIfZoneFighting+0x35>
movb   $0x1,-0x1(%rbp)
jmp    1149 <checkIfZoneFighting+0x39>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkIfZoneFighting>:
push   %rax
call   1030 <numberOfPlayersInZone@plt>
cmp    $0x2,%eax
setge  %al
pop    %rcx
ret

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

LLVM IR (-O2):
define signext i8 @checkIfZoneFighting(i16 signext %0, i16* %1) {
%3 = tail call i32 @numberOfPlayersInZone(i16 signext %0, i16* %1)
%4 = icmp sgt i32 %3, 1
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ my_is_prime(int);
int my_find_prime_sup(int nb) {
  if (nb < 2)
    nb = 2;
  while (!my_is_prime(nb))
    ++nb;
  return (nb);
}


x86 assembly (clang, -O0):
<my_find_prime_sup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    112c <my_find_prime_sup+0x1c>
movl   $0x2,-0x4(%rbp)
jmp    1131 <my_find_prime_sup+0x21>
mov    -0x4(%rbp),%edi
call   1030 <my_is_prime@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114e <my_find_prime_sup+0x3e>
jmp    115c <my_find_prime_sup+0x4c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1131 <my_find_prime_sup+0x21>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_find_prime_sup>:
push   %rbx
cmp    $0x3,%edi
mov    $0x2,%ebx
cmovge %edi,%ebx
nopl   0x0(%rax)
mov    %ebx,%edi
call   1030 <my_is_prime@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1120 <my_find_prime_sup+0x10>
add    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @my_find_prime_sup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 2
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 2, i32* %2
br label %6
6: ; preds = %5, %1
br label %7
7: ; preds = %12, %6
%8 = load i32, i32* %2
%9 = call i32 @my_is_prime(i32 %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %2
%14 = add nsw i32 %13, 1
store i32 %14, i32* %2
br label %7
15: ; preds = %7
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @my_find_prime_sup(i32 %0) {
%2 = icmp sgt i32 %0, 2
%3 = select i1 %2, i32 %0, i32 2
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %3, %1 ], [ %8, %4 ]
%6 = tail call i32 @my_is_prime(i32 %5)
%7 = icmp eq i32 %6, 0
%8 = add nuw nsw i32 %5, 1
br i1 %7, label %4, label %9
9: ; preds = %4
ret i32 %5
}
int test_imm_34int32_reg(int val) { return ((val) & (0x34 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_34int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x34,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_34int32_reg>:
test   $0x34,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_34int32_reg(i32 %0) {
%2 = and i32 %0, 52
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int errno;
int syscall(int, int, int, int /*<<< orphan*/, int /*<<< orphan*/,
            int /*<<< orphan*/);
pid_t getsid(pid_t p) {
  int ret = syscall(60, 1, p, 0, 0, 0);
  if (ret < 0) {
    errno = -ret;
    return -1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<getsid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x3c,%edi
mov    $0x1,%esi
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <syscall@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    115d <getsid+0x4d>
xor    %ecx,%ecx
sub    -0xc(%rbp),%ecx
mov    0x2e91(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <getsid+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsid>:
push   %rax
mov    %edi,%edx
mov    $0x3c,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <syscall@plt>
test   %eax,%eax
js     1130 <getsid+0x20>
pop    %rcx
ret
neg    %eax
mov    0x2ea7(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @getsid(i32 %0) {
%2 = tail call i32 @syscall(i32 60, i32 1, i32 %0, i32 0, i32 0, i32 0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = sub nsw i32 0, %2
store i32 %5, i32* @errno
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ %2, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ stop();
void stop_sig(int signal) {
  stop();
  exit(0);
}


x86 assembly (clang, -O0):
<stop_sig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <stop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop_sig>:
push   %rax
xor    %eax,%eax
call   1030 <stop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @stop_sig(i32 %0) {
%2 = tail call i32 (...) @stop()
%3 = tail call i32 @exit(i32 0)
unreachable
}
int getDebugChar(void) {
  char c;
  while (((*((char *)0xe0000)) & 11) != 11)
    ;
  c = *((char *)0xe0000 + 2);
  return c;
}


x86 assembly (clang, -O0):
<getDebugChar>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0000,%eax
movsbl (%rax),%eax
and    $0xb,%eax
cmp    $0xb,%eax
je     111d <getDebugChar+0x1d>
jmp    1104 <getDebugChar+0x4>
mov    $0xe0000,%eax
mov    0x2(%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDebugChar>:
mov    0xe0000,%al
not    %al
test   $0xb,%al
jne    1120 <getDebugChar+0x20>
movsbl 0xe0002,%eax
ret
cs nopw 0x0(%rax,%rax,1)
jmp    1120 <getDebugChar+0x20>

LLVM IR (-O0):
define i32 @getDebugChar() {
%1 = alloca i8
br label %2
2: ; preds = %7, %0
%3 = load i8, i8* inttoptr (i64 917504 to i8*)
%4 = sext i8 %3 to i32
%5 = and i32 %4, 11
%6 = icmp ne i32 %5, 11
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
%9 = load i8, i8* getelementptr inbounds (i8, i8* inttoptr (i64 917504 to i8*), i64 2)
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @getDebugChar() {
%1 = load i8, i8* inttoptr (i64 917504 to i8*)
%2 = and i8 %1, 11
%3 = icmp eq i8 %2, 11
br i1 %3, label %5, label %4
4: ; preds = %0, %4
br label %4
5: ; preds = %0
%6 = load i8, i8* inttoptr (i64 917506 to i8*)
%7 = sext i8 %6 to i32
ret i32 %7
}
int is_space(char c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <is_space+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_space(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_space(i8 signext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
pid_t setsid(void) {
  assert(!"NYI");
  return -1;
}


x86 assembly (clang, -O0):
<setsid>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setsid>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"NYI\00"
define i32 @setsid() {
%1 = call i32 @assert(i32 0)
ret i32 -1
}

LLVM IR (-O2):
define i32 @setsid() {
%1 = tail call i32 @assert(i32 0)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xa2() {
  Assert_real((isbdigit(162) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              815, ("isbdigit should be 0 for 0xa2"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xa2>:
push   %rax
mov    $0xa2,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x32f,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa2\00"
define void @t_isbdigit_0xa2() {
%1 = call i64 @isbdigit(i32 162)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 815, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xa2\00"
define void @t_isbdigit_0xa2() {
%1 = tail call i64 @isbdigit(i32 162)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 815, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void rpn_remove_ext(char *s) {
  int _i, _j;
  _i = _j = 0;
  while (s[_i] != '\0') {
    if (s[_i] == '.') {
      _j = _i;
    }
    _i++;
  }
  if (_j != 0) {
    s[_j] = '\0';
  }
}


x86 assembly (clang, -O0):
<rpn_remove_ext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1154 <rpn_remove_ext+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1146 <rpn_remove_ext+0x46>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <rpn_remove_ext+0x16>
cmpl   $0x0,-0x10(%rbp)
je     116a <rpn_remove_ext+0x6a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_remove_ext>:
xor    %eax,%eax
xor    %ecx,%ecx
jmp    1116 <rpn_remove_ext+0x16>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
add    $0x1,%rax
movzbl (%rdi,%rax,1),%edx
cmp    $0x2e,%dl
je     1110 <rpn_remove_ext+0x10>
test   %dl,%dl
jne    1112 <rpn_remove_ext+0x12>
test   %ecx,%ecx
je     112e <rpn_remove_ext+0x2e>
movslq %ecx,%rax
movb   $0x0,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @rpn_remove_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %23, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %26
13: ; preds = %5
%14 = load i8*, i8** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 46
br i1 %20, label %21, label %23
21: ; preds = %13
%22 = load i32, i32* %3
store i32 %22, i32* %4
br label %23
23: ; preds = %21, %13
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %5
26: ; preds = %5
%27 = load i32, i32* %4
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i8*, i8** %2
%31 = load i32, i32* %4
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i8, i8* %30, i64 %32
store i8 0, i8* %33
br label %34
34: ; preds = %29, %26
ret void
}

LLVM IR (-O2):
define void @rpn_remove_ext(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %11, %9 ], [ 0, %1 ]
%4 = phi i32 [ %10, %9 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %3
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %12
i8 46, label %7
]
7: ; preds = %2
%8 = trunc i64 %3 to i32
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ %8, %7 ], [ %4, %2 ]
%11 = add nuw i64 %3, 1
br label %2
12: ; preds = %2
%13 = icmp eq i32 %4, 0
br i1 %13, label %17, label %14
14: ; preds = %12
%15 = sext i32 %4 to i64
%16 = getelementptr inbounds i8, i8* %0, i64 %15
store i8 0, i8* %16
br label %17
17: ; preds = %14, %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fn_d() {
  printf("fn_d() called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"fn_d() called\0A\00"
define i32 @fn_d() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"fn_d() called\00"
define i32 @fn_d() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MIDI_SetContext(int);
void MUSIC_SetContext(int context) { MIDI_SetContext(context); }


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

x86 assembly (clang, -O2):
<MUSIC_SetContext>:
jmp    1030 <MIDI_SetContext@plt>

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

LLVM IR (-O2):
define void @MUSIC_SetContext(i32 %0) {
%2 = tail call i32 @MIDI_SetContext(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_nvector(double *vector) { free(vector); }


x86 assembly (clang, -O0):
<free_nvector>:
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):
<free_nvector>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_nvector(double* nocapture %0) {
%2 = tail call i32 @free(double* %0)
ret void
}