xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
main(void) {
  int a = 0x12345678;
  int *pi;
  short *ps;
  char *pc;
  pi = &a;
  ps = (short *)&a;
  pc = (char *)&a;
  printf("%x %x %x\n", *pi, *ps, *pc);
  *pi = 0x90abcdef;
  *ps = 0x1234;
  *pc = 0x56;
  printf("%x \n", a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x12345678,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
movswl (%rax),%edx
mov    -0x20(%rbp),%rax
movsbl (%rax),%ecx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x90abcdef,(%rax)
mov    -0x18(%rbp),%rax
movw   $0x1234,(%rax)
mov    -0x20(%rbp),%rax
movb   $0x56,(%rax)
mov    -0x4(%rbp),%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x12345678,%esi
mov    $0x5678,%edx
mov    $0x78,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
mov    $0x90ab1256,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%x %x %x\0A\00"
@.str.1 = [5 x i8] c"%x \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i16*
%4 = alloca i8*
store i32 305419896, i32* %1
store i32* %1, i32** %2
%5 = bitcast i32* %1 to i16*
store i16* %5, i16** %3
%6 = bitcast i32* %1 to i8*
store i8* %6, i8** %4
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = load i16*, i16** %3
%10 = load i16, i16* %9
%11 = sext i16 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %11, i32 %14)
%16 = load i32*, i32** %2
store i32 -1867788817, i32* %16
%17 = load i16*, i16** %3
store i16 4660, i16* %17
%18 = load i8*, i8** %4
store i8 86, i8* %18
%19 = load i32, i32* %1
%20 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%x %x %x\0A\00"
@.str.1 = [5 x i8] c"%x \0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 305419896, i32 22136, i32 120)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 -1867836842)
ret i32 0
}
int f(int a, ...) { return a; }


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

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

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

LLVM IR (-O2):
define i32 @f(i32 returned %0, ...) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, ...);
void R_ScreenshotFilenameJPEG(int lastNumber, char *fileName) {
  if (lastNumber < 0 || lastNumber > 9999) {
    Com_sprintf(fileName, 256, "screenshots/shot9999.jpg");
    return;
  }
  Com_sprintf(fileName, 256, "screenshots/shot%04i.jpg", lastNumber);
}


