xunge/DecIR huggingface dataset:
/* Variables and functions */
int SPI_3WIRE;
int SPI_getMode(int);
int SPI_setMode(int, int);
int SPI_disable3Wire(int spidev_fd) {
  int mode = SPI_getMode(spidev_fd);
  if (mode < 0)
    return -1;
  return SPI_setMode(spidev_fd, mode & ~SPI_3WIRE);
}


x86 assembly (clang, -O0):
<SPI_disable3Wire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <SPI_getMode@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    114c <SPI_disable3Wire+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <SPI_disable3Wire+0x48>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    0x2e8f(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <SPI_setMode@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_disable3Wire>:
push   %rbx
mov    %edi,%ebx
call   1040 <SPI_getMode@plt>
test   %eax,%eax
js     1143 <SPI_disable3Wire+0x23>
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%ecx
not    %ecx
and    %ecx,%eax
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <SPI_setMode@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@SPI_3WIRE = global i32 0
define i32 @SPI_disable3Wire(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @SPI_getMode(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %17
10: ; preds = %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* @SPI_3WIRE
%14 = xor i32 %13, -1
%15 = and i32 %12, %14
%16 = call i32 @SPI_setMode(i32 %11, i32 %15)
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@SPI_3WIRE = global i32 0
define i32 @SPI_disable3Wire(i32 %0) {
%2 = tail call i32 @SPI_getMode(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = load i32, i32* @SPI_3WIRE
%6 = xor i32 %5, -1
%7 = and i32 %2, %6
%8 = tail call i32 @SPI_setMode(i32 %0, i32 %7)
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ -1, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ copy_stack_frame();
int /*<<< orphan*/ new_prof_frame(int);
void copy_stack_frame_sp(void) {
  copy_stack_frame();
  new_prof_frame(1);
}


x86 assembly (clang, -O0):
<copy_stack_frame_sp>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <copy_stack_frame@plt>
mov    $0x1,%edi
call   1030 <new_prof_frame@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_stack_frame_sp>:
push   %rax
xor    %eax,%eax
call   1040 <copy_stack_frame@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <new_prof_frame@plt>

LLVM IR (-O0):
define void @copy_stack_frame_sp() {
%1 = call i32 (...) @copy_stack_frame()
%2 = call i32 @new_prof_frame(i32 1)
ret void
}

LLVM IR (-O2):
define void @copy_stack_frame_sp() {
%1 = tail call i32 (...) @copy_stack_frame()
%2 = tail call i32 @new_prof_frame(i32 1)
ret void
}
void htextang_(ang) float *ang;
{ htextang(*ang); }


x86 assembly (clang, -O0):
<htextang_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1030 <htextang@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htextang_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
jmp    1030 <htextang@plt>

LLVM IR (-O0):
define void @htextang_(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = call i32 (double, ...) bitcast (i32 (...)* @htextang to i32 (double, ...)*)(double %5)
ret void
}

LLVM IR (-O2):
define void @htextang_(float* nocapture %0) {
%2 = load float, float* %0
%3 = fpext float %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @htextang to i32 (double, ...)*)(double %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ foo_monitor();
int main(int argc, char **argv) {
  int i, x, y;
  i = 0;
  x = 0;
  y = 5;
  for (; i < y; ++i) {
    x += y;
  }
  if (argc >= 2) {
    foo_monitor();
  } else {
    foo();
  }
  ++x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x5,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    116e <main+0x4e>
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
cmpl   $0x2,-0x8(%rbp)
jl     1184 <main+0x64>
mov    $0x0,%al
call   1030 <foo_monitor@plt>
jmp    118b <main+0x6b>
mov    $0x0,%al
call   1040 <foo@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
cmp    $0x2,%edi
jl     112f <main+0xf>
call   1030 <foo_monitor@plt>
jmp    1134 <main+0x14>
call   1040 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @foo_monitor()
br label %8
6: ; preds = %2
%7 = tail call i32 (...) @foo()
br label %8
8: ; preds = %6, %4
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int off_t;

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
off_t qfile_get_size(const char *filepath) {
  struct stat finfo;
  if (stat(filepath, &finfo) < 0)
    return -1;
  return finfo.st_size;
}


x86 assembly (clang, -O0):
<qfile_get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jge    113f <qfile_get_size+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <qfile_get_size+0x35>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfile_get_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
js     1129 <qfile_get_size+0x19>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @qfile_get_size(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
store i32 %11, i32* %2
br label %12
12: ; preds = %9, %8
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @qfile_get_size(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i64 %4, 0
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
unsigned int average(unsigned int a, unsigned int b) {
  return a / 2 + b / 2 + (a % 2 + b % 2) / 2;
}


x86 assembly (clang, -O0):
<average>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    -0x8(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0x1,%ecx
mov    -0x8(%rbp),%edx
and    $0x1,%edx
add    %edx,%ecx
shr    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<average>:
mov    %edi,%eax
shr    %eax
mov    %esi,%ecx
shr    %ecx
add    %eax,%ecx
and    $0x1,%edi
and    $0x1,%esi
lea    (%rsi,%rdi,1),%eax
shr    %eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @average(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 = udiv i32 %5, 2
%7 = load i32, i32* %4
%8 = udiv i32 %7, 2
%9 = add i32 %6, %8
%10 = load i32, i32* %3
%11 = urem i32 %10, 2
%12 = load i32, i32* %4
%13 = urem i32 %12, 2
%14 = add i32 %11, %13
%15 = udiv i32 %14, 2
%16 = add i32 %9, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @average(i32 %0, i32 %1) {
%3 = lshr i32 %0, 1
%4 = lshr i32 %1, 1
%5 = add nuw i32 %4, %3
%6 = and i32 %0, 1
%7 = and i32 %1, 1
%8 = add nuw nsw i32 %7, %6
%9 = lshr i32 %8, 1
%10 = add nuw i32 %5, %9
ret i32 %10
}
unsigned char _is_bracket_char(char c) { return (c == '(') || (c == ')'); }


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

x86 assembly (clang, -O2):
<_is_bracket_char>:
and    $0xfe,%dil
cmp    $0x28,%dil
sete   %al
ret

LLVM IR (-O0):
define zeroext i8 @_is_bracket_char(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, 40
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, 41
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define zeroext i8 @_is_bracket_char(i8 signext %0) {
%2 = and i8 %0, -2
%3 = icmp eq i8 %2, 40
%4 = zext i1 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void testdlr_deeplib2_func() {
  printf("testdlr_deeplib2: testdlr_deeplib2_func() called\n");
}


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

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

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

LLVM IR (-O2):
@str = [49 x i8] c"testdlr_deeplib2: testdlr_deeplib2_func() called\00"
define void @testdlr_deeplib2_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str, i64 0, i64 0))
ret void
}
void emit_nat32(struct processor_explicatory_state *process_state,
                struct modern_stream *stream, void *stream_state,
                struct modern_vfile *vfile, void *vfile_state) {}


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

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_nat32(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_nat32(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLsizei;

/* Variables and functions */
int /*<<< orphan*/ GL_MODELVIEW;
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void reshape(int w, int h) {
  glViewport(0, 0, (GLsizei)w, (GLsizei)h);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
}


x86 assembly (clang, -O0):
<reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1050 <glViewport@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reshape>:
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <glViewport@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <glLoadIdentity@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* @GL_MODELVIEW
%12 = call i32 @glMatrixMode(i32 %11)
%13 = call i32 (...) @glLoadIdentity()
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
@GL_MODELVIEW = global i32 0
define void @reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = load i32, i32* @GL_MODELVIEW
%8 = tail call i32 @glMatrixMode(i32 %7)
%9 = tail call i32 (...) @glLoadIdentity()
ret void
}
void terminal_action_null(int c, void (*process_line)(char *line)) {}


x86 assembly (clang, -O0):
<terminal_action_null>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @terminal_action_null(i32 %0, void (i8*)* nocapture %1) {
ret void
}
__attribute__((pure)) _Complex short foo_short(int x) {
  _Complex short r;
  __real r = x + 1;
  __imag r = x - 1;
  return r;
}


x86 assembly (clang, -O0):
<foo_short>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %ax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %ax,-0xe(%rbp)
mov    -0x10(%rbp),%cx
mov    -0xe(%rbp),%ax
mov    %cx,-0x8(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_short>:
lea    0x1(%rdi),%eax
shl    $0x10,%edi
movzwl %ax,%eax
add    %edi,%eax
add    $0xffff0000,%eax
ret

LLVM IR (-O0):
define i32 @foo_short(i32 %0) {
%2 = alloca { i16, i16 }
%3 = alloca i32
%4 = alloca { i16, i16 }
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = trunc i32 %6 to i16
%8 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %4, i32 0, i32 0
store i16 %7, i16* %8
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = trunc i32 %10 to i16
%12 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %4, i32 0, i32 1
store i16 %11, i16* %12
%13 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %4, i32 0, i32 0
%14 = load i16, i16* %13
%15 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %4, i32 0, i32 1
%16 = load i16, i16* %15
%17 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %2, i32 0, i32 0
%18 = getelementptr inbounds { i16, i16 }, { i16, i16 }* %2, i32 0, i32 1
store i16 %14, i16* %17
store i16 %16, i16* %18
%19 = bitcast { i16, i16 }* %2 to i32*
%20 = load i32, i32* %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo_short(i32 %0) {
%2 = add i32 %0, 1
%3 = shl i32 %0, 16
%4 = add i32 %3, -65536
%5 = and i32 %2, 65535
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ putc(char);
void printString(char *s) {
  for (int i = 0; s[i] != '\0'; i++)
    putc(s[i]);
}


x86 assembly (clang, -O0):
<printString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <printString+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <putc@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printString+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printString>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <printString+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <printString+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @printString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i64 [ %9, %5 ], [ 0, %1 ]
%7 = phi i8 [ %11, %5 ], [ %2, %1 ]
%8 = tail call i32 @putc(i8 signext %7)
%9 = add nuw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %4, label %5
}
void noop_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @noop_handler(i32 %0) {
ret void
}
struct header **tests_free_find(void *ptr) {
  {
    return ((struct header **)0);
  }
}


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

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

LLVM IR (-O0):
%struct.header = type opaque
define %struct.header** @tests_free_find(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret %struct.header** null
}

LLVM IR (-O2):
%struct.header = type opaque
define noalias %struct.header** @tests_free_find(i8* nocapture readnone %0) {
ret %struct.header** null
}
/* Variables and functions */
int /*<<< orphan*/ ANATOP_EVENT0_DriverIRQHandler();
__attribute__((weak)) void ANATOP_EVENT0_IRQHandler(void) {
  ANATOP_EVENT0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @ANATOP_EVENT0_IRQHandler() {
%1 = call i32 (...) @ANATOP_EVENT0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @ANATOP_EVENT0_IRQHandler() {
%1 = tail call i32 (...) @ANATOP_EVENT0_DriverIRQHandler()
ret void
}
void gtk_tree_path_prepend_index() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_path_prepend_index() {
ret void
}
int get_uint24(unsigned char *buf, int block) {
  int x;
  x = (buf[block * 3 + 0] << 16) | (buf[block * 3 + 1] << 8) |
      buf[block * 3 + 2];
  return x;
}


x86 assembly (clang, -O0):
<get_uint24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3,-0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
imul   $0x3,-0xc(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
imul   $0x3,-0xc(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint24>:
movslq %esi,%rax
lea    (%rax,%rax,2),%rax
movzbl (%rdi,%rax,1),%ecx
shl    $0x10,%ecx
movzbl 0x1(%rdi,%rax,1),%edx
shl    $0x8,%edx
or     %ecx,%edx
movzbl 0x2(%rdi,%rax,1),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @get_uint24(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 i8*, i8** %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 3
%9 = add nsw i32 %8, 0
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %6, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 16
%15 = load i8*, i8** %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %16, 3
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %15, i64 %19
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = shl i32 %22, 8
%24 = or i32 %14, %23
%25 = load i8*, i8** %3
%26 = load i32, i32* %4
%27 = mul nsw i32 %26, 3
%28 = add nsw i32 %27, 2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %25, i64 %29
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = or i32 %24, %32
store i32 %33, i32* %5
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
define i32 @get_uint24(i8* nocapture %0, i32 %1) {
%3 = mul nsw i32 %1, 3
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = add nsw i32 %3, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %14, %8
%16 = add nsw i32 %3, 2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %0, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %15, %20
ret i32 %21
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t now;
  time(&now);
  printf("now time is %lld\n", now);
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"now time is %lld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @time(i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int atoi(int /*<<< orphan*/);
int /*<<< orphan*/ findLine(int /*<<< orphan*/ *, char *);
int parselevel(FILE *plr_file) { return atoi(findLine(plr_file, "Levl:")); }


x86 assembly (clang, -O0):
<parselevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <findLine@plt>
mov    %eax,%edi
call   1030 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parselevel>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <findLine@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <atoi@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"Levl:\00"
define i32 @parselevel(i32* %0) {
%2 = tail call i32 @findLine(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @atoi(i32 %2)
ret i32 %3
}
void pp_soft_wdt_restart(void) {}


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

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

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

LLVM IR (-O2):
define void @pp_soft_wdt_restart() {
ret void
}
void J444ToARGB() {}


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

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

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

LLVM IR (-O2):
define void @J444ToARGB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ commFreeAllFds();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
void handlerSigSegv(int sig) {
  printf("recv SIGSEGV <%d>, segment fault.\n", sig);
  commFreeAllFds();
  sleep(1);
  exit(1);
}


x86 assembly (clang, -O0):
<handlerSigSegv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <commFreeAllFds@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<handlerSigSegv>:
push   %rax
mov    %edi,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <commFreeAllFds@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"recv SIGSEGV <%d>, segment fault.\0A\00"
define void @handlerSigSegv(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (...) @commFreeAllFds()
%6 = call i32 @sleep(i32 1)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"recv SIGSEGV <%d>, segment fault.\0A\00"
define void @handlerSigSegv(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (...) @commFreeAllFds()
%4 = tail call i32 @sleep(i32 1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
int slapi_isbitset_uchar(unsigned char f, unsigned char bitnum) {
  return (f & ((unsigned char)1 << bitnum));
}


x86 assembly (clang, -O0):
<slapi_isbitset_uchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<slapi_isbitset_uchar>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @slapi_isbitset_uchar(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = shl i32 1, %8
%10 = and i32 %6, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @slapi_isbitset_uchar(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = zext i8 %1 to i32
%5 = shl nuw i32 1, %4
%6 = and i32 %5, %3
ret i32 %6
}
void trim(char *string) {
  while (*string != '\0') {
    if (*string == '\n') {
      *string = '\0';
    }
    string++;
  }
}


x86 assembly (clang, -O0):
<trim>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1140 <trim+0x40>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    112f <trim+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <trim+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<trim>:
jmp    1117 <trim+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x0,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0xa,%al
je     1110 <trim+0x10>
test   %al,%al
jne    1113 <trim+0x13>
ret

LLVM IR (-O0):
define void @trim(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %2
store i8 0, i8* %14
br label %15
15: ; preds = %13, %8
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @trim(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _ptrc_glClearDepth(float);
__attribute__((visibility("default"))) void emu_glClearDepthf(float d) {
  _ptrc_glClearDepth(d);
}


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

x86 assembly (clang, -O2):
<emu_glClearDepthf>:
jmp    1030 <_ptrc_glClearDepth@plt>

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

LLVM IR (-O2):
define void @emu_glClearDepthf(float %0) {
%2 = tail call i32 @_ptrc_glClearDepth(float %0)
ret void
}
/* Variables and functions */
int sync_file_range(int /*<<< orphan*/, int /*<<< orphan*/, int,
                    int /*<<< orphan*/);
int main(void) { return sync_file_range(0, 0, 1024, 0); }


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

x86 assembly (clang, -O2):
<main>:
xor    %edi,%edi
xor    %esi,%esi
mov    $0x400,%edx
xor    %ecx,%ecx
jmp    1030 <sync_file_range@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sync_file_range(i32 0, i32 0, i32 1024, i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, b, c;
  scanf("%d", &a);
  scanf("%d", &b);
  if ((b >> a) == 1)
    printf("1");
  else
    printf("0");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
cmp    $0x1,%eax
jne    1171 <main+0x51>
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x5d>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
mov    0xc(%rsp),%cl
sar    %cl,%eax
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
or     $0x30,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = load i32, i32* %1
%9 = ashr i32 %7, %8
%10 = icmp eq i32 %9, 1
%11 = select i1 %10, i32 49, i32 48
%12 = call i32 @putchar(i32 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void vis_dot_preamble(void) { printf("digraph {\n"); }


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"digraph {\00"
define void @vis_dot_preamble() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct fb {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fb_putPixel_16(struct fb *, int, int, int);
void fb_drawPixel_rgb565(struct fb *self, int x, int y, int r, int g, int b) {
  fb_putPixel_16(self, x, y,
                 (((r >> 3) & 31) << 11) | (((g >> 2) & 63) << 5) |
                     (((b >> 3) & 31) << 0));
}


x86 assembly (clang, -O0):
<fb_drawPixel_rgb565>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
sar    $0x3,%ecx
and    $0x1f,%ecx
shl    $0xb,%ecx
mov    -0x18(%rbp),%eax
sar    $0x2,%eax
and    $0x3f,%eax
shl    $0x5,%eax
or     %eax,%ecx
mov    -0x1c(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
shl    $0x0,%eax
or     %eax,%ecx
call   1030 <fb_putPixel_16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_drawPixel_rgb565>:
shl    $0x8,%ecx
and    $0xf800,%ecx
and    $0xfc,%r8d
lea    (%rcx,%r8,8),%ecx
shr    $0x3,%r9d
and    $0x1f,%r9d
or     %r9d,%ecx
jmp    1030 <fb_putPixel_16@plt>

LLVM IR (-O0):
%struct.fb = type { i32 }
define void @fb_drawPixel_rgb565(%struct.fb* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.fb*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.fb* %0, %struct.fb** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.fb*, %struct.fb** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = ashr i32 %16, 3
%18 = and i32 %17, 31
%19 = shl i32 %18, 11
%20 = load i32, i32* %11
%21 = ashr i32 %20, 2
%22 = and i32 %21, 63
%23 = shl i32 %22, 5
%24 = or i32 %19, %23
%25 = load i32, i32* %12
%26 = ashr i32 %25, 3
%27 = and i32 %26, 31
%28 = shl i32 %27, 0
%29 = or i32 %24, %28
%30 = call i32 @fb_putPixel_16(%struct.fb* %13, i32 %14, i32 %15, i32 %29)
ret void
}

LLVM IR (-O2):
%struct.fb = type { i32 }
define void @fb_drawPixel_rgb565(%struct.fb* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = shl i32 %3, 8
%8 = and i32 %7, 63488
%9 = shl i32 %4, 3
%10 = and i32 %9, 2016
%11 = or i32 %10, %8
%12 = lshr i32 %5, 3
%13 = and i32 %12, 31
%14 = or i32 %11, %13
%15 = tail call i32 @fb_putPixel_16(%struct.fb* %0, i32 %1, i32 %2, i32 %14)
ret void
}
void netcdf_CloseTS() {}


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

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

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

LLVM IR (-O2):
define void @netcdf_CloseTS() {
ret void
}
void INT_Excep_MTU10_TGIB10(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_MTU10_TGIB10() {
ret void
}
/* Type definitions */
struct statfs {
  int f_type;
};

/* Variables and functions */
scalar_t__ statfs(char *, struct statfs *);
int check_proc() {
  struct statfs mnt;
  if (statfs("/proc", &mnt) < 0) {
    return 0;
  }
  if (mnt.f_type != 0x9fa0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<check_proc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <statfs@plt>
cmp    $0x0,%rax
jge    113e <check_proc+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    115e <check_proc+0x4e>
cmpl   $0x9fa0,-0x8(%rbp)
je     1157 <check_proc+0x47>
movl   $0x0,-0x4(%rbp)
jmp    115e <check_proc+0x4e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_proc>:
push   %rax
lea    0xee8(%rip),%rdi
mov    %rsp,%rsi
call   1030 <statfs@plt>
test   %rax,%rax
setns  %al
cmpl   $0x9fa0,(%rsp)
sete   %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@.str = [6 x i8] c"/proc\00"
define i32 @check_proc() {
%1 = alloca i32
%2 = alloca %struct.statfs
%3 = call i64 @statfs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.statfs* %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %12
6: ; preds = %0
%7 = getelementptr inbounds %struct.statfs, %struct.statfs* %2, i32 0, i32 0
%8 = load i32, i32* %7
%9 = icmp ne i32 %8, 40864
br i1 %9, label %10, label %11
10: ; preds = %6
store i32 0, i32* %1
br label %12
11: ; preds = %6
store i32 1, i32* %1
br label %12
12: ; preds = %11, %10, %5
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@.str = [6 x i8] c"/proc\00"
define i32 @check_proc() {
%1 = alloca %struct.statfs
%2 = bitcast %struct.statfs* %1 to i8*
%3 = call i64 @statfs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), %struct.statfs* %1)
%4 = icmp sgt i64 %3, -1
%5 = getelementptr inbounds %struct.statfs, %struct.statfs* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = icmp eq i32 %6, 40864
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ __cmpdi2(long long, long long);
int _COM_CMPGE64s(long long a, long long b) { return __cmpdi2(a, b) != 0; }


x86 assembly (clang, -O0):
<_COM_CMPGE64s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__cmpdi2@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_COM_CMPGE64s>:
push   %rax
call   1030 <__cmpdi2@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @_COM_CMPGE64s(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = call i64 @__cmpdi2(i64 %5, i64 %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @_COM_CMPGE64s(i64 %0, i64 %1) {
%3 = tail call i64 @__cmpdi2(i64 %0, i64 %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xf6() {
  Assert_real((isascii(246) == 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_isascii.c",
              1235, ("isascii should be 0 for 0xf6"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xf6>:
push   %rax
mov    $0xf6,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4d3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf6\00"
define void @t_isascii_0xf6() {
%1 = call i64 @isascii(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xf6\00"
define void @t_isascii_0xf6() {
%1 = tail call i64 @isascii(i32 246)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1235, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int brojnaCifrivoBroj(int n, int c) {
  int cifra = n % 10;
  if (n == 0) {
    return c;
  } else {
    return brojnaCifrivoBroj(n / 10, c + 1);
  }
}


x86 assembly (clang, -O0):
<brojnaCifrivoBroj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1141 <brojnaCifrivoBroj+0x31>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115c <brojnaCifrivoBroj+0x4c>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <brojnaCifrivoBroj@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<brojnaCifrivoBroj>:
mov    %esi,%eax
test   %edi,%edi
je     1132 <brojnaCifrivoBroj+0x32>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x1,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <brojnaCifrivoBroj+0x10>
ret

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

LLVM IR (-O2):
define i32 @brojnaCifrivoBroj(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %8, %4 ], [ %1, %2 ]
%6 = phi i32 [ %7, %4 ], [ %0, %2 ]
%7 = sdiv i32 %6, 10
%8 = add nsw i32 %5, 1
%9 = add i32 %6, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i32 [ %1, %2 ], [ %8, %4 ]
ret i32 %12
}
void two(void *arr, int n, int size, void *(*mapfn)(void *)) {}


x86 assembly (clang, -O0):
<two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @two(i8* %0, i32 %1, i32 %2, i8* (i8*)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8* (i8*)*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* (i8*)* %3, i8* (i8*)** %8
ret void
}

LLVM IR (-O2):
define void @two(i8* nocapture %0, i32 %1, i32 %2, i8* (i8*)* nocapture %3) {
ret void
}