xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void NormalDynamicFunction() {
  printf("This is a normal function built into a dynamic library\n");
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"This is a normal function built into a dynamic library\0A\00"
define void @NormalDynamicFunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [55 x i8] c"This is a normal function built into a dynamic library\00"
define void @NormalDynamicFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
ret void
}
int asciiLog2(int asciiNum) {
  int i = 0, val = 1;
  if (asciiNum < 0) {
    return 0;
  } else if (asciiNum == 0) {
    return 1;
  }
  for (i = 0; val <= asciiNum; i++) {
    val *= 2;
  }
  return i;
}


x86 assembly (clang, -O0):
<asciiLog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    112b <asciiLog2+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1176 <asciiLog2+0x76>
cmpl   $0x0,-0x8(%rbp)
jne    1141 <asciiLog2+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1176 <asciiLog2+0x76>
jmp    1146 <asciiLog2+0x46>
movl   $0x0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1170 <asciiLog2+0x70>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <asciiLog2+0x4d>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asciiLog2>:
test   %edi,%edi
js     111a <asciiLog2+0x1a>
je     111d <asciiLog2+0x1d>
xor    %eax,%eax
mov    $0x1,%ecx
nopl   (%rax)
add    %ecx,%ecx
add    $0x1,%eax
cmp    %edi,%ecx
jle    1110 <asciiLog2+0x10>
ret
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @asciiLog2(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp eq i32 %0, 0
br i1 %4, label %11, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 1, %3 ]
%7 = phi i32 [ %9, %5 ], [ 0, %3 ]
%8 = shl nsw i32 %6, 1
%9 = add nuw nsw i32 %7, 1
%10 = icmp sgt i32 %8, %0
br i1 %10, label %11, label %5
11: ; preds = %5, %3, %1
%12 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %5 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ flag;

/* Variables and functions */
int setsockopt(int, int, int, char *, int);
int konnect_socket_option(int handle, int level, int option_name, int flag) {
  int error =
      setsockopt(handle, level, option_name, (char *)&flag, sizeof(flag));
  return error;
}