x86 assembly (clang, -O0):
<R_ScreenshotFilenameJPEG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1136 <R_ScreenshotFilenameJPEG+0x26>
cmpl   $0x270f,-0x4(%rbp)
jle    1152 <R_ScreenshotFilenameJPEG+0x42>
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
lea    0xeba(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
jmp    116c <R_ScreenshotFilenameJPEG+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x100,%esi
lea    0xeb4(%rip),%rdx
mov    $0x0,%al
call   1030 <Com_sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<R_ScreenshotFilenameJPEG>:
cmp    $0x2710,%edi
jb     112e <R_ScreenshotFilenameJPEG+0x1e>
lea    0xee1(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>
mov    %edi,%ecx
lea    0xee2(%rip),%rdx
mov    %rsi,%rdi
mov    $0x100,%esi
xor    %eax,%eax
jmp    1030 <Com_sprintf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"screenshots/shot9999.jpg\00"
@.str.1 = [25 x i8] c"screenshots/shot%04i.jpg\00"
define void @R_ScreenshotFilenameJPEG(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 9999
br i1 %9, label %10, label %13
10: ; preds = %7, %2
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %11, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %17
13: ; preds = %7
%14 = load i8*, i8** %4
%15 = load i32, i32* %3
%16 = call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %14, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %10
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"screenshots/shot9999.jpg\00"
@.str.1 = [25 x i8] c"screenshots/shot%04i.jpg\00"
define void @R_ScreenshotFilenameJPEG(i32 %0, i8* %1) {
%3 = icmp ugt i32 %0, 9999
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
6: ; preds = %2
%7 = tail call i32 (i8*, i32, i8*, ...) @Com_sprintf(i8* %1, i32 256, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int /*<<< orphan*/);
int /*<<< orphan*/ stdscr;
void clrscr(void) {
  if (!stdscr) {
    printf("\033[2J");
    sleep(0);
    printf("\033[0;0f");
  } else
    clear();
}


x86 assembly (clang, -O0):
<clrscr>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
cmpl   $0x0,(%rax)
jne    1168 <clrscr+0x38>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <sleep@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
jmp    116f <clrscr+0x3f>
mov    $0x0,%al
call   1040 <clear@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clrscr>:
push   %rax
mov    0x2eb0(%rip),%rax
cmpl   $0x0,(%rax)
je     1145 <clrscr+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <clear@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <sleep@plt>
lea    0xea6(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@stdscr = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[0;0f\00"
define void @clrscr() {
%1 = load i32, i32* @stdscr
%2 = icmp ne i32 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = call i32 (...) @clear()
br label %9
9: ; preds = %7, %3
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
@.str = [5 x i8] c"\1B[2J\00"
@.str.1 = [7 x i8] c"\1B[0;0f\00"
define void @clrscr() {
%1 = load i32, i32* @stdscr
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 0)
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %9
7: ; preds = %0
%8 = tail call i32 (...) @clear()
br label %9
9: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt_isr();
__attribute__((weak)) void PendSV_Handler() { halt_isr(); }


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

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

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

LLVM IR (-O2):
define weak void @PendSV_Handler() {
%1 = tail call i32 (...) @halt_isr()
ret void
}
/* Variables and functions */
char *ap_device_usage();
int /*<<< orphan*/ printf(char *, char *);
void ap_device_showusage() {
  printf("usage : ap_device %s", ap_device_usage());
}


x86 assembly (clang, -O0):
<ap_device_showusage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ap_device_usage@plt>
mov    %rax,%rsi
lea    0xecb(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_device_showusage>:
push   %rax
xor    %eax,%eax
call   1030 <ap_device_usage@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"usage : ap_device %s\00"
define void @ap_device_showusage() {
%1 = call i8* (...) @ap_device_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"usage : ap_device %s\00"
define void @ap_device_showusage() {
%1 = tail call i8* (...) @ap_device_usage()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
double sin(double);
double qSin(double a) { return sin(a); }


x86 assembly (clang, -O0):
<qSin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qSin>:
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @qSin(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sin(double %3)
ret double %4
}

LLVM IR (-O2):
define double @qSin(double %0) {
%2 = tail call double @sin(double %0)
ret double %2
}
/* Variables and functions */
int *pick(int *, int *);
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int a, b, c;
  a = 0;
  b = 1;
  c = 3;
  int *p = pick(&a, &b);
  *p = 13;
  test_assert(b == 13);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1030 <pick@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
cmpl   $0xd,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <pick@plt>
movl   $0xd,(%rax)
xor    %edi,%edi
cmpl   $0xd,(%rsp)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
store i32 3, i32* %4
%6 = call i32* @pick(i32* %2, i32* %3)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
store i32 13, i32* %7
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 13
%10 = zext i1 %9 to i32
%11 = call i32 @test_assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %1
store i32 1, i32* %2
%5 = call i32* @pick(i32* %1, i32* %2)
store i32 13, i32* %5
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 13
%8 = zext i1 %7 to i32
%9 = call i32 @test_assert(i32 %8)
ret i32 0
}
double _speed() { return 1.0; }


x86 assembly (clang, -O0):
<_speed>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_speed>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @_speed() {
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @_speed() {
ret double 1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *exe) {
  printf("usage: %s <socket> <infile> <outfile>|<moddir> "
         "modinfo|passthrough|translate fixed|free [<dir>[:<dir>:...]]\n",
         exe);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [109 x i8] c"usage: %s <socket> <infile> <outfile>|<moddir> modinfo|passthrough|translate fixed|free [<dir>[:<dir>:...]]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [109 x i8] c"usage: %s <socket> <infile> <outfile>|<moddir> modinfo|passthrough|translate fixed|free [<dir>[:<dir>:...]]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
void test6(void (*f)(int i)) {}


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

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

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

LLVM IR (-O2):
define void @test6(void (i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ llib_snb_to_long(char const *, long *, char **, int);
__attribute__((unused)) long int strtol(const char *nptr, char **endptr,
                                        int base) {
  long int li;
  llib_snb_to_long(nptr, &li, endptr, base);
  return li;
}


x86 assembly (clang, -O0):
<strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
lea    -0x20(%rbp),%rsi
call   1030 <llib_snb_to_long@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtol>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rsp,%rsi
call   1030 <llib_snb_to_long@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8**, i8*** %5
%10 = load i32, i32* %6
%11 = call i32 @llib_snb_to_long(i8* %8, i64* %7, i8** %9, i32 %10)
%12 = load i64, i64* %7
ret i64 %12
}

LLVM IR (-O2):
define i64 @strtol(i8* %0, i8** %1, i32 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to i8*
%6 = call i32 @llib_snb_to_long(i8* %0, i64* %4, i8** %1, i32 %2)
%7 = load i64, i64* %4
ret i64 %7
}
float test_acosf(float x) { return __builtin_acosf(x); }


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

x86 assembly (clang, -O2):
<test_acosf>:
jmp    1030 <acosf@plt>

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

LLVM IR (-O2):
define float @test_acosf(float %0) {
%2 = tail call float @acosf(float %0)
ret float %2
}
char *StrLwr(char *str) {
  char *strp = str;
  while (*strp != 0) {
    if ((*strp >= 'A') && (*strp <= 'Z')) {
      *strp += 0x20;
    }
    strp++;
  }
  return str;
}


x86 assembly (clang, -O0):
<StrLwr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <StrLwr+0x5d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     114c <StrLwr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114c <StrLwr+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <StrLwr+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrLwr>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <StrLwr+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <StrLwr+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <StrLwr+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <StrLwr+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <StrLwr+0x10>
ret

LLVM IR (-O0):
define i8* @StrLwr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %26, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %29
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp sle i32 %18, 90
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, 32
%25 = trunc i32 %24 to i8
store i8 %25, i8* %21
br label %26
26: ; preds = %20, %15, %10
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
br label %5
29: ; preds = %5
%30 = load i8*, i8** %2
ret i8* %30
}

LLVM IR (-O2):
define i8* @StrLwr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_move_epi64(int /*<<< orphan*/);
__m128i test_mm_move_epi64(__m128i A) { return _mm_move_epi64(A); }


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

x86 assembly (clang, -O2):
<test_mm_move_epi64>:
jmp    1030 <_mm_move_epi64@plt>

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

LLVM IR (-O2):
define i32 @test_mm_move_epi64(i32 %0) {
%2 = tail call i32 @_mm_move_epi64(i32 %0)
ret i32 %2
}
void ioapic_write(int reg, unsigned int val) {
  (*(volatile unsigned int *)0xfec00000l) = reg;
  (*(volatile unsigned int *)0xfec00010l) = val;
}


x86 assembly (clang, -O0):
<ioapic_write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0xfec00000,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    $0xfec00010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ioapic_write>:
mov    $0xfec00000,%eax
mov    %edi,(%rax)
mov    %esi,0x10(%rax)
ret

LLVM IR (-O0):
define void @ioapic_write(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
store volatile i32 %5, i32* inttoptr (i64 4273995776 to i32*)
%6 = load i32, i32* %4
store volatile i32 %6, i32* inttoptr (i64 4273995792 to i32*)
ret void
}

LLVM IR (-O2):
define void @ioapic_write(i32 %0, i32 %1) {
store volatile i32 %0, i32* inttoptr (i64 4273995776 to i32*)
store volatile i32 %1, i32* inttoptr (i64 4273995792 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_c3();
int /*<<< orphan*/ take_struct_c3(int /*<<< orphan*/);
void test_struct_c3() { take_struct_c3(return_struct_c3()); }


x86 assembly (clang, -O0):
<test_struct_c3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <return_struct_c3@plt>
mov    %eax,%edi
call   1040 <take_struct_c3@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_struct_c3>:
push   %rax
xor    %eax,%eax
call   1030 <return_struct_c3@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <take_struct_c3@plt>

LLVM IR (-O0):
define void @test_struct_c3() {
%1 = call i32 (...) @return_struct_c3()
%2 = call i32 @take_struct_c3(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_c3() {
%1 = tail call i32 (...) @return_struct_c3()
%2 = tail call i32 @take_struct_c3(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void secondary() {
  printf("Secondary Master : %s\n", "PLYTRN DSK-100 Floppy Disk Drive");
  printf(" Secondary Slave : %s\n", "Empty");
}


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

x86 assembly (clang, -O2):
<secondary>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef8(%rip),%rsi
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    0xf1d(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Secondary Master : %s\0A\00"
@.str.1 = [33 x i8] c"PLYTRN DSK-100 Floppy Disk Drive\00"
@.str.2 = [23 x i8] c" Secondary Slave : %s\0A\00"
@.str.3 = [6 x i8] c"Empty\00"
define void @secondary() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Secondary Master : %s\0A\00"
@.str.1 = [33 x i8] c"PLYTRN DSK-100 Floppy Disk Drive\00"
@.str.2 = [23 x i8] c" Secondary Slave : %s\0A\00"
@.str.3 = [6 x i8] c"Empty\00"
define void @secondary() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int FE_TONEAREST;
int fesetround(int round) {
  if (round == FE_TONEAREST)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<fesetround>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2ed7(%rip),%rcx
cmp    (%rcx),%eax
jne    1125 <fesetround+0x25>
movl   $0x0,-0x4(%rbp)
jmp    112c <fesetround+0x2c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fesetround>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
cmp    %edi,(%rcx)
setne  %al
neg    %eax
ret

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = load i32, i32* @FE_TONEAREST
%6 = icmp eq i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
define i32 @fesetround(i32 %0) {
%2 = load i32, i32* @FE_TONEAREST
%3 = icmp ne i32 %2, %0
%4 = sext i1 %3 to i32
ret i32 %4
}
int is_in_bound(int *arr, int size, int *ptr) {
  int i;
  for (i = 0; i < size; i++) {
    if (ptr == (arr + i)) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115d <is_in_bound+0x5d>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x24(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jne    114a <is_in_bound+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1164 <is_in_bound+0x64>
jmp    114f <is_in_bound+0x4f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1116 <is_in_bound+0x16>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
xor    %eax,%eax
test   %esi,%esi
jle    111f <is_in_bound+0x1f>
mov    %esi,%ecx
add    $0xfffffffffffffffc,%rdi
nopl   0x0(%rax)
add    $0x4,%rdi
cmp    %rdx,%rdi
je     1120 <is_in_bound+0x20>
add    $0xffffffffffffffff,%rcx
jne    1110 <is_in_bound+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %13, %6
br i1 %8, label %14, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %13, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = icmp eq i32* %11, %2
%13 = add nuw nsw i64 %10, 1
br i1 %12, label %14, label %7
14: ; preds = %9, %7, %3
%15 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %15
}
void PKCS7_ENC_CONTENT_free(void) {}


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

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

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

LLVM IR (-O2):
define void @PKCS7_ENC_CONTENT_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help(void) {
  printf("Convert GenBank sequence into FASTA sequence.\n"
         "\n"
         "Usage: seqext [-h] [-V] [-f Feature_to_extract (default: gene)] [-q "
         "Qualifier_to_print] [-i Genbank_file]\n"
         "\n"
         "-V  print version information and exit\n");
}


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

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

LLVM IR (-O0):
@.str = [194 x i8] c"Convert GenBank sequence into FASTA sequence.\0A\0AUsage: seqext [-h] [-V] [-f Feature_to_extract (default: gene)] [-q Qualifier_to_print] [-i Genbank_file]\0A\0A-V print version information and exit\0A\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([194 x i8], [194 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [193 x i8] c"Convert GenBank sequence into FASTA sequence.\0A\0AUsage: seqext [-h] [-V] [-f Feature_to_extract (default: gene)] [-q Qualifier_to_print] [-i Genbank_file]\0A\0A-V print version information and exit\00"
define void @help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([193 x i8], [193 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ halt2();
int test4() { halt2(); }


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <halt2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test4() {
%1 = alloca i32
%2 = call i32 (...) @halt2()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test4() {
%1 = tail call i32 (...) @halt2()
ret i32 undef
}
/* Variables and functions */
size_t strnlen(char const *s, size_t count) {
  const char *sc;
  for (sc = s; count-- && *sc != '\0'; ++sc)
    ;
  return sc - s;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1142 <strnlen+0x42>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1152 <strnlen+0x52>
jmp    1168 <strnlen+0x68>
jmp    1157 <strnlen+0x57>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strnlen+0x14>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1125 <strnlen+0x25>
lea    (%rdi,%rsi,1),%rcx
mov    %rdi,%rax
nop
cmpb   $0x0,(%rax)
je     1125 <strnlen+0x25>
add    $0xffffffffffffffff,%rsi
add    $0x1,%rax
test   %rsi,%rsi
jne    1110 <strnlen+0x10>
mov    %rcx,%rax
sub    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
br label %7
7: ; preds = %19, %2
%8 = load i64, i64* %4
%9 = add i64 %8, -1
store i64 %9, i64* %4
%10 = icmp ne i64 %8, 0
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8*, i8** %5
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %11, %7
%17 = phi i1 [ false, %7 ], [ %15, %11 ]
br i1 %17, label %18, label %22
18: ; preds = %16
br label %19
19: ; preds = %18
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %5
br label %7
22: ; preds = %16
%23 = load i8*, i8** %5
%24 = load i8*, i8** %3
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @strnlen(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = getelementptr i8, i8* %0, i64 %1
br label %6
6: ; preds = %4, %12
%7 = phi i64 [ %9, %12 ], [ %1, %4 ]
%8 = phi i8* [ %13, %12 ], [ %0, %4 ]
%9 = add i64 %7, -1
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %6
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = icmp eq i64 %9, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %12, %2
%16 = phi i8* [ %0, %2 ], [ %5, %12 ], [ %8, %6 ]
%17 = ptrtoint i8* %16 to i64
%18 = ptrtoint i8* %0 to i64
%19 = sub i64 %17, %18
ret i64 %19
}
/* Type definitions */
struct statvfs {
  int dummy;
};
struct statfs {
  int dummy;
};

/* Variables and functions */
int __fstatfs(int, struct statfs *);
int fstatvfs(int fd, struct statvfs *buf) {
  return __fstatfs(fd, (struct statfs *)buf);
}


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

x86 assembly (clang, -O2):
<fstatvfs>:
jmp    1030 <__fstatfs@plt>

LLVM IR (-O0):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @fstatvfs(i32 %0, %struct.statvfs* %1) {
%3 = alloca i32
%4 = alloca %struct.statvfs*
store i32 %0, i32* %3
store %struct.statvfs* %1, %struct.statvfs** %4
%5 = load i32, i32* %3
%6 = load %struct.statvfs*, %struct.statvfs** %4
%7 = bitcast %struct.statvfs* %6 to %struct.statfs*
%8 = call i32 @__fstatfs(i32 %5, %struct.statfs* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.statvfs = type { i32 }
%struct.statfs = type { i32 }
define i32 @fstatvfs(i32 %0, %struct.statvfs* %1) {
%3 = bitcast %struct.statvfs* %1 to %struct.statfs*
%4 = tail call i32 @__fstatfs(i32 %0, %struct.statfs* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mob_read_randommonster();
int /*<<< orphan*/ mob_readdb();
int /*<<< orphan*/ mob_readdb_mobavail();
int /*<<< orphan*/ mob_readskilldb();
void mob_reload(void) {
  mob_readdb();
  mob_readdb_mobavail();
  mob_read_randommonster();
  mob_readskilldb();
}


x86 assembly (clang, -O0):
<mob_reload>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <mob_readdb@plt>
mov    $0x0,%al
call   1050 <mob_readdb_mobavail@plt>
mov    $0x0,%al
call   1060 <mob_read_randommonster@plt>
mov    $0x0,%al
call   1030 <mob_readskilldb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mob_reload>:
push   %rax
xor    %eax,%eax
call   1040 <mob_readdb@plt>
xor    %eax,%eax
call   1050 <mob_readdb_mobavail@plt>
xor    %eax,%eax
call   1060 <mob_read_randommonster@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mob_readskilldb@plt>

LLVM IR (-O0):
define void @mob_reload() {
%1 = call i32 (...) @mob_readdb()
%2 = call i32 (...) @mob_readdb_mobavail()
%3 = call i32 (...) @mob_read_randommonster()
%4 = call i32 (...) @mob_readskilldb()
ret void
}

LLVM IR (-O2):
define void @mob_reload() {
%1 = tail call i32 (...) @mob_readdb()
%2 = tail call i32 (...) @mob_readdb_mobavail()
%3 = tail call i32 (...) @mob_read_randommonster()
%4 = tail call i32 (...) @mob_readskilldb()
ret void
}
/* Variables and functions */
char tolower(unsigned char);
char *strtolower(char *s) {
  char *p;
  for (p = s; *p; p++)
    *p = tolower((unsigned char)*p);
  return s;
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strtolower+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strtolower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strtolower+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strtolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strtolower(i8* returned %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 i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t swapu32(uint32_t n) {
  return (((n & 0xffU) << 24) | ((n & 0xff00U) << 8) | ((n & 0xff0000U) >> 8) |
          ((n & 0xff000000U) >> 24));
}


x86 assembly (clang, -O0):
<swapu32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swapu32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swapu32(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
char TestL() {
  char r;
  __asm__("cmp $2, %1" : "=@ccl"(r) : "r"(1));
  if (r) {
    __asm__("cmp $0, %1" : "=@ccnl"(r) : "r"(1));
    if (r) {
      __asm__("cmp $1, %1" : "=@ccnl"(r) : "r"(1));
      if (r)
        return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<TestL>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
cmp    $0x2,%eax
setl   %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115f <TestL+0x5f>
mov    $0x1,%eax
cmp    $0x0,%eax
setge  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115a <TestL+0x5a>
mov    $0x1,%eax
cmp    $0x1,%eax
setge  %al
mov    %al,-0x2(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     1155 <TestL+0x55>
movb   $0x1,-0x1(%rbp)
jmp    1163 <TestL+0x63>
jmp    115a <TestL+0x5a>
jmp    115f <TestL+0x5f>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestL>:
mov    $0x1,%eax
cmp    $0x2,%eax
jge    111c <TestL+0x1c>
cmp    $0x0,%eax
jl     111c <TestL+0x1c>
mov    $0x1,%eax
cmp    $0x1,%eax
mov    $0x1,%al
jl     111c <TestL+0x1c>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define signext i8 @TestL() {
%1 = alloca i8
%2 = alloca i8
%3 = call i8 asm "cmp $$2, $1", "={@ccl},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = icmp ne i8 %4, 0
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = call i8 asm "cmp $$0, $1", "={@ccnl},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = call i8 asm "cmp $$1, $1", "={@ccnl},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i8 1, i8* %1
br label %18
15: ; preds = %10
br label %16
16: ; preds = %15, %6
br label %17
17: ; preds = %16, %0
store i8 0, i8* %1
br label %18
18: ; preds = %17, %14
%19 = load i8, i8* %1
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @TestL() {
%1 = tail call i8 asm "cmp $$2, $1", "={@ccl},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i8 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i8 asm "cmp $$0, $1", "={@ccnl},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%5 = icmp eq i8 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i8 asm "cmp $$1, $1", "={@ccnl},r,~{dirflag},~{fpsr},~{flags}"(i32 1)
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %3, %6, %0
br label %10
10: ; preds = %6, %9
%11 = phi i8 [ 0, %9 ], [ 1, %6 ]
ret i8 %11
}
/* Type definitions */
struct coprthr_device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _printcl(char *, int, char *, char *);
void *acquire_gl_objects(struct coprthr_device *dev, void *argp) {
  do {
    if ("<4>"
        "cmdcall_x86_64:acquire_gl_objects: unsupported"[1] <= '0')
      _printcl("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/browndeer/coprthr/refs/heads/"
               "parallellocalypse/src/libcoprthr/arch/x86_64/devcmds_x86_64.c",
               502, "clmesg",
               "<4>"
               "cmdcall_x86_64:acquire_gl_objects: unsupported");
  } while (0);
  return (0);
}


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

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

LLVM IR (-O0):
%struct.coprthr_device = type { i32 }
define i8* @acquire_gl_objects(%struct.coprthr_device* %0, i8* %1) {
%3 = alloca %struct.coprthr_device*
%4 = alloca i8*
store %struct.coprthr_device* %0, %struct.coprthr_device** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
ret i8* null
}

LLVM IR (-O2):
%struct.coprthr_device = type { i32 }
define noalias i8* @acquire_gl_objects(%struct.coprthr_device* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* null
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void write_uint16(FILE *out, unsigned short value) {
  unsigned char buffer[2];
  buffer[0] = (unsigned char)((value >> 8) & 0xFF);
  buffer[1] = (unsigned char)(value & 0xFF);
  fwrite(buffer, 1, 2, out);
}


x86 assembly (clang, -O0):
<write_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xc(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xb(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_uint16>:
push   %rax
mov    %rdi,%rcx
rol    $0x8,%si
mov    %si,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fwrite@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @write_uint16(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
%5 = alloca [2 x i8]
store i32* %0, i32** %3
store i16 %1, i16* %4
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = ashr i32 %7, 8
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
store i8 %10, i8* %11
%12 = load i16, i16* %4
%13 = zext i16 %12 to i32
%14 = and i32 %13, 255
%15 = trunc i32 %14 to i8
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 1
store i8 %15, i8* %16
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%18 = load i32*, i32** %3
%19 = call i32 @fwrite(i8* %17, i32 1, i32 2, i32* %18)
ret void
}

LLVM IR (-O2):
define void @write_uint16(i32* nocapture %0, i16 zeroext %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
store i8 %6, i8* %4
%7 = trunc i16 %1 to i8
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 %7, i8* %8
%9 = call i32 @fwrite(i8* %4, i32 1, i32 2, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(unsigned short, int /*<<< orphan*/ *);
int write_word(FILE *fp, unsigned short w) {
  putc(w, fp);
  return (putc(w >> 8, fp));
}


x86 assembly (clang, -O0):
<write_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%ax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
movzwl -0xa(%rbp),%eax
sar    $0x8,%eax
mov    -0x8(%rbp),%rsi
movzwl %ax,%edi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_word>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
shr    $0x8,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define i32 @write_word(i32* %0, i16 zeroext %1) {
%3 = alloca i32*
%4 = alloca i16
store i32* %0, i32** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i32*, i32** %3
%7 = call i32 @putc(i16 zeroext %5, i32* %6)
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = ashr i32 %9, 8
%11 = trunc i32 %10 to i16
%12 = load i32*, i32** %3
%13 = call i32 @putc(i16 zeroext %11, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @write_word(i32* nocapture %0, i16 zeroext %1) {
%3 = tail call i32 @putc(i16 zeroext %1, i32* %0)
%4 = lshr i16 %1, 8
%5 = tail call i32 @putc(i16 zeroext %4, i32* %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert_fail(char const *, int, char *);
void assert_not_null_(const char *file, int line, void *pointer) {
  if (pointer == NULL) {
    assert_fail(file, line, "Expected not <null> but was");
  }
}


x86 assembly (clang, -O0):
<assert_not_null_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1141 <assert_not_null_+0x31>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    0xec4(%rip),%rdx
call   1030 <assert_fail@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_not_null_>:
test   %rdx,%rdx
je     1116 <assert_not_null_+0x6>
ret
lea    0xee3(%rip),%rdx
jmp    1030 <assert_fail@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Expected not <null> but was\00"
define void @assert_not_null_(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @assert_fail(i8* %10, i32 %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Expected not <null> but was\00"
define void @assert_not_null_(i8* %0, i32 %1, i8* readnone %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @assert_fail(i8* %0, i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}