xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char *, char);
void RemoveLineEndings(char *Buffer) {
  char *Text;
  Text = strrchr(Buffer, '\n');
  if (Text)
    *Text = 0;
  Text = strrchr(Buffer, '\r');
  if (Text)
    *Text = 0;
}


x86 assembly (clang, -O0):
<RemoveLineEndings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <RemoveLineEndings+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0xd,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <RemoveLineEndings+0x54>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RemoveLineEndings>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     1126 <RemoveLineEndings+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     113b <RemoveLineEndings+0x2b>
movb   $0x0,(%rax)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @RemoveLineEndings(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 13)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %5
store i8 0, i8* %6
br label %9
9: ; preds = %8, %5
ret void
}
/* Variables and functions */
int f(int);
main() {
  int x = f(1);
  int y = f(0);
  return x + y;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
xor    %edi,%edi
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1030 <f@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1030 <f@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @f(i32 1)
store i32 %4, i32* %2
%5 = call i32 @f(i32 0)
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @f(i32 0)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ *bwstrdup_n(int /*<<< orphan*/ const *, int /*<<< orphan*/);
int /*<<< orphan*/ wcslen(int /*<<< orphan*/ const *);
wchar_t *bwstrdup(const wchar_t *str) {
  if (!str)
    return NULL;
  return bwstrdup_n(str, wcslen(str));
}


x86 assembly (clang, -O0):
<bwstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <bwstrdup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1164 <bwstrdup+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <wcslen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <bwstrdup_n@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bwstrdup>:
test   %rdi,%rdi
je     1139 <bwstrdup+0x19>
push   %rbx
mov    %rdi,%rbx
call   1030 <wcslen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <bwstrdup_n@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32* @bwstrdup(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @wcslen(i32* %0)
%5 = tail call i32* @bwstrdup_n(i32* %0, i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32* [ %5, %3 ], [ null, %1 ]
ret i32* %7
}
/* Type definitions */
struct stat {
  int st_size;
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char *, struct stat *);
int fileExist(char *filename) {
  struct stat st;
  stat(filename, &st);
  if (S_ISREG(st.st_mode))
    return st.st_size;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fileExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x14(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
je     1156 <fileExist+0x36>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <fileExist+0x3d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileExist>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    0x4(%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     113f <fileExist+0x1f>
mov    (%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32, i32 }
define i32 @fileExist(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 1
%6 = load i32, i32* %5
%7 = tail call i64 @S_ISREG(i32 %6)
%8 = icmp eq i64 %7, 0
%9 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%10 = load i32, i32* %9
%11 = select i1 %8, i32 0, i32 %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_long_long_compare(const void *p1, const void *p2,
                                                size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_long_long_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_long_long_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_long_long_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void print_progr_ps(char perc, char *size, char *bps, char eta_s, char eta_m,
                    char eta_h) {
  printf("\r %3d%% of %s @ %s/s ETA %02d:%02d:%02d   ", perc, size, bps, eta_h,
         eta_m, eta_s);
  return;
}


x86 assembly (clang, -O0):
<print_progr_ps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %r8d,-0x38(%rbp)
mov    %ecx,%eax
mov    -0x38(%rbp),%ecx
mov    %eax,-0x34(%rbp)
mov    %rdx,%rax
mov    -0x34(%rbp),%edx
mov    %rax,-0x30(%rbp)
mov    %rsi,%rax
mov    -0x30(%rbp),%rsi
mov    %rax,-0x28(%rbp)
mov    %edi,%r8d
mov    -0x28(%rbp),%rdi
mov    %r9b,%al
mov    %r8b,-0x1(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %dl,-0x19(%rbp)
mov    %cl,-0x1a(%rbp)
mov    %al,-0x1b(%rbp)
movsbl -0x1(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movsbl -0x1b(%rbp),%r8d
movsbl -0x1a(%rbp),%r9d
movsbl -0x19(%rbp),%eax
lea    0xe87(%rip),%rdi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_progr_ps>:
push   %rax
mov    %r8d,%r10d
mov    %rdx,%rax
mov    %rsi,%rdx
mov    %edi,%esi
mov    %ecx,(%rsp)
lea    0xeda(%rip),%rdi
mov    %rax,%rcx
mov    %r9d,%r8d
mov    %r10d,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0D %3d%% of %s @ %s/s ETA %02d:%02d:%02d \00"
define void @print_progr_ps(i8 signext %0, i8* %1, i8* %2, i8 signext %3, i8 signext %4, i8 signext %5) {
%7 = alloca i8
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
store i8 %0, i8* %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i8 %3, i8* %10
store i8 %4, i8* %11
store i8 %5, i8* %12
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = load i8*, i8** %8
%16 = load i8*, i8** %9
%17 = load i8, i8* %12
%18 = sext i8 %17 to i32
%19 = load i8, i8* %11
%20 = sext i8 %19 to i32
%21 = load i8, i8* %10
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %15, i8* %16, i32 %18, i32 %20, i32 %22)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"\0D %3d%% of %s @ %s/s ETA %02d:%02d:%02d \00"
define void @print_progr_ps(i8 signext %0, i8* %1, i8* %2, i8 signext %3, i8 signext %4, i8 signext %5) {
%7 = sext i8 %0 to i32
%8 = sext i8 %5 to i32
%9 = sext i8 %4 to i32
%10 = sext i8 %3 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %7, i8* %1, i8* %2, i32 %8, i32 %9, i32 %10)
ret void
}
/* Type definitions */
struct tms {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ times(struct tms *);
int main() {
  struct tms tms;
  times(&tms);
  times((struct tms *)-1);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <times@plt>
mov    $0xffffffffffffffff,%rdi
call   1030 <times@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tms = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tms
store i32 0, i32* %1
%3 = call i32 @times(%struct.tms* %2)
%4 = call i32 @times(%struct.tms* inttoptr (i64 -1 to %struct.tms*))
ret i32 0
}

LLVM IR (-O2):
%struct.tms = type { i32 }
define i32 @main() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = tail call i32 @times(%struct.tms* inttoptr (i64 -1 to %struct.tms*))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ hf_handler();
__attribute__((weak)) void HardFault_Handler() { hf_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @HardFault_Handler() {
%1 = tail call i32 (...) @hf_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_PW6_PIN() { clear_io_bit(0x40, 6); }


x86 assembly (clang, -O0):
<TOSH_CLR_PW6_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_PW6_PIN>:
mov    $0x40,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_PW6_PIN() {
%1 = call i32 @clear_io_bit(i32 64, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_PW6_PIN() {
%1 = tail call i32 @clear_io_bit(i32 64, i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ board_serial_init();
void hardware_init_hook(void) { board_serial_init(); }


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

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

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

LLVM IR (-O2):
define void @hardware_init_hook() {
%1 = tail call i32 (...) @board_serial_init()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _eexit(int);
int /*<<< orphan*/ link_failure();
void t_Exit(void) {
  _eexit(1);
  link_failure();
}


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

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

LLVM IR (-O0):
define void @t_Exit() {
%1 = call i32 @_eexit(i32 1)
%2 = call i32 (...) @link_failure()
ret void
}

LLVM IR (-O2):
define void @t_Exit() {
%1 = tail call i32 @_eexit(i32 1)
%2 = tail call i32 (...) @link_failure()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ucontext_t;

/* Variables and functions */
int /*<<< orphan*/ getcontext(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ setcontext(int /*<<< orphan*/ *);
int /*<<< orphan*/ sleep(int);
int main(int argc, const char *argv[]) {
  ucontext_t context;
  getcontext(&context);
  puts("Hello world");
  sleep(1);
  setcontext(&context);
  return 0;
}


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    -0x14(%rbp),%rdi
call   1050 <getcontext@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
lea    -0x14(%rbp),%rdi
call   1040 <setcontext@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <getcontext@plt>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    %rbx,%rdi
call   1040 <setcontext@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"Hello world\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 @getcontext(i32* %6)
%8 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @sleep(i32 1)
%10 = call i32 @setcontext(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @getcontext(i32* %3)
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 1)
%8 = call i32 @setcontext(i32* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ c_panic(char *, char *);
void *memcpy(void *dest, const void *src, size_t n) {
  c_panic("NOT_IMPLEMENTED", "Function not implemented");
  return (void *)0x0;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
lea    0xede(%rip),%rsi
call   1030 <c_panic@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"NOT_IMPLEMENTED\00"
@.str.1 = [25 x i8] c"Function not implemented\00"
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = call i32 @c_panic(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [16 x i8] c"NOT_IMPLEMENTED\00"
@.str.1 = [25 x i8] c"Function not implemented\00"
define noalias i8* @memcpy(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = tail call i32 @c_panic(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ _MAIN_BDP_WRITE(char const *, int);
void bdp_write(const char *data, int size) { _MAIN_BDP_WRITE(data, size); }


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

x86 assembly (clang, -O2):
<bdp_write>:
jmp    1030 <_MAIN_BDP_WRITE@plt>

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

LLVM IR (-O2):
define void @bdp_write(i8* %0, i32 %1) {
%3 = tail call i32 @_MAIN_BDP_WRITE(i8* %0, i32 %1)
ret void
}
const char *zmodem_source(void) {
  return ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/Zimoy/Metronome/refs/heads/master/"
          "base-workspace/loader/zmodem/src/zmodem.c");
}


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

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

LLVM IR (-O0):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Zimoy/Metronome/refs/heads/master/base-workspace/loader/zmodem/src/zmodem.c\00"
define i8* @zmodem_source() {
ret i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [166 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Zimoy/Metronome/refs/heads/master/base-workspace/loader/zmodem/src/zmodem.c\00"
define i8* @zmodem_source() {
ret i8* getelementptr inbounds ([166 x i8], [166 x i8]* @.str, i64 0, i64 0)
}
void glUniform2iv(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glUniform2iv() {
ret void
}
int fun742() { return 742; }


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

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

LLVM IR (-O0):
define i32 @fun742() {
ret i32 742
}

LLVM IR (-O2):
define i32 @fun742() {
ret i32 742
}
int yyrwap(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @yyrwap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @yyrwap() {
ret i32 1
}
void GLUE_STORE_P1_TO_STACK_AT_OFFS(void *b, int offs) {
  ((unsigned char *)b)[0] = 0x89;
  ((unsigned char *)b)[1] = 0x84;
  ((unsigned char *)b)[2] = 0x24;
  *(int *)((unsigned char *)b + 3) = offs;
}


x86 assembly (clang, -O0):
<GLUE_STORE_P1_TO_STACK_AT_OFFS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x89,(%rax)
mov    -0x8(%rbp),%rax
movb   $0x84,0x1(%rax)
mov    -0x8(%rbp),%rax
movb   $0x24,0x2(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUE_STORE_P1_TO_STACK_AT_OFFS>:
movw   $0x8489,(%rdi)
movb   $0x24,0x2(%rdi)
mov    %esi,0x3(%rdi)
ret

LLVM IR (-O0):
define void @GLUE_STORE_P1_TO_STACK_AT_OFFS(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 -119, i8* %6
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 -124, i8* %8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 36, i8* %10
%11 = load i32, i32* %4
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 3
%14 = bitcast i8* %13 to i32*
store i32 %11, i32* %14
ret void
}

LLVM IR (-O2):
define void @GLUE_STORE_P1_TO_STACK_AT_OFFS(i8* nocapture writeonly %0, i32 %1) {
store i8 -119, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
store i8 -124, i8* %3
%4 = getelementptr inbounds i8, i8* %0, i64 2
store i8 36, i8* %4
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = bitcast i8* %5 to i32*
store i32 %1, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int test1(int a) {
  if ((a >> 3) & 134217728)
    foo();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    $0x8000000,%eax
cmp    $0x0,%eax
je     1136 <test1+0x26>
mov    $0x0,%al
call   1030 <foo@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   $0x40000000,%edi
je     1124 <test1+0x14>
push   %rax
xor    %eax,%eax
call   1030 <foo@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = ashr i32 %4, 3
%6 = and i32 %5, 134217728
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @foo()
br label %10
10: ; preds = %8, %1
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = and i32 %0, 1073741824
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @foo()
br label %6
6: ; preds = %4, %1
ret i32 undef
}
int do_607() { return 607; }


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

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

LLVM IR (-O0):
define i32 @do_607() {
ret i32 607
}

LLVM IR (-O2):
define i32 @do_607() {
ret i32 607
}
/* Variables and functions */
int strncmp(void const *, void const *, int);
int tex_compare(const void *lop, const void *rop) {
  return strncmp(lop, rop, 8);
}


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

x86 assembly (clang, -O2):
<tex_compare>:
mov    $0x8,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
define i32 @tex_compare(i8* %0, i8* %1) {
%3 = tail call i32 @strncmp(i8* %0, i8* %1, i32 8)
ret i32 %3
}
/* Type definitions */
struct ohlist_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ohlist_opprev(struct ohlist_node *);
int ohlist_unhashed(struct ohlist_node *node) { return !ohlist_opprev(node); }


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

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

LLVM IR (-O0):
%struct.ohlist_node = type { i32 }
define i32 @ohlist_unhashed(%struct.ohlist_node* %0) {
%2 = alloca %struct.ohlist_node*
store %struct.ohlist_node* %0, %struct.ohlist_node** %2
%3 = load %struct.ohlist_node*, %struct.ohlist_node** %2
%4 = call i32 @ohlist_opprev(%struct.ohlist_node* %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.ohlist_node = type { i32 }
define i32 @ohlist_unhashed(%struct.ohlist_node* %0) {
%2 = tail call i32 @ohlist_opprev(%struct.ohlist_node* %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int toascii(int c) { return c & 0x7F; }


x86 assembly (clang, -O0):
<toascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

LLVM IR (-O0):
define i32 @toascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
ret i32 %4
}

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
char *aeApiName(void) { return "winsock2"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"winsock2\00"
define i8* @aeApiName() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int _isatty_r(struct _reent *reent, int fd) { return 0; }


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

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

LLVM IR (-O0):
%struct._reent = type opaque
define i32 @_isatty_r(%struct._reent* %0, i32 %1) {
%3 = alloca %struct._reent*
%4 = alloca i32
store %struct._reent* %0, %struct._reent** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct._reent = type opaque
define i32 @_isatty_r(%struct._reent* nocapture readnone %0, i32 %1) {
ret i32 0
}
void func5() {
  static int my_static_local_l2;
  static char sam;
}


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

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

LLVM IR (-O0):
@func5.my_static_local_l2 = internal global i32 0
@func5.sam = internal global i8 0
define void @func5() {
ret void
}

LLVM IR (-O2):
define void @func5() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void die(char *error) {
  printf("%s\n", error);
  exit(1);
}


x86 assembly (clang, -O0):
<die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @die(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int is_unknown(char base) {
  switch (base) {
  case 'N':
  case 'n':
  case '-':
  case '?':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_unknown>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2d,%eax
je     1152 <is_unknown+0x52>
jmp    111f <is_unknown+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x3f,%eax
je     1152 <is_unknown+0x52>
jmp    1130 <is_unknown+0x30>
mov    -0xc(%rbp),%eax
sub    $0x4e,%eax
je     1152 <is_unknown+0x52>
jmp    1141 <is_unknown+0x41>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
jne    115e <is_unknown+0x5e>
jmp    1152 <is_unknown+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1165 <is_unknown+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unknown>:
mov    $0x1,%eax
lea    -0x3f(%rdi),%ecx
cmp    $0x2f,%ecx
ja     111d <is_unknown+0x1d>
movabs $0x800000008001,%rdx
bt     %rcx,%rdx
jb     1122 <is_unknown+0x22>
cmp    $0x2d,%edi
jne    1123 <is_unknown+0x23>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_unknown(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
switch i32 %5, label %7 [
i32 78, label %6
i32 110, label %6
i32 45, label %6
i32 63, label %6
]
6: ; preds = %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @is_unknown(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %3 [
i32 78, label %4
i32 110, label %4
i32 45, label %4
i32 63, label %4
]
3: ; preds = %1
br label %4
4: ; preds = %1, %1, %1, %1, %3
%5 = phi i32 [ 0, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SU_Uncapitalize(char *);
char *SU_Uncapitalized(char *The_String) {
  SU_Uncapitalize(The_String);
  return The_String;
}


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

x86 assembly (clang, -O2):
<SU_Uncapitalized>:
push   %rbx
mov    %rdi,%rbx
call   1030 <SU_Uncapitalize@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @SU_Uncapitalized(i8* returned %0) {
%2 = tail call i32 @SU_Uncapitalize(i8* %0)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t cvar_register(char *name, char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cvar_register(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *printme(void *arg) {
  printf("Hi world\n");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"Hi world\0A\00"
define i8* @printme(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [9 x i8] c"Hi world\00"
define noalias i8* @printme(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
char const *UtilStrDup(char const *);
const char *GlbspStrDup(const char *str) {
  if (!str)
    return NULL;
  return UtilStrDup(str);
}


x86 assembly (clang, -O0):
<GlbspStrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1134 <GlbspStrDup+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1141 <GlbspStrDup+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <UtilStrDup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GlbspStrDup>:
test   %rdi,%rdi
je     111a <GlbspStrDup+0xa>
jmp    1030 <UtilStrDup@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @GlbspStrDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8* null, i8** %2
br label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i8* @UtilStrDup(i8* %8)
store i8* %9, i8** %2
br label %10
10: ; preds = %7, %6
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define i8* @GlbspStrDup(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i8* @UtilStrDup(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i8* [ %4, %3 ], [ null, %1 ]
ret i8* %6
}
int test_imm_B8uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xB8 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B8uint64_highword_mem>:
testb  $0xb8,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B8uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 184
%7 = icmp ne i64 %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_B8uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 790273982464
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                                   struct timespec *, int /*<<< orphan*/ *);
void parlcd_delay(int msec) {
  struct timespec wait_delay = {.tv_sec = msec / 1000,
                                .tv_nsec = (msec % 1000) * 1000 * 1000};
  clock_nanosleep(CLOCK_MONOTONIC, 0, &wait_delay, NULL);
}


x86 assembly (clang, -O0):
<parlcd_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,%edx,%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0xc(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
lea    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <clock_nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parlcd_delay>:
push   %rax
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0x4(%rsp)
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
call   1030 <clock_nanosleep@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define void @parlcd_delay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
store i32 %0, i32* %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000
store i32 %6, i32* %4
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000
%10 = mul nsw i32 %9, 1000
%11 = mul nsw i32 %10, 1000
store i32 %11, i32* %7
%12 = load i32, i32* @CLOCK_MONOTONIC
%13 = call i32 @clock_nanosleep(i32 %12, i32 0, %struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define void @parlcd_delay(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
%5 = sdiv i32 %0, 1000
store i32 %5, i32* %4
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
%7 = srem i32 %0, 1000
%8 = mul nsw i32 %7, 1000000
store i32 %8, i32* %6
%9 = load i32, i32* @CLOCK_MONOTONIC
%10 = call i32 @clock_nanosleep(i32 %9, i32 0, %struct.timespec* %2, i32* null)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void rfc4175_set_line_field_id(uint8_t *buf, uint8_t id) {
  buf[2] |= (!!id) << 7;
}


x86 assembly (clang, -O0):
<rfc4175_set_line_field_id>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
shl    $0x7,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_set_line_field_id>:
xor    %eax,%eax
test   %esi,%esi
setne  %al
shl    $0x7,%eax
or     %eax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @rfc4175_set_line_field_id(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = xor i1 %7, true
%9 = zext i1 %8 to i32
%10 = shl i32 %9, 7
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = or i32 %13, %10
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @rfc4175_set_line_field_id(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 0, i32 128
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %5
%7 = or i32 %6, %4
store i32 %7, i32* %5
ret void
}
int check_prime(int num) {
  int N, x;
  N = num;
  x = 2;
  for (x = 2; x < N;) {
    if ((N % x) != 0) {
      x = x + 1;
    } else {
      N = N + 1;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <check_prime+0x53>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1145 <check_prime+0x45>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114e <check_prime+0x4e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111b <check_prime+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
mov    $0x2,%ecx
cmp    $0x3,%edi
jl     112a <check_prime+0x2a>
mov    $0x2,%ecx
nop
mov    %edi,%eax
cltd
idiv   %ecx
xor    %eax,%eax
xor    %esi,%esi
test   %edx,%edx
setne  %al
sete   %sil
add    %esi,%edi
add    %eax,%ecx
cmp    %edi,%ecx
jl     1110 <check_prime+0x10>
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ spiPutByte(int /*<<< orphan*/ const);
void SPI_Send(const uint8_t *buf, long Length) {
  while (Length != 0) {
    spiPutByte(*buf);
    Length--;
    buf++;
  }
}


x86 assembly (clang, -O0):
<SPI_Send>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <SPI_Send+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <spiPutByte@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1120 <SPI_Send+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SPI_Send>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1142 <SPI_Send+0x32>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r14,%rbx,4),%edi
call   1030 <spiPutByte@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <SPI_Send+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @SPI_Send(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 @spiPutByte(i32 %7)
%9 = add nsw i64 %5, -1
%10 = getelementptr inbounds i32, i32* %6, i64 1
%11 = icmp eq i64 %9, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XUngrabServer() {
  printf("XUngrabServer called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [21 x i8] c"XUngrabServer called\00"
define i32 @XUngrabServer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int file_truncate(int handle, long filesize) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @file_truncate(i32 %0, i64 %1) {
ret i32 0
}
/* Type definitions */
struct winsize {
  int ws_row;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TIOCGWINSZ;
int /*<<< orphan*/ ioctl(int /*<<< orphan*/, int /*<<< orphan*/,
                         struct winsize *);
int nms_term_rows(void) {
  struct winsize w;
  ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
  return w.ws_row;
}


x86 assembly (clang, -O0):
<nms_term_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
lea    -0x8(%rbp),%rdx
call   1030 <ioctl@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nms_term_rows>:
push   %rax
mov    0x2ed8(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
call   1030 <ioctl@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @nms_term_rows() {
%1 = alloca %struct.winsize
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TIOCGWINSZ
%4 = call i32 @ioctl(i32 %2, i32 %3, %struct.winsize* %1)
%5 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i32 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
%struct.winsize = type { i32 }
@STDOUT_FILENO = global i32 0
@TIOCGWINSZ = global i32 0
define i32 @nms_term_rows() {
%1 = alloca %struct.winsize
%2 = bitcast %struct.winsize* %1 to i8*
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TIOCGWINSZ
%5 = call i32 @ioctl(i32 %3, i32 %4, %struct.winsize* %1)
%6 = getelementptr inbounds %struct.winsize, %struct.winsize* %1, i64 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ load(char const *, unsigned int *, int);
void test_file_loading(const char *filename) {
  unsigned int table[0x18000];
  load(filename, table, 0x18000);
}


x86 assembly (clang, -O0):
<test_file_loading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60010,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x60010(%rbp),%rsi
mov    $0x18000,%edx
call   1030 <load@plt>
add    $0x60010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_file_loading>:
sub    $0x60008,%rsp
mov    %rsp,%rsi
mov    $0x18000,%edx
call   1030 <load@plt>
add    $0x60008,%rsp
ret

LLVM IR (-O0):
define void @test_file_loading(i8* %0) {
%2 = alloca i8*
%3 = alloca [98304 x i32]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds [98304 x i32], [98304 x i32]* %3, i64 0, i64 0
%6 = call i32 @load(i8* %4, i32* %5, i32 98304)
ret void
}

LLVM IR (-O2):
define void @test_file_loading(i8* %0) {
%2 = alloca [98304 x i32]
%3 = bitcast [98304 x i32]* %2 to i8*
%4 = getelementptr inbounds [98304 x i32], [98304 x i32]* %2, i64 0, i64 0
%5 = call i32 @load(i8* %0, i32* %4, i32 98304)
ret void
}