xunge/DecIR huggingface dataset:
/* Variables and functions */
int O_NDELAY;
int O_RDONLY;
int open(char *, int);
int open_read(char *fn) { return open(fn, O_RDONLY | O_NDELAY); }


x86 assembly (clang, -O0):
<open_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_read>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_RDONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_read(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @O_RDONLY
%5 = load i32, i32* @O_NDELAY
%6 = or i32 %4, %5
%7 = call i32 @open(i8* %3, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@O_NDELAY = global i32 0
define i32 @open_read(i8* nocapture %0) {
%2 = load i32, i32* @O_RDONLY
%3 = load i32, i32* @O_NDELAY
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_manager_sudirribe() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_manager_sudirribe"
         "\n");
}


x86 assembly (clang, -O0):
<pa_ext_device_manager_sudirribe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [49 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_sudirribe\0A\00"
define i32 @pa_ext_device_manager_sudirribe() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [48 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_sudirribe\00"
define i32 @pa_ext_device_manager_sudirribe() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ cmdled;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int /*<<< orphan*/ system(char *);
void turn_usb_led(int on) {
  char cmdled[128];
  snprintf(cmdled, sizeof(cmdled), "/sbin/ledcontrol -n usb -c green -s %s",
           on ? "on" : "off");
  system(cmdled);
}


x86 assembly (clang, -O0):
<turn_usb_led>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeeb(%rip),%rcx
lea    0xee1(%rip),%rax
cmp    $0x0,%edx
cmovne %rax,%rcx
mov    $0x80,%esi
lea    0xea7(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_usb_led>:
push   %rbx
sub    $0x80,%rsp
test   %edi,%edi
lea    0xef9(%rip),%rax
lea    0xeef(%rip),%rcx
cmove  %rax,%rcx
lea    0xebd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <snprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"/sbin/ledcontrol -n usb -c green -s %s\00"
@.str.1 = [3 x i8] c"on\00"
@.str.2 = [4 x i8] c"off\00"
define void @turn_usb_led(i32 %0) {
%2 = alloca i32
%3 = alloca [128 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @snprintf(i8* %4, i32 128, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"/sbin/ledcontrol -n usb -c green -s %s\00"
@.str.1 = [3 x i8] c"on\00"
@.str.2 = [4 x i8] c"off\00"
define void @turn_usb_led(i32 %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%6 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int pixel_satd_wxh(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *, int, int,
                   int);
int pixel_satd_8x16(uint8_t *pix1, int i_stride_pix1, uint8_t *pix2,
                    int i_stride_pix2) {
  return pixel_satd_wxh(pix1, i_stride_pix1, pix2, i_stride_pix2, 8, 16);
}


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

x86 assembly (clang, -O2):
<pixel_satd_8x16>:
mov    $0x8,%r8d
mov    $0x10,%r9d
jmp    1030 <pixel_satd_wxh@plt>

LLVM IR (-O0):
define i32 @pixel_satd_8x16(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32, i32* %8
%13 = call i32 @pixel_satd_wxh(i32* %9, i32 %10, i32* %11, i32 %12, i32 8, i32 16)
ret i32 %13
}

LLVM IR (-O2):
define i32 @pixel_satd_8x16(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @pixel_satd_wxh(i32* %0, i32 %1, i32* %2, i32 %3, i32 8, i32 16)
ret i32 %5
}
const char *SvnRev() { return "260"; }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"260\00"
define i8* @SvnRev() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [4 x i8] c"260\00"
define i8* @SvnRev() {
ret i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void writeerr() {
  printf("error writing output file\n");
  exit(1);
}


x86 assembly (clang, -O0):
<writeerr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<writeerr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"error writing output file\0A\00"
define void @writeerr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"error writing output file\00"
define void @writeerr() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_file_selection_set_select_multiple() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ PR_SET_NAME;
int /*<<< orphan*/ prctl(int /*<<< orphan*/, unsigned long);
int /*<<< orphan*/ strncpy(char *, char const *, int);
void set_threadname(const char *name) {
  char threadname[17];
  strncpy(threadname, name, sizeof(threadname));
  threadname[16] = 0;
  prctl(PR_SET_NAME, (unsigned long)threadname);
}


x86 assembly (clang, -O0):
<set_threadname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x11,%edx
call   1030 <strncpy@plt>
movb   $0x0,-0x10(%rbp)
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rsi
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_threadname>:
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x11,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x10(%rsp)
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <prctl@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@PR_SET_NAME = global i32 0
define void @set_threadname(i8* %0) {
%2 = alloca i8*
%3 = alloca [17 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @strncpy(i8* %4, i8* %5, i32 17)
%7 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 16
store i8 0, i8* %7
%8 = load i32, i32* @PR_SET_NAME
%9 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%10 = ptrtoint i8* %9 to i64
%11 = call i32 @prctl(i32 %8, i64 %10)
ret void
}

LLVM IR (-O2):
@PR_SET_NAME = global i32 0
define void @set_threadname(i8* %0) {
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%4 = call i32 @strncpy(i8* %3, i8* %0, i32 17)
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 16
store i8 0, i8* %5
%6 = load i32, i32* @PR_SET_NAME
%7 = ptrtoint [17 x i8]* %2 to i64
%8 = call i32 @prctl(i32 %6, i64 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("BaBo ikicha\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"BaBo ikicha\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printWelcomeLine() { printf("Welcome to P2PFrame!\n"); }


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"Welcome to P2PFrame!\00"
define void @printWelcomeLine() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ headset_no_mic();
int mmi_audio_mode_map(int ap_mode) {
  int cp_mode = 0;
  if (ap_mode == 1) {
    cp_mode = 0;
  } else if (ap_mode == 2) {
    cp_mode = 1;
  } else if (ap_mode == 4) {
    if (headset_no_mic()) {
      cp_mode = 4;
    } else {
      cp_mode = 2;
    }
  }
  return cp_mode;
}


x86 assembly (clang, -O0):
<mmi_audio_mode_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1138 <mmi_audio_mode_map+0x28>
movl   $0x0,-0x8(%rbp)
jmp    118b <mmi_audio_mode_map+0x7b>
cmpl   $0x2,-0x4(%rbp)
jne    114e <mmi_audio_mode_map+0x3e>
movl   $0x1,-0x8(%rbp)
jmp    1186 <mmi_audio_mode_map+0x76>
cmpl   $0x4,-0x4(%rbp)
jne    1181 <mmi_audio_mode_map+0x71>
mov    $0x0,%al
call   1030 <headset_no_mic@plt>
cmp    $0x0,%rax
je     1175 <mmi_audio_mode_map+0x65>
movl   $0x4,-0x8(%rbp)
jmp    117c <mmi_audio_mode_map+0x6c>
movl   $0x2,-0x8(%rbp)
jmp    1181 <mmi_audio_mode_map+0x71>
jmp    1186 <mmi_audio_mode_map+0x76>
jmp    118b <mmi_audio_mode_map+0x7b>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mmi_audio_mode_map>:
cmp    $0x4,%edi
je     1122 <mmi_audio_mode_map+0x12>
xor    %eax,%eax
cmp    $0x2,%edi
jne    113c <mmi_audio_mode_map+0x2c>
mov    $0x1,%eax
ret
push   %rax
xor    %eax,%eax
call   1030 <headset_no_mic@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,1),%eax
add    $0x2,%eax
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @mmi_audio_mode_map(i32 %0) {
switch i32 %0, label %7 [
i32 4, label %3
i32 2, label %2
]
2: ; preds = %1
br label %7
3: ; preds = %1
%4 = tail call i64 (...) @headset_no_mic()
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 2, i32 4
br label %7
7: ; preds = %3, %1, %2
%8 = phi i32 [ 1, %2 ], [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void sigpipe_handler(int sig) { printf("Broken pipe!!!!\n"); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Broken pipe!!!!\0A\00"
define void @sigpipe_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [16 x i8] c"Broken pipe!!!!\00"
define void @sigpipe_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
unsigned long UINT_MAX;
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long);
int /*<<< orphan*/ stdout;
int main(void) {
  unsigned long ulval = -1;
  if (ulval == UINT_MAX)
    printf("%lu = %u\n", ulval, UINT_MAX);
  else
    fputs("Err.\n", stdout);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0xffffffffffffffff,-0x10(%rbp)
ff
mov    -0x10(%rbp),%rax
mov    0x2ea6(%rip),%rcx
cmp    (%rcx),%rax
jne    116a <main+0x4a>
mov    -0x10(%rbp),%rsi
mov    0x2e92(%rip),%rax
mov    (%rax),%rdx
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    117f <main+0x5f>
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
lea    0xe90(%rip),%rdi
call   1040 <fputs@plt>
mov    0x2e4a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
cmpq   $0xffffffffffffffff,(%rax)
je     1145 <main+0x25>
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1040 <fputs@plt>
jmp    115f <main+0x3f>
lea    0xeb4(%rip),%rdi
mov    $0xffffffffffffffff,%rsi
mov    $0xffffffffffffffff,%rdx
call   1030 <printf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@UINT_MAX = global i64 0
@.str = [10 x i8] c"%lu = %u\0A\00"
@.str.1 = [6 x i8] c"Err.\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i64, i64* @UINT_MAX
%2 = icmp eq i64 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 -1, i64 -1)
br label %8
5: ; preds = %0
%6 = load i32, i32* @stdout
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %3
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}
void ppt3() {}


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

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

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

LLVM IR (-O2):
define void @ppt3() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lazy_rest_c_apiInit();
void NimMainInner(void) { lazy_rest_c_apiInit(); }


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

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

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

LLVM IR (-O2):
define void @NimMainInner() {
%1 = tail call i32 (...) @lazy_rest_c_apiInit()
ret void
}
/* Variables and functions */
int CHAR_BIT;
unsigned char make_char_mask(unsigned count) {
  static const unsigned char masks[] = {0,    0x1,  0x3,  0x7, 0xF,
                                        0x1F, 0x3F, 0x7F, 0xFF};
  return masks[count % (CHAR_BIT + 1)];
}


x86 assembly (clang, -O0):
<make_char_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ecf(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
mov    %eax,%ecx
lea    0xedb(%rip),%rax
movzbl (%rax,%rcx,1),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_char_mask>:
mov    %edi,%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
xor    %edx,%edx
div    %ecx
lea    0xee7(%rip),%rax
mov    (%rdx,%rax,1),%al
ret

LLVM IR (-O0):
@make_char_mask.masks = internal constant [9 x i8] c"\00\01\03\07\0F\1F?\7F\FF"
@CHAR_BIT = global i32 0
define zeroext i8 @make_char_mask(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @CHAR_BIT
%5 = add nsw i32 %4, 1
%6 = urem i32 %3, %5
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds [9 x i8], [9 x i8]* @make_char_mask.masks, i64 0, i64 %7
%9 = load i8, i8* %8
ret i8 %9
}

LLVM IR (-O2):
@make_char_mask.masks = internal unnamed_addr constant [9 x i8] c"\00\01\03\07\0F\1F?\7F\FF"
@CHAR_BIT = global i32 0
define zeroext i8 @make_char_mask(i32 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = add nsw i32 %2, 1
%4 = urem i32 %0, %3
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [9 x i8], [9 x i8]* @make_char_mask.masks, i64 0, i64 %5
%7 = load i8, i8* %6
ret i8 %7
}
void printf(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define void @printf(i8* nocapture %0) {
ret void
}
void gtk_expander_get_use_markup() {}


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

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

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

LLVM IR (-O2):
define void @gtk_expander_get_use_markup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setBufferedInput(int);
void signal_callback_handler(int signum) {
  printf("         TERMINATED         \n");
  setBufferedInput(true);
  printf("\033[?25h\033[0m");
  exit(signum);
}


x86 assembly (clang, -O0):
<signal_callback_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <setBufferedInput@plt>
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<signal_callback_handler>:
push   %rbx
mov    %edi,%ebx
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <setBufferedInput@plt>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c" TERMINATED \0A\00"
@.str.1 = [11 x i8] c"\1B[?25h\1B[0m\00"
define void @signal_callback_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @setBufferedInput(i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"\1B[?25h\1B[0m\00"
@str = [29 x i8] c" TERMINATED \00"
define void @signal_callback_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @setBufferedInput(i32 1)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int system(char *);
int main(int argc, char *argv[]) {
  int return_value;
  return_value = system("ls -l /");
  return return_value;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"ls -l /\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ checkAllBusesWright();
int /*<<< orphan*/ iopl(int);
int main() {
  iopl(3);
  checkAllBusesWright();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @iopl(i32 3)
%2 = tail call i32 (...) @checkAllBusesWright()
ret i32 0
}
/* Variables and functions */
int RAND_MAX;
double rand();
double randf(double m) { return m * rand() / (RAND_MAX - 1.); }


x86 assembly (clang, -O0):
<randf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2ea7(%rip),%rax
cvtsi2sdl (%rax),%xmm1
movsd  0xeb3(%rip),%xmm2
subsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randf>:
push   %rax
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec4(%rip),%rax
cvtsi2sdl (%rax),%xmm1
mulsd  (%rsp),%xmm0
addsd  0xecb(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define double @randf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double (...) @rand()
%5 = fmul double %3, %4
%6 = load i32, i32* @RAND_MAX
%7 = sitofp i32 %6 to double
%8 = fsub double %7, 1.000000e+00
%9 = fdiv double %5, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define double @randf(double %0) {
%2 = tail call double (...) @rand()
%3 = fmul double %2, %0
%4 = load i32, i32* @RAND_MAX
%5 = sitofp i32 %4 to double
%6 = fadd double %5, -1.000000e+00
%7 = fdiv double %3, %6
ret double %7
}
/* Variables and functions */
double UINT32_MAX;
double xor128();
double genrand_real3(void) {
  return (xor128() + 0.5) * (1.0 / (UINT32_MAX + 1.0));
}


x86 assembly (clang, -O0):
<genrand_real3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <xor128@plt>
movsd  0xee5(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xed1(%rip),%xmm2
mov    0x2ec2(%rip),%rax
addsd  (%rax),%xmm2
movsd  0xebe(%rip),%xmm1
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real3>:
push   %rax
xor    %eax,%eax
call   1030 <xor128@plt>
addsd  0xee0(%rip),%xmm0
mov    0x2ed1(%rip),%rax
movsd  0xed9(%rip),%xmm1
movsd  (%rax),%xmm2
addsd  %xmm1,%xmm2
divsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@UINT32_MAX = global double 0.000000e+00
define double @genrand_real3() {
%1 = call double (...) @xor128()
%2 = fadd double %1, 5.000000e-01
%3 = load double, double* @UINT32_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fmul double %2, %5
ret double %6
}

LLVM IR (-O2):
@UINT32_MAX = global double 0.000000e+00
define double @genrand_real3() {
%1 = tail call double (...) @xor128()
%2 = fadd double %1, 5.000000e-01
%3 = load double, double* @UINT32_MAX
%4 = fadd double %3, 1.000000e+00
%5 = fdiv double 1.000000e+00, %4
%6 = fmul double %2, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void imprime(char *s) { printf("%s", s); }


x86 assembly (clang, -O0):
<imprime>:
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):
<imprime>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @imprime(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void gtk_widget_set_colormap() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_set_colormap() {
ret void
}
void set_mfg_usb_carkit_enable(int enable) { return; }


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

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

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

LLVM IR (-O2):
define void @set_mfg_usb_carkit_enable(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ XcpTransportClose();
void XcpMasterDeinit(void) { XcpTransportClose(); }


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

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

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

LLVM IR (-O2):
define void @XcpMasterDeinit() {
%1 = tail call i32 (...) @XcpTransportClose()
ret void
}
void f(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @f(i8* nocapture %0, ...) {
ret void
}
char *langRomTypeEseRam512() { return "512kB Ese-RAM"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"512kB Ese-RAM\00"
define i8* @langRomTypeEseRam512() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"512kB Ese-RAM\00"
define i8* @langRomTypeEseRam512() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
unsigned int _EndianSwapUnsignedInt(unsigned int val) {
  val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
  return (val << 16) | (val >> 16);
}


x86 assembly (clang, -O0):
<_EndianSwapUnsignedInt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00ff00,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_EndianSwapUnsignedInt>:
mov    %edi,%eax
bswap  %eax
ret

LLVM IR (-O0):
define i32 @_EndianSwapUnsignedInt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, -16711936
%6 = load i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 16711935
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = shl i32 %10, 16
%12 = load i32, i32* %2
%13 = lshr i32 %12, 16
%14 = or i32 %11, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @_EndianSwapUnsignedInt(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int yyerror(char *s) { fprintf(stderr, "%s\n", s); }


x86 assembly (clang, -O0):
<yyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @yyerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Type definitions */
typedef void FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(void *);
int /*<<< orphan*/ fflush(void *);
void *fopen(char *, char *);
int /*<<< orphan*/ fprintf(void *, char *, char *);
void _log_error(char *mesg) {
  FILE *fp = fopen("ErrorCatch.log", "a+");
  if (fp != ((void *)0)) {
    fprintf(fp, "%s.\r\n", mesg);
    fflush(fp);
    fclose(fp);
  }
}


x86 assembly (clang, -O0):
<_log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1194 <_log_error+0x54>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe95(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1050 <fflush@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_log_error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xeb2(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1060 <fopen@plt>
test   %rax,%rax
je     118b <_log_error+0x4b>
mov    %rax,%rbx
lea    0xea9(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fflush@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ErrorCatch.log\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [6 x i8] c"%s.\0D\0A\00"
define void @_log_error(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = call i8* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @fprintf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
%12 = call i32 @fflush(i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @fclose(i8* %13)
br label %15
15: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"ErrorCatch.log\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [6 x i8] c"%s.\0D\0A\00"
define void @_log_error(i8* %0) {
%2 = tail call i8* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @fprintf(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%6 = tail call i32 @fflush(i8* %2)
%7 = tail call i32 @fclose(i8* %2)
br label %8
8: ; preds = %4, %1
ret void
}
unsigned long gcd(unsigned long a, unsigned long b) {
  if (a == 0 || b == 0)
    return a + b;
  return gcd(b, a % b);
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <gcd+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1147 <gcd+0x37>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1163 <gcd+0x53>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,%rsi
call   1030 <gcd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rsi,%rdx
mov    %rdi,%rax
test   %rdi,%rdi
je     1110 <gcd+0x10>
test   %rdx,%rdx
jne    112d <gcd+0x2d>
mov    %rax,%rcx
add    %rdx,%rcx
mov    %rcx,%rax
ret
nopw   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1113 <gcd+0x13>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1120 <gcd+0x20>
xor    %edx,%edx
div    %ecx
jmp    1125 <gcd+0x25>

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
%4 = icmp eq i64 %1, 0
%5 = or i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %10, %2
%7 = phi i64 [ %0, %2 ], [ %11, %10 ]
%8 = phi i64 [ %1, %2 ], [ %13, %10 ]
%9 = add i64 %8, %7
ret i64 %9
10: ; preds = %2, %10
%11 = phi i64 [ %13, %10 ], [ %1, %2 ]
%12 = phi i64 [ %11, %10 ], [ %0, %2 ]
%13 = urem i64 %12, %11
%14 = icmp eq i64 %13, 0
br i1 %14, label %6, label %10
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
scalar_t__ checkflag(char **);
int /*<<< orphan*/ fail();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  if (argc != 2)
    fail();
  if (checkflag(argv))
    fail();
  printf("Congratulations, you have found the flag.\n");
  _exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1167 <main+0x27>
mov    $0x0,%al
call   1040 <fail@plt>
mov    -0x10(%rbp),%rdi
call   1050 <checkflag@plt>
cmp    $0x0,%rax
je     1181 <main+0x41>
mov    $0x0,%al
call   1040 <fail@plt>
lea    0xe78(%rip),%rdi
call   1060 <printf@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
je     1150 <main+0x10>
xor    %eax,%eax
call   1050 <fail@plt>
mov    %rbx,%rdi
call   1060 <checkflag@plt>
test   %rax,%rax
je     1164 <main+0x24>
xor    %eax,%eax
call   1050 <fail@plt>
lea    0xe95(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Congratulations, you have found the flag.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @fail()
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = call i64 @checkflag(i8** %11)
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 (...) @fail()
br label %16
16: ; preds = %14, %10
%17 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [42 x i8] c"Congratulations, you have found the flag.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @fail()
br label %6
6: ; preds = %4, %2
%7 = tail call i64 @checkflag(i8** %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @fail()
br label %11
11: ; preds = %9, %6
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 @_exit(i32 0)
unreachable
}
double e1f(double a1, double c1) {
  double e1;
  e1 = c1 / a1;
  return (e1);
}


x86 assembly (clang, -O0):
<e1f>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<e1f>:
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @e1f(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %4
%7 = load double, double* %3
%8 = fdiv double %6, %7
store double %8, double* %5
%9 = load double, double* %5
ret double %9
}

LLVM IR (-O2):
define double @e1f(double %0, double %1) {
%3 = fdiv double %1, %0
ret double %3
}
unsigned xrop3_182_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D & T;
  stk3 = S | stk4;
  stk2 = T ^ stk3;
  stk1 = D ^ stk2;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_182_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
or     -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_182_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
xor    %ecx,%eax
not    %esi
and    %esi,%eax
xor    $0xff,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_182_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = xor i32 %5, -1
%8 = xor i32 %6, %4
%9 = and i32 %8, %7
%10 = xor i32 %9, 255
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/, int /*<<< orphan*/,
                                   int /*<<< orphan*/);
uint32_t bytecode_puship() { return _bytecode_write(10, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<bytecode_puship>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <_bytecode_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_puship>:
mov    $0xa,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_puship() {
%1 = call i32 @_bytecode_write(i32 10, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bytecode_puship() {
%1 = tail call i32 @_bytecode_write(i32 10, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %1
}
int ishex(char c) {
  if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
      (c >= 'A' && c <= 'F')) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1124 <ishex+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1158 <ishex+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     113e <ishex+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jle    1158 <ishex+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1164 <ishex+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     1164 <ishex+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <ishex+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ishex(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %27, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 102
br i1 %18, label %27, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 65
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 70
br i1 %26, label %27, label %28
27: ; preds = %23, %15, %7
store i32 1, i32* %2
br label %29
28: ; preds = %23, %19
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ int_controller_clear(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
int nmi_device_ack(void) {
  printf("\nNMI\n");
  fflush(stdout);
  int_controller_clear(7);
  return 0xffffffff;
}


x86 assembly (clang, -O0):
<nmi_device_ack>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x7,%edi
call   1030 <int_controller_clear@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nmi_device_ack>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x7,%edi
call   1040 <int_controller_clear@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"\0ANMI\0A\00"
@stdout = global i32 0
define i32 @nmi_device_ack() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
%4 = call i32 @int_controller_clear(i32 7)
ret i32 -1
}

LLVM IR (-O2):
@stdout = global i32 0
@str = [5 x i8] c"\0ANMI\00"
define i32 @nmi_device_ack() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = tail call i32 @int_controller_clear(i32 7)
ret i32 -1
}