x86 assembly (clang, -O0):
<konnect_socket_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    -0x10(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<konnect_socket_option>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @konnect_socket_option(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = bitcast i32* %5 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %6, i32 4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ midi_clock_get_running();
int seq_ctrl_get_record_mode();
int /*<<< orphan*/ seq_ctrl_set_record_mode(int);
int /*<<< orphan*/ seq_engine_step_sequence_shuttle(int);
void seq_engine_step_rec_pos_changed(int change) {
  if (seq_ctrl_get_record_mode() == 1) {
    if (!midi_clock_get_running()) {
      seq_ctrl_set_record_mode(2);
    }
  }
  seq_engine_step_sequence_shuttle(change);
}


x86 assembly (clang, -O0):
<seq_engine_step_rec_pos_changed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1060 <seq_ctrl_get_record_mode@plt>
cmp    $0x1,%eax
jne    117a <seq_engine_step_rec_pos_changed+0x3a>
mov    $0x0,%al
call   1050 <midi_clock_get_running@plt>
cmp    $0x0,%eax
jne    1175 <seq_engine_step_rec_pos_changed+0x35>
mov    $0x2,%edi
call   1030 <seq_ctrl_set_record_mode@plt>
jmp    117a <seq_engine_step_rec_pos_changed+0x3a>
mov    -0x4(%rbp),%edi
call   1040 <seq_engine_step_sequence_shuttle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_engine_step_rec_pos_changed>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1060 <seq_ctrl_get_record_mode@plt>
cmp    $0x1,%eax
jne    1164 <seq_engine_step_rec_pos_changed+0x24>
xor    %eax,%eax
call   1050 <midi_clock_get_running@plt>
test   %eax,%eax
jne    1164 <seq_engine_step_rec_pos_changed+0x24>
mov    $0x2,%edi
call   1030 <seq_ctrl_set_record_mode@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <seq_engine_step_sequence_shuttle@plt>

LLVM IR (-O0):
define void @seq_engine_step_rec_pos_changed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @seq_ctrl_get_record_mode()
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 (...) @midi_clock_get_running()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = call i32 @seq_ctrl_set_record_mode(i32 2)
br label %10
10: ; preds = %8, %5
br label %11
11: ; preds = %10, %1
%12 = load i32, i32* %2
%13 = call i32 @seq_engine_step_sequence_shuttle(i32 %12)
ret void
}

LLVM IR (-O2):
define void @seq_engine_step_rec_pos_changed(i32 %0) {
%2 = tail call i32 (...) @seq_ctrl_get_record_mode()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i32 (...) @midi_clock_get_running()
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @seq_ctrl_set_record_mode(i32 2)
br label %9
9: ; preds = %4, %7, %1
%10 = tail call i32 @seq_engine_step_sequence_shuttle(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CMN_error(char *);
int /*<<< orphan*/ close(int);
void errorCloseSock(char *msg, int sock) {
  close(sock);
  CMN_error(msg);
}


x86 assembly (clang, -O0):
<errorCloseSock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <close@plt>
mov    -0x8(%rbp),%rdi
call   1030 <CMN_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorCloseSock>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <CMN_error@plt>

LLVM IR (-O0):
define void @errorCloseSock(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @close(i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @CMN_error(i8* %7)
ret void
}

LLVM IR (-O2):
define void @errorCloseSock(i8* %0, i32 %1) {
%3 = tail call i32 @close(i32 %1)
%4 = tail call i32 @CMN_error(i8* %0)
ret void
}
int OSMemoryNotificationCurrentLevel(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @OSMemoryNotificationCurrentLevel() {
ret i32 0
}
int test_imm_40int64_lowword_reg(long long val) {
  return ((val) & (0x40 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_40int64_lowword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 64
%5 = icmp ne i64 %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_40int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 64
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ priklad_dva(int);
int /*<<< orphan*/ priklad_jedna(int);
int /*<<< orphan*/ priklad_tri(int);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  priklad_jedna(1000);
  priklad_dva(100);
  priklad_tri(20);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x3e8,%edi
call   1070 <priklad_jedna@plt>
mov    $0x64,%edi
call   1080 <priklad_dva@plt>
mov    $0x14,%edi
call   1030 <priklad_tri@plt>
lea    0xe67(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x3e8,%edi
call   1070 <priklad_jedna@plt>
mov    $0x64,%edi
call   1080 <priklad_dva@plt>
mov    $0x14,%edi
call   1030 <priklad_tri@plt>
lea    0xe6c(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
%3 = call i32 @priklad_jedna(i32 1000)
%4 = call i32 @priklad_dva(i32 100)
%5 = call i32 @priklad_tri(i32 20)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"pause\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 @priklad_jedna(i32 1000)
%4 = tail call i32 @priklad_dva(i32 100)
%5 = tail call i32 @priklad_tri(i32 20)
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
reg0imm1_set(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{ r0 = 33; }


x86 assembly (clang, -O0):
<reg0imm1_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x21,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @reg0imm1_set(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int send_event;
};
struct TYPE_4__ {
  TYPE_1__ xcolormap;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xcolormap_send_event(void *_p, int _v) {
  ((XEvent *)_p)->xcolormap.send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XEvent_xcolormap_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xcolormap_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xcolormap_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
unsigned char read_char_console() {
  unsigned char buffer;
  while (*((volatile unsigned char *)(0x98010000 + 1)) == ((unsigned char)0))
    ;
  buffer = *((volatile unsigned char *)(0x98010000 + 0));
  *((volatile unsigned char *)(0x98010000 + 2)) = ((unsigned char)1);
  return buffer;
}


x86 assembly (clang, -O0):
<read_char_console>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98010001,%eax
mov    (%rax),%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    111c <read_char_console+0x1c>
jmp    1104 <read_char_console+0x4>
mov    $0x98010000,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
mov    $0x98010002,%eax
movb   $0x1,(%rax)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_char_console>:
mov    $0x98010000,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x0,0x1(%rcx)
je     1110 <read_char_console+0x10>
mov    (%rcx),%al
movb   $0x1,0x2(%rcx)
ret

LLVM IR (-O0):
define zeroext i8 @read_char_console() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = load volatile i8, i8* inttoptr (i64 2550202369 to i8*)
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load volatile i8, i8* inttoptr (i64 2550202368 to i8*)
store i8 %8, i8* %1
store volatile i8 1, i8* inttoptr (i64 2550202370 to i8*)
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define zeroext i8 @read_char_console() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i8, i8* inttoptr (i64 2550202369 to i8*)
%3 = icmp eq i8 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = load volatile i8, i8* inttoptr (i64 2550202368 to i8*)
store volatile i8 1, i8* inttoptr (i64 2550202370 to i8*)
ret i8 %5
}
/* Variables and functions */
char getch();
unsigned char getchb(void) {
  char c;
  do {
    c = getch();
  } while (((unsigned char)(c >> 8) & 0xFF) == 0x01);
  return ((unsigned char)(c & 0xFF));
}


x86 assembly (clang, -O0):
<getchb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getch@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x8,%eax
movzbl %al,%eax
and    $0xff,%eax
cmp    $0x1,%eax
je     1118 <getchb+0x8>
movsbl -0x1(%rbp),%eax
and    $0xff,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getchb>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getch@plt>
movsbl %al,%ecx
and    $0xff00,%ecx
cmp    $0x100,%ecx
je     1120 <getchb+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @getchb() {
%1 = alloca i8
br label %2
2: ; preds = %4, %0
%3 = call signext i8 (...) @getch()
store i8 %3, i8* %1
br label %4
4: ; preds = %2
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = ashr i32 %6, 8
%8 = trunc i32 %7 to i8
%9 = zext i8 %8 to i32
%10 = and i32 %9, 255
%11 = icmp eq i32 %10, 1
br i1 %11, label %2, label %12
12: ; preds = %4
%13 = load i8, i8* %1
%14 = sext i8 %13 to i32
%15 = and i32 %14, 255
%16 = trunc i32 %15 to i8
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @getchb() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getch()
%3 = sext i8 %2 to i32
%4 = and i32 %3, 65280
%5 = icmp eq i32 %4, 256
br i1 %5, label %1, label %6
6: ; preds = %1
ret i8 %2
}
/* Variables and functions */
int lace_builtin_seq_main(unsigned int, char **, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *);
int lace_main_seq(unsigned argc, char **argv) {
  return lace_builtin_seq_main(argc, argv, NULL, NULL);
}


x86 assembly (clang, -O0):
<lace_main_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    %rcx,%rdx
call   1030 <lace_builtin_seq_main@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lace_main_seq>:
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <lace_builtin_seq_main@plt>

LLVM IR (-O0):
define i32 @lace_main_seq(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @lace_builtin_seq_main(i32 %5, i8** %6, i32* null, i32* null)
ret i32 %7
}

LLVM IR (-O2):
define i32 @lace_main_seq(i32 %0, i8** %1) {
%3 = tail call i32 @lace_builtin_seq_main(i32 %0, i8** %1, i32* null, i32* null)
ret i32 %3
}
int ptr_cmp(const void *a, const void *b) { return a == b ? 0 : 1; }


x86 assembly (clang, -O0):
<ptr_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_cmp>:
xor    %eax,%eax
cmp    %rsi,%rdi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @ptr_cmp(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
void *g_malloc(int, int);
void *ssl_md5_info_create(void) { return g_malloc(sizeof(MD5_CTX), 1); }


x86 assembly (clang, -O0):
<ssl_md5_info_create>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x1,%esi
call   1030 <g_malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssl_md5_info_create>:
mov    $0x4,%edi
mov    $0x1,%esi
jmp    1030 <g_malloc@plt>

LLVM IR (-O0):
define i8* @ssl_md5_info_create() {
%1 = call i8* @g_malloc(i32 4, i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @ssl_md5_info_create() {
%1 = tail call i8* @g_malloc(i32 4, i32 1)
ret i8* %1
}
__float128 from_sign_short_load(short *a) { return (__float128)*a; }


x86 assembly (clang, -O0):
<from_sign_short_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ax
movswl %ax,%edi
call   1130 <__floatsitf>
add    $0x10,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<from_sign_short_load>:
push   %rax
movswl (%rdi),%edi
call   1110 <__floatsitf>
pop    %rax
ret
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
define fp128 @from_sign_short_load(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sitofp i16 %4 to fp128
ret fp128 %5
}

LLVM IR (-O2):
define fp128 @from_sign_short_load(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = sitofp i16 %2 to fp128
ret fp128 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0x93() {
  Assert_real((isascii(147) == 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",
              740, ("isascii should be 0 for 0x93"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%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 0x93\00"
define void @t_isascii_0x93() {
%1 = call i64 @isascii(i32 147)
%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 740, 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 0x93\00"
define void @t_isascii_0x93() {
%1 = tail call i64 @isascii(i32 147)
%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 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ iswhite(int);
int ishorzgraphic(int c) { return (c != EOF) && !iswhite(c); }


x86 assembly (clang, -O0):
<ishorzgraphic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2ec1(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
je     1145 <ishorzgraphic+0x35>
mov    -0x4(%rbp),%edi
call   1030 <iswhite@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishorzgraphic>:
push   %rax
mov    0x2ed0(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
je     112c <ishorzgraphic+0x1c>
call   1030 <iswhite@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @ishorzgraphic(i32 %0) {
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @iswhite(i32 %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void callee1() {}


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

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

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

LLVM IR (-O2):
define void @callee1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
void foldervisitor(const char *path, int lvl) {
  fprintf(stdout, "Folder visit: %s\n", path);
}


x86 assembly (clang, -O0):
<foldervisitor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foldervisitor>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [18 x i8] c"Folder visit: %s\0A\00"
define void @foldervisitor(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stdout
%6 = load i8*, i8** %3
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [18 x i8] c"Folder visit: %s\0A\00"
define void @foldervisitor(i8* %0, i32 %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call_echo();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Type a string:");
  call_echo();
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Type a string:\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @call_echo()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Type a string:\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @call_echo()
ret i32 0
}
/* Type definitions */
struct statfs {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __fstatfs(int fd, struct statfs *buf) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__fstatfs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fstatfs>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.statfs = type { i32 }
@ENOSYS = global i32 0
define i32 @__fstatfs(i32 %0, %struct.statfs* %1) {
%3 = alloca i32
%4 = alloca %struct.statfs*
store i32 %0, i32* %3
store %struct.statfs* %1, %struct.statfs** %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
%struct.statfs = type { i32 }
@ENOSYS = global i32 0
define i32 @__fstatfs(i32 %0, %struct.statfs* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Type definitions */
typedef int /*<<< orphan*/ oldval;

/* Variables and functions */
int /*<<< orphan*/ sysctl(int *, int, void *, size_t *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/);
int main() {
  int name[] = {2, 3};
  int namelen = 2;
  int oldval[8];
  size_t len = sizeof(oldval);
  sysctl(name, namelen, (void *)oldval, &len, NULL, 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movq   $0x20,-0x38(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x10(%rbp),%esi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
call   1030 <sysctl@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movabs $0x300000002,%rax
mov    %rax,0x8(%rsp)
movq   $0x20,(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x2,%esi
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <sysctl@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.name = [2 x i32] [i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca i32
%4 = alloca [8 x i32]
%5 = alloca i64
store i32 0, i32* %1
%6 = bitcast [2 x i32]* %2 to i8*
store i32 2, i32* %3
store i64 32, i64* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 0
%10 = bitcast i32* %9 to i8*
%11 = call i32 @sysctl(i32* %7, i32 %8, i8* %10, i64* %5, i32* null, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca [8 x i32]
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
store i64 12884901890, i64* %1
%5 = bitcast [8 x i32]* %2 to i8*
%6 = bitcast i64* %3 to i8*
store i64 32, i64* %3
%7 = bitcast i64* %1 to i32*
%8 = call i32 @sysctl(i32* %7, i32 2, i8* %5, i64* %3, i32* null, i32 0)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int StrCmp(const char **ptr1, const char **ptr2) {
  return strcmp(*ptr1, *ptr2);
}


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

x86 assembly (clang, -O2):
<StrCmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @StrCmp(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %4)
ret i32 %5
}
/* Variables and functions */
scalar_t__ isPrefix(char *, char *);
int isSerialPortDev(char *s) {
  return isPrefix("ttyusb", s) || isPrefix("ttyAMA", s);
}


x86 assembly (clang, -O0):
<isSerialPortDev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <isPrefix@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    1158 <isSerialPortDev+0x48>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <isPrefix@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSerialPortDev>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %rbx,%rsi
call   1030 <isPrefix@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1132 <isSerialPortDev+0x22>
pop    %rbx
ret
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
call   1030 <isPrefix@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"ttyusb\00"
@.str.1 = [7 x i8] c"ttyAMA\00"
define i32 @isSerialPortDev(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @isPrefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @isPrefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = icmp ne i64 %8, 0
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):
@.str = [7 x i8] c"ttyusb\00"
@.str.1 = [7 x i8] c"ttyAMA\00"
define i32 @isSerialPortDev(i8* %0) {
%2 = tail call i64 @isPrefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @isPrefix(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
void shutDown(void) {}


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

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

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

LLVM IR (-O2):
define void @shutDown() {
ret void
}
/* Type definitions */
struct fix_tag_classifier {
  int dummy;
};

/* Variables and functions */
const struct fix_tag_classifier *
get_group_classifier_in_NestedParty(size_t __tag) {
  (void)__tag;
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.fix_tag_classifier = type { i32 }
define %struct.fix_tag_classifier* @get_group_classifier_in_NestedParty(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret %struct.fix_tag_classifier* null
}

LLVM IR (-O2):
%struct.fix_tag_classifier = type { i32 }
define noalias %struct.fix_tag_classifier* @get_group_classifier_in_NestedParty(i64 %0) {
ret %struct.fix_tag_classifier* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void perror(const char *str) { printf("%s: cannot access file.\n", str); }


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

x86 assembly (clang, -O2):
<perror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [25 x i8] c"%s: cannot access file.\0A\00"
define void @perror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ returnFromMethod();
void RETURN() { returnFromMethod(); }


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

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

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

LLVM IR (-O2):
define void @RETURN() {
%1 = tail call i32 (...) @returnFromMethod()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_info(char *, int);
int sci_get_chip_id();
int soc_id_is_sc8730g3v0(void) {
  pr_info("chip id is %x\n", sci_get_chip_id());
  return ((sci_get_chip_id() & (0xFFFFF000)) == ((0x8730D000) & (0xFFFFF000)));
}


x86 assembly (clang, -O0):
<soc_id_is_sc8730g3v0>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <pr_info@plt>
mov    $0x0,%al
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
cmp    $0x8730d000,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<soc_id_is_sc8730g3v0>:
push   %rax
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <pr_info@plt>
xor    %eax,%eax
call   1040 <sci_get_chip_id@plt>
and    $0xfffff000,%eax
xor    %ecx,%ecx
cmp    $0x8730d000,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc8730g3v0() {
%1 = call i32 (...) @sci_get_chip_id()
%2 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -2026844160
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [15 x i8] c"chip id is %x\0A\00"
define i32 @soc_id_is_sc8730g3v0() {
%1 = tail call i32 (...) @sci_get_chip_id()
%2 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @sci_get_chip_id()
%4 = and i32 %3, -4096
%5 = icmp eq i32 %4, -2026844160
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void output_finish(FILE *fp) { fputs("\n}\n", fp); }


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

x86 assembly (clang, -O2):
<output_finish>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0A}\0A\00"
define void @output_finish(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
/* Variables and functions */
scalar_t__ class_num(char const);
scalar_t__ class_upper(char const);
char conv_ctoi(const char c) {
  if (class_num(c)) {
    return (char)(c - '0');
  } else if (class_upper(c)) {
    return (char)(c - 'A' + 10);
  }
  return -1;
}


x86 assembly (clang, -O0):
<conv_ctoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%edi
call   1040 <class_num@plt>
cmp    $0x0,%rax
je     1150 <conv_ctoi+0x30>
movsbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    117e <conv_ctoi+0x5e>
movsbl -0x2(%rbp),%edi
call   1030 <class_upper@plt>
cmp    $0x0,%rax
je     1175 <conv_ctoi+0x55>
movsbl -0x2(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %al,-0x1(%rbp)
jmp    117e <conv_ctoi+0x5e>
jmp    117a <conv_ctoi+0x5a>
movb   $0xff,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_ctoi>:
push   %rbx
mov    %edi,%ebx
call   1040 <class_num@plt>
test   %rax,%rax
je     1132 <conv_ctoi+0x12>
lea    -0x30(%rbx),%eax
pop    %rbx
ret
movsbl %bl,%edi
call   1030 <class_upper@plt>
lea    -0x37(%rbx),%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %cl,%al
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @conv_ctoi(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @class_num(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = sub nsw i32 %9, 48
%11 = trunc i32 %10 to i8
store i8 %11, i8* %2
br label %24
12: ; preds = %1
%13 = load i8, i8* %3
%14 = call i64 @class_upper(i8 signext %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %12
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 65
%20 = add nsw i32 %19, 10
%21 = trunc i32 %20 to i8
store i8 %21, i8* %2
br label %24
22: ; preds = %12
br label %23
23: ; preds = %22
store i8 -1, i8* %2
br label %24
24: ; preds = %23, %16, %7
%25 = load i8, i8* %2
ret i8 %25
}

LLVM IR (-O2):
define signext i8 @conv_ctoi(i8 signext %0) {
%2 = tail call i64 @class_num(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = add i8 %0, -48
br label %11
6: ; preds = %1
%7 = tail call i64 @class_upper(i8 signext %0)
%8 = icmp eq i64 %7, 0
%9 = add i8 %0, -55
%10 = select i1 %8, i8 -1, i8 %9
br label %11
11: ; preds = %6, %4
%12 = phi i8 [ %5, %4 ], [ %10, %6 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ seq_instant(int, int, int, int /*<<< orphan*/);
void seq_play_sound(int id) { seq_instant(0x90, 15, id, 0); }


x86 assembly (clang, -O0):
<seq_play_sound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x90,%edi
mov    $0xf,%esi
xor    %ecx,%ecx
call   1030 <seq_instant@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seq_play_sound>:
mov    %edi,%edx
mov    $0x90,%edi
mov    $0xf,%esi
xor    %ecx,%ecx
jmp    1030 <seq_instant@plt>

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

LLVM IR (-O2):
define void @seq_play_sound(i32 %0) {
%2 = tail call i32 @seq_instant(i32 144, i32 15, i32 %0, i32 0)
ret void
}
int cmp_great_fp32(const void *p, const void *q) {
  const float a = *(const float *)p;
  const float b = *(const float *)q;
  if (b > a)
    return +1;
  if (a > b)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_great_fp32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
ucomiss -0x1c(%rbp),%xmm0
jbe    1141 <cmp_great_fp32+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1163 <cmp_great_fp32+0x63>
movss  -0x1c(%rbp),%xmm0
ucomiss -0x20(%rbp),%xmm0
jbe    115c <cmp_great_fp32+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <cmp_great_fp32+0x63>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_great_fp32>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomiss %xmm0,%xmm1
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_great_fp32(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca float
%7 = alloca float
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
store float %10, float* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to float*
%13 = load float, float* %12
store float %13, float* %7
%14 = load float, float* %7
%15 = load float, float* %6
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load float, float* %6
%20 = load float, float* %7
%21 = fcmp ogt float %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_great_fp32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp ogt float %6, %4
%8 = fcmp ogt float %4, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int index(int x, int y) { return x * 144 + y; }


x86 assembly (clang, -O0):
<index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
imul   $0x90,-0x4(%rbp),%eax
add    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<index>:
lea    (%rdi,%rdi,8),%eax
shl    $0x4,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @index(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 = mul nsw i32 %5, 144
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @index(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 144
%4 = add nsw i32 %3, %1
ret i32 %4
}
void HeartRateMonitor_execute_initialization() {}


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

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

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

LLVM IR (-O2):
define void @HeartRateMonitor_execute_initialization() {
ret void
}
/* Type definitions */
struct addrinfo {
  int dummy;
};

/* Variables and functions */
int zfor_getaddrinfoi(char const *, char const *, struct addrinfo const *,
                      struct addrinfo **, int);
int zfor_getaddrinfo(const char *node, const char *service,
                     const struct addrinfo *hints, struct addrinfo **res) {
  return zfor_getaddrinfoi(node, service, hints, res, 1);
}


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

x86 assembly (clang, -O2):
<zfor_getaddrinfo>:
mov    $0x1,%r8d
jmp    1030 <zfor_getaddrinfoi@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32 }
define i32 @zfor_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct.addrinfo*
%8 = alloca %struct.addrinfo**
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct.addrinfo* %2, %struct.addrinfo** %7
store %struct.addrinfo** %3, %struct.addrinfo*** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load %struct.addrinfo*, %struct.addrinfo** %7
%12 = load %struct.addrinfo**, %struct.addrinfo*** %8
%13 = call i32 @zfor_getaddrinfoi(i8* %9, i8* %10, %struct.addrinfo* %11, %struct.addrinfo** %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
%struct.addrinfo = type { i32 }
define i32 @zfor_getaddrinfo(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3) {
%5 = tail call i32 @zfor_getaddrinfoi(i8* %0, i8* %1, %struct.addrinfo* %2, %struct.addrinfo** %3, i32 1)
ret i32 %5
}
double fabs(double arg) {
  if (arg < 0)
    return -arg;
  return arg;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    113d <fabs+0x3d>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1147 <fabs+0x47>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
store double %8, double* %2
br label %11
9: ; preds = %1
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %9, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @fabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}