xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int print_usage() {
  printf(" Usage: asp_print [options]\n");
  printf(" Option:\n");
  printf(" \t[ -s <vector size> ] (default: %d)\n", 1024);
  printf(" \t[ -f <input file name> ]\n");
  return 1;
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef0(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf03(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rax
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c" Usage: asp_print [options]\0A\00"
@.str.1 = [10 x i8] c" Option:\0A\00"
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@.str.3 = [28 x i8] c" \09[ -f <input file name> ]\0A\00"
define i32 @print_usage() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str.2 = [38 x i8] c" \09[ -s <vector size> ] (default: %d)\0A\00"
@str = [28 x i8] c" Usage: asp_print [options]\00"
@str.4 = [9 x i8] c" Option:\00"
@str.5 = [27 x i8] c" \09[ -f <input file name> ]\00"
define i32 @print_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.5, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
void _die(void) { _exit(EXIT_FAILURE); }


x86 assembly (clang, -O0):
<_die>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<_die>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @_die() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = call i32 @_exit(i32 %1)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @_die() {
%1 = load i32, i32* @EXIT_FAILURE
%2 = tail call i32 @_exit(i32 %1)
unreachable
}
int DRV_GET_AUTHORITY_ID(unsigned char *buf, unsigned int len) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_AUTHORITY_ID(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TEMP_LOG(int, char *, int, char *);
int system(char *);
int TEMP_ac_turn_on(void) {
  int ret;
  ret = system("irsend SEND_ONCE AC ON_27");
  if (ret < 0) {
    TEMP_LOG((2),
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/cugfeng/Home_Automation/refs/heads/"
             "master/temperature/source/ac.c",
             28, "Turn on AC failed!\n");
  }
  return ret;
}


x86 assembly (clang, -O0):
<TEMP_ac_turn_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    115e <TEMP_ac_turn_on+0x3e>
mov    $0x2,%edi
lea    0xecd(%rip),%rsi
mov    $0x1c,%edx
lea    0xf5d(%rip),%rcx
call   1040 <TEMP_LOG@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TEMP_ac_turn_on>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    1150 <TEMP_ac_turn_on+0x30>
lea    0xee0(%rip),%rsi
lea    0xf75(%rip),%rcx
mov    $0x2,%edi
mov    $0x1c,%edx
call   1040 <TEMP_LOG@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"irsend SEND_ONCE AC ON_27\00"
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cugfeng/Home_Automation/refs/heads/master/temperature/source/ac.c\00"
@.str.2 = [20 x i8] c"Turn on AC failed!\0A\00"
define i32 @TEMP_ac_turn_on() {
%1 = alloca i32
%2 = call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @TEMP_LOG(i32 2, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [26 x i8] c"irsend SEND_ONCE AC ON_27\00"
@.str.1 = [156 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/cugfeng/Home_Automation/refs/heads/master/temperature/source/ac.c\00"
@.str.2 = [20 x i8] c"Turn on AC failed!\0A\00"
define i32 @TEMP_ac_turn_on() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i32 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @TEMP_LOG(i32 2, i8* getelementptr inbounds ([156 x i8], [156 x i8]* @.str.1, i64 0, i64 0), i32 28, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
int write(int, char const *, int);
int tone(int fd, int cycles, const signed char *pattern) {
  while (cycles--) {
    if (write(fd, pattern, 10) != 10)
      return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<tone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1161 <tone+0x51>
mov    -0x8(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    $0xa,%edx
call   1030 <write@plt>
cmp    $0xa,%eax
je     115c <tone+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <tone+0x58>
jmp    1122 <tone+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tone>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
add    $0x1,%ebp
xchg   %ax,%ax
add    $0xffffffff,%ebp
je     1140 <tone+0x30>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0xa,%edx
call   1030 <write@plt>
cmp    $0xa,%eax
je     1120 <tone+0x10>
mov    $0xffffffff,%eax
jmp    1142 <tone+0x32>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @tone(i32 %0, i32 %1, i8* nocapture %2) {
br label %4
4: ; preds = %7, %3
%5 = phi i32 [ %1, %3 ], [ %8, %7 ]
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = add nsw i32 %5, -1
%9 = tail call i32 @write(i32 %0, i8* %2, i32 10)
%10 = icmp eq i32 %9, 10
br i1 %10, label %4, label %11
11: ; preds = %4, %7
%12 = phi i32 [ -1, %7 ], [ 0, %4 ]
ret i32 %12
}
int do_492() { return 492; }


x86 assembly (clang, -O0):
<do_492>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1ec,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_492>:
mov    $0x1ec,%eax
ret

LLVM IR (-O0):
define i32 @do_492() {
ret i32 492
}

LLVM IR (-O2):
define i32 @do_492() {
ret i32 492
}
unsigned int GPMCErrValStatusGet(unsigned int baseAddr) {
  unsigned int status;
  status = ((*((volatile unsigned int *)(baseAddr + (0x48)))) & (0x00000001u));
  return (status);
}


x86 assembly (clang, -O0):
<GPMCErrValStatusGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x48,%eax
mov    %eax,%eax
mov    (%rax),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPMCErrValStatusGet>:
add    $0x48,%edi
mov    (%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GPMCErrValStatusGet(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add i32 %4, 72
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
%9 = and i32 %8, 1
store i32 %9, i32* %3
%10 = load i32, i32* %3
ret i32 %10
}

LLVM IR (-O2):
define i32 @GPMCErrValStatusGet(i32 %0) {
%2 = add i32 %0, 72
%3 = zext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
%5 = load volatile i32, i32* %4
%6 = and i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ btree_keyval(int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ btree_lastkey(int, int /*<<< orphan*/);
int g_last_fileobject(int file_id, char *label) {
  if (!btree_lastkey(file_id, 0))
    return -1;
  btree_keyval(file_id, 0, label);
  label[32] = '\0';
  return 0;
}


x86 assembly (clang, -O0):
<g_last_fileobject>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <btree_lastkey@plt>
cmp    $0x0,%eax
jne    114e <g_last_fileobject+0x2e>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <g_last_fileobject+0x4b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1040 <btree_keyval@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0x20(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_last_fileobject>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %r14d,%r14d
xor    %esi,%esi
call   1030 <btree_lastkey@plt>
test   %eax,%eax
je     1149 <g_last_fileobject+0x29>
mov    %ebp,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1040 <btree_keyval@plt>
movb   $0x0,0x20(%rbx)
jmp    114f <g_last_fileobject+0x2f>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @g_last_fileobject(i32 %0, i8* %1) {
%3 = tail call i32 @btree_lastkey(i32 %0, i32 0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @btree_keyval(i32 %0, i32 0, i8* %1)
%7 = getelementptr inbounds i8, i8* %1, i64 32
store i8 0, i8* %7
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ kotlinclib_print_int(int);
int /*<<< orphan*/ kotlinclib_println();
void kotlinclib_println_int(int message) {
  kotlinclib_print_int(message);
  kotlinclib_println();
}


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

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

LLVM IR (-O0):
define void @kotlinclib_println_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @kotlinclib_print_int(i32 %3)
%5 = call i32 (...) @kotlinclib_println()
ret void
}

LLVM IR (-O2):
define void @kotlinclib_println_int(i32 %0) {
%2 = tail call i32 @kotlinclib_print_int(i32 %0)
%3 = tail call i32 (...) @kotlinclib_println()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ quicksort(void *, int, int, int (*)(void *, int, int),
                             void (*)(void *, int, int));
void Quicksort(void *array, int length, int Compare(void *, int, int),
               void Swap(void *, int, int)) {
  int low = 0;
  int high = length - 1;
  quicksort(array, low, high, Compare, Swap);
}


x86 assembly (clang, -O0):
<Quicksort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <quicksort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Quicksort>:
mov    %rcx,%r8
mov    %rdx,%rcx
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <quicksort@plt>

LLVM IR (-O0):
define void @Quicksort(i8* %0, i32 %1, i32 (i8*, i32, i32)* %2, void (i8*, i32, i32)* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32 (i8*, i32, i32)*
%8 = alloca void (i8*, i32, i32)*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 (i8*, i32, i32)* %2, i32 (i8*, i32, i32)** %7
store void (i8*, i32, i32)* %3, void (i8*, i32, i32)** %8
store i32 0, i32* %9
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %10
%13 = load i8*, i8** %5
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = load i32 (i8*, i32, i32)*, i32 (i8*, i32, i32)** %7
%17 = load void (i8*, i32, i32)*, void (i8*, i32, i32)** %8
%18 = call i32 @quicksort(i8* %13, i32 %14, i32 %15, i32 (i8*, i32, i32)* %16, void (i8*, i32, i32)* %17)
ret void
}

LLVM IR (-O2):
define void @Quicksort(i8* %0, i32 %1, i32 (i8*, i32, i32)* %2, void (i8*, i32, i32)* %3) {
%5 = add nsw i32 %1, -1
%6 = tail call i32 @quicksort(i8* %0, i32 0, i32 %5, i32 (i8*, i32, i32)* %2, void (i8*, i32, i32)* %3)
ret void
}
char getstring1() {
  char c = 'a';
  return c;
}


x86 assembly (clang, -O0):
<getstring1>:
push   %rbp
mov    %rsp,%rbp
movb   $0x61,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getstring1>:
mov    $0x61,%al
ret

LLVM IR (-O0):
define signext i8 @getstring1() {
%1 = alloca i8
store i8 97, i8* %1
%2 = load i8, i8* %1
ret i8 %2
}

LLVM IR (-O2):
define signext i8 @getstring1() {
ret i8 97
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xba() {
  Assert_real((islower(186) == 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_islower.c",
              935, ("islower should be 0 for 0xba"));
}


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

x86 assembly (clang, -O2):
<t_islower_0xba>:
push   %rax
mov    $0xba,%edi
call   1030 <islower@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x3a7,%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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xba\00"
define void @t_islower_0xba() {
%1 = call i64 @islower(i32 186)
%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 935, 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_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xba\00"
define void @t_islower_0xba() {
%1 = tail call i64 @islower(i32 186)
%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 935, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gdk_display_beep() {}


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

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

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

LLVM IR (-O2):
define void @gdk_display_beep() {
ret void
}
int test_imm_12uint16_mem(unsigned short *val) {
  return ((*val) & (-0x12 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_12uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffee,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_12uint16_mem>:
movzwl (%rdi),%eax
test   $0xffee,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_12uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -18
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t to_tc_byte(int value) { return (((value / 10) << 4) | (value % 10)); }


x86 assembly (clang, -O0):
<to_tc_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%eax
or     %edx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @to_tc_byte(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 10
%5 = shl i32 %4, 4
%6 = load i32, i32* %2
%7 = srem i32 %6, 10
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @to_tc_byte(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = shl i32 %2, 4
%4 = srem i32 %0, 10
%5 = or i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int strlen(const char *s) {
  int len = 0;
  while (*s++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1135 <strlen+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111c <strlen+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

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

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


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

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

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

LLVM IR (-O2):
define i32 @cpuhvfs_stop_dvfsp_running() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Send_MPlayer_Command(int, int /*<<< orphan*/);
void MPlayer_Mute() { Send_MPlayer_Command(0x0A, 0); }


x86 assembly (clang, -O0):
<MPlayer_Mute>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
xor    %esi,%esi
call   1030 <Send_MPlayer_Command@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPlayer_Mute>:
mov    $0xa,%edi
xor    %esi,%esi
jmp    1030 <Send_MPlayer_Command@plt>

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

LLVM IR (-O2):
define void @MPlayer_Mute() {
%1 = tail call i32 @Send_MPlayer_Command(i32 10, i32 0)
ret void
}
void swap(char *v1, char *v2) {
  if (v1 != v2) {
    char tmp = *v1;
    *v1 = *v2;
    *v2 = tmp;
  }
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1138 <swap+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
cmp    %rsi,%rdi
je     110d <swap+0xd>
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = load i8, i8* %1
store i8 %6, i8* %0
store i8 %5, i8* %1
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int shmdt(void *);
int destroy_share_memory(void *shm, int shmid) {
  if (shmdt(shm) == -1) {
    return -1;
  }
  if (shmctl(shmid, IPC_RMID, 0) == -1) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<destroy_share_memory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <shmdt@plt>
cmp    $0xffffffff,%eax
jne    114d <destroy_share_memory+0x2d>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <destroy_share_memory+0x5c>
mov    -0x14(%rbp),%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
cmp    $0xffffffff,%eax
jne    1175 <destroy_share_memory+0x55>
movl   $0xffffffff,-0x4(%rbp)
jmp    117c <destroy_share_memory+0x5c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_share_memory>:
push   %rbx
mov    %esi,%ebx
call   1030 <shmdt@plt>
cmp    $0xffffffff,%eax
je     114d <destroy_share_memory+0x2d>
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
call   1040 <shmctl@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@IPC_RMID = global i32 0
define i32 @destroy_share_memory(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = call i32 @shmdt(i8* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 -1, i32* %3
br label %17
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* @IPC_RMID
%13 = call i32 @shmctl(i32 %11, i32 %12, i32 0)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 -1, i32* %3
br label %17
16: ; preds = %10
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %9
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define i32 @destroy_share_memory(i8* %0, i32 %1) {
%3 = tail call i32 @shmdt(i8* %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i32, i32* @IPC_RMID
%7 = tail call i32 @shmctl(i32 %1, i32 %6, i32 0)
%8 = icmp eq i32 %7, -1
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %5, %2
%11 = phi i32 [ -1, %2 ], [ %9, %5 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test_FILE();
int main(int argc, char *argv[]) {
  char array[20];
  int n = 10;
  test_FILE();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x34(%rbp)
mov    $0x0,%al
call   1030 <test_FILE@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_FILE@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %7
%8 = call i32 (...) @test_FILE()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_FILE()
ret i32 0
}
/* Variables and functions */
void stub1(int, float);
void testClosureIFrV(void (*closure)(int, float), int a1, float a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureIFrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  %xmm0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112d <testClosureIFrV+0x2d>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
movss  -0x10(%rbp),%xmm0
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureIFrV>:
test   %rdi,%rdi
je     110c <testClosureIFrV+0xc>
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureIFrV(void (i32, float)* %0, i32 %1, float %2) {
%4 = icmp eq void (i32, float)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i32 %1, float %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void format_err(int lno) {
  fprintf(stderr, "Input file format error. Line %d.\n", lno);
  exit(1);
}


x86 assembly (clang, -O0):
<format_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<format_err>:
push   %rax
mov    %edi,%edx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"Input file format error. Line %d.\0A\00"
define void @format_err(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"Input file format error. Line %d.\0A\00"
define void @format_err(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int shmget(int, int /*<<< orphan*/, int);
int get_polar_shmid(int readonly) {
  int shmid;
  if (readonly) {
    shmid = shmget(
        ((22 << 25) | (12 << 20) | (13 << 15) | (16 << 10) | (15 << 5) | 12), 0,
        0444);
  } else {
    shmid = shmget(
        ((22 << 25) | (12 << 20) | (13 << 15) | (16 << 10) | (15 << 5) | 12), 0,
        0664);
  }
  return shmid;
}


x86 assembly (clang, -O0):
<get_polar_shmid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113e <get_polar_shmid+0x2e>
mov    $0x2cc6c1ec,%edi
xor    %esi,%esi
mov    $0x124,%edx
call   1030 <shmget@plt>
mov    %eax,-0x8(%rbp)
jmp    1152 <get_polar_shmid+0x42>
mov    $0x2cc6c1ec,%edi
xor    %esi,%esi
mov    $0x1b4,%edx
call   1030 <shmget@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_polar_shmid>:
test   %edi,%edi
mov    $0x1b4,%eax
mov    $0x124,%edx
cmove  %eax,%edx
mov    $0x2cc6c1ec,%edi
xor    %esi,%esi
jmp    1030 <shmget@plt>

LLVM IR (-O0):
define i32 @get_polar_shmid(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @shmget(i32 751223276, i32 0, i32 292)
store i32 %7, i32* %3
br label %10
8: ; preds = %1
%9 = call i32 @shmget(i32 751223276, i32 0, i32 436)
store i32 %9, i32* %3
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @get_polar_shmid(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 436, i32 292
%4 = tail call i32 @shmget(i32 751223276, i32 0, i32 %3)
ret i32 %4
}
void foo311(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo311(i32 %0) {
ret void
}
int isStartRelationalOperator(char c) {
  int result = -1;
  if (c == '=' || c == '<' || c == '>' || c == '!') {
    result = 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<isStartRelationalOperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x3d,%eax
je     1145 <isStartRelationalOperator+0x45>
movsbl -0x1(%rbp),%eax
cmp    $0x3c,%eax
je     1145 <isStartRelationalOperator+0x45>
movsbl -0x1(%rbp),%eax
cmp    $0x3e,%eax
je     1145 <isStartRelationalOperator+0x45>
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
jne    114c <isStartRelationalOperator+0x4c>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isStartRelationalOperator>:
mov    $0xffffffff,%eax
cmp    $0x3e,%dil
ja     1124 <isStartRelationalOperator+0x24>
movzbl %dil,%ecx
movabs $0x7000000200000000,%rdx
bt     %rcx,%rdx
jae    1124 <isStartRelationalOperator+0x24>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isStartRelationalOperator(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 -1, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 61
br i1 %6, label %19, label %7
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 60
br i1 %10, label %19, label %11
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 62
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 33
br i1 %18, label %19, label %20
19: ; preds = %15, %11, %7, %1
store i32 1, i32* %3
br label %20
20: ; preds = %19, %15
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @isStartRelationalOperator(i8 signext %0) {
switch i8 %0, label %3 [
i8 62, label %2
i8 61, label %2
i8 60, label %2
i8 33, label %2
]
2: ; preds = %1, %1, %1, %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 1, %2 ], [ -1, %1 ]
ret i32 %4
}
int isPowerOf2(int num) {
  if (num == 2) {
    return 1;
  } else if (num == 4) {
    return 1;
  } else if (num == 8) {
    return 1;
  } else if (num == 16) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isPowerOf2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111d <isPowerOf2+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1175 <isPowerOf2+0x75>
cmpl   $0x4,-0x8(%rbp)
jne    1133 <isPowerOf2+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1175 <isPowerOf2+0x75>
cmpl   $0x8,-0x8(%rbp)
jne    1149 <isPowerOf2+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1175 <isPowerOf2+0x75>
cmpl   $0x10,-0x8(%rbp)
jne    115f <isPowerOf2+0x5f>
movl   $0x1,-0x4(%rbp)
jmp    1175 <isPowerOf2+0x75>
jmp    1164 <isPowerOf2+0x64>
jmp    1169 <isPowerOf2+0x69>
jmp    116e <isPowerOf2+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOf2>:
add    $0xfffffffe,%edi
ror    %edi
xor    %eax,%eax
cmp    $0x7,%edi
ja     1119 <isPowerOf2+0x19>
movslq %edi,%rax
lea    0xeea(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.isPowerOf2 = [8 x i32] [i32 1, i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, i32 1]
define i32 @isPowerOf2(i32 %0) {
%2 = add i32 %0, -2
%3 = tail call i32 @llvm.fshl.i32(i32 %2, i32 %2, i32 31)
%4 = icmp ult i32 %3, 8
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.isPowerOf2, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
__typeof__(ispunct(1)) test_ispunct_49(void) { return ispunct(1); }


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

x86 assembly (clang, -O2):
<test_ispunct_49>:
mov    $0x1,%edi
jmp    1030 <ispunct@plt>

LLVM IR (-O0):
define i32 @test_ispunct_49() {
%1 = call i32 @ispunct(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_ispunct_49() {
%1 = tail call i32 @ispunct(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, float const, float const,
                          float const);
void v3print(const char *msg, const float *v) {
  printf("v3: %s = [ %f, %f, %f ]\n", msg, v[0], v[1], v[2]);
}


x86 assembly (clang, -O0):
<v3print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v3print>:
mov    %rdi,%rax
movss  (%rsi),%xmm0
movss  0x4(%rsi),%xmm1
movss  0x8(%rsi),%xmm2
lea    0xed8(%rip),%rdi
mov    %rax,%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"v3: %s = [ %f, %f, %f ]\0A\00"
define void @v3print(i8* %0, float* %1) {
%3 = alloca i8*
%4 = alloca float*
store i8* %0, i8** %3
store float* %1, float** %4
%5 = load i8*, i8** %3
%6 = load float*, float** %4
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %4
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 2
%14 = load float, float* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %5, float %8, float %11, float %14)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"v3: %s = [ %f, %f, %f ]\0A\00"
define void @v3print(i8* %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = getelementptr inbounds float, float* %1, i64 1
%5 = load float, float* %4
%6 = getelementptr inbounds float, float* %1, i64 2
%7 = load float, float* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %0, float %3, float %5, float %7)
ret void
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
float diffTime(clock_t t2, clock_t t1) {
  float diff = (((float)t2 - (float)t1) / 1000000.0F) * 1000;
  return diff;
}


x86 assembly (clang, -O0):
<diffTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtsi2ssq -0x10(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  0xee0(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xed0(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffTime>:
cvtsi2ss %rdi,%xmm0
cvtsi2ss %rsi,%xmm1
subss  %xmm1,%xmm0
divss  0xeea(%rip),%xmm0
mulss  0xee6(%rip),%xmm0
ret

LLVM IR (-O0):
define float @diffTime(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = sitofp i64 %6 to float
%8 = load i64, i64* %4
%9 = sitofp i64 %8 to float
%10 = fsub float %7, %9
%11 = fdiv float %10, 1.000000e+06
%12 = fmul float %11, 1.000000e+03
store float %12, float* %5
%13 = load float, float* %5
ret float %13
}

LLVM IR (-O2):
define float @diffTime(i64 %0, i64 %1) {
%3 = sitofp i64 %0 to float
%4 = sitofp i64 %1 to float
%5 = fsub float %3, %4
%6 = fdiv float %5, 1.000000e+06
%7 = fmul float %6, 1.000000e+03
ret float %7
}
void uniphier_board_reset(void) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<uniphier_board_reset>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <uniphier_board_reset+0x9>
jmp    110e <uniphier_board_reset+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @uniphier_board_reset() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ move_cursor(int, int);
void hide_cursor(void) { move_cursor(-1, -1); }


x86 assembly (clang, -O0):
<hide_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%esi
mov    %esi,%edi
call   1030 <move_cursor@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hide_cursor>:
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
jmp    1030 <move_cursor@plt>

LLVM IR (-O0):
define void @hide_cursor() {
%1 = call i32 @move_cursor(i32 -1, i32 -1)
ret void
}

LLVM IR (-O2):
define void @hide_cursor() {
%1 = tail call i32 @move_cursor(i32 -1, i32 -1)
ret void
}
indreg0adrx1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((*p0) <= (((double *)(11111111 & ~(__alignof__(double) - 1)))[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<indreg0adrx1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm1
movslq -0x20(%rbp),%rcx
mov    $0xa98ac0,%eax
movsd  (%rax,%rcx,8),%xmm0
ucomisd %xmm1,%xmm0
jb     1148 <indreg0adrx1+0x48>
movl   $0x1,-0x4(%rbp)
jmp    114f <indreg0adrx1+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<indreg0adrx1>:
movslq %esi,%rax
movsd  0xa98ac0(,%rax,8),%xmm0
xor    %eax,%eax
ucomisd (%rdx),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @indreg0adrx1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = load double, double* %14
%16 = load i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double, double* inttoptr (i64 11111104 to double*), i64 %17
%19 = load double, double* %18
%20 = fcmp ole double %15, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @indreg0adrx1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture readnone %5) {
%7 = load double, double* %4
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* inttoptr (i64 11111104 to double*), i64 %8
%10 = load double, double* %9
%11 = fcmp ole double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char *, size_t);
int strlen(char *);
char *sdup(char *src) {
  size_t n = 1 + strlen(src);
  char *x = malloc(n);
  memcpy(x, src, n);
  return x;
}


x86 assembly (clang, -O0):
<sdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @sdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 1, %6
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @sdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int simulate_thread_final_verify() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @simulate_thread_final_verify() {
ret i32 0
}
/* Variables and functions */
int rand();
void gen_random(char *buf, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    buf[i] = (unsigned char)(rand() % 0x100);
  }
}


x86 assembly (clang, -O0):
<gen_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115a <gen_random+0x4a>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <gen_random+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_random>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1144 <gen_random+0x34>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <gen_random+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @gen_random(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = tail call i32 (...) @rand()
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %9, i8* %10
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}