xunge/DecIR huggingface dataset:
int pfftw_permutation_128(int i) {
  int i1 = i % 4;
  int i2 = i / 4;
  if (i1 <= 2)
    return (i1 * 32 + i2);
  else
    return (i1 * 32 + ((i2 + 1) % 32));
}


x86 assembly (clang, -O0):
<pfftw_permutation_128>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     113e <pfftw_permutation_128+0x3e>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <pfftw_permutation_128+0x5d>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    -0x14(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfftw_permutation_128>:
mov    %edi,%eax
lea    0x3(%rax),%ecx
test   %edi,%edi
cmovns %edi,%ecx
mov    %ecx,%edx
and    $0xfffffffc,%edx
sub    %edx,%eax
sar    $0x2,%ecx
cmp    $0x2,%eax
jg     111f <pfftw_permutation_128+0x1f>
shl    $0x5,%eax
add    %ecx,%eax
ret
lea    0x1(%rcx),%eax
lea    0x20(%rcx),%edx
test   %eax,%eax
cmovns %eax,%edx
and    $0xffffffe0,%edx
neg    %edx
lea    (%rcx,%rdx,1),%eax
add    $0x61,%eax
ret

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

LLVM IR (-O2):
define i32 @pfftw_permutation_128(i32 %0) {
%2 = srem i32 %0, 4
%3 = sdiv i32 %0, 4
%4 = icmp slt i32 %2, 3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = shl nsw i32 %2, 5
%7 = add nsw i32 %6, %3
br label %12
8: ; preds = %1
%9 = add nsw i32 %3, 1
%10 = srem i32 %9, 32
%11 = add nsw i32 %10, 96
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ scanw(char *, int *);
int menu() {
  int m = 0;
  clear();
  printw(
      "Menu:\n\n\t1) Registrar Pasteles\n\t2) Consultas\n\t3) "
      "Modificaciones\n\t4) Ventas\n\t5) salir\n\nIntroduce tu Eleccion:\n>>");
  scanw("%d", &m);
  return m;
}


x86 assembly (clang, -O0):
<menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <clear@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printw@plt>
lea    0xf16(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanw@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<menu>:
push   %rax
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1050 <clear@plt>
lea    0xeb9(%rip),%rdi
call   1030 <printw@plt>
lea    0xf1c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanw@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [111 x i8] c"Menu:\0A\0A\091) Registrar Pasteles\0A\092) Consultas\0A\093) Modificaciones\0A\094) Ventas\0A\095) salir\0A\0AIntroduce tu Eleccion:\0A>>\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @menu() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @clear()
%3 = call i32 @printw(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [111 x i8] c"Menu:\0A\0A\091) Registrar Pasteles\0A\092) Consultas\0A\093) Modificaciones\0A\094) Ventas\0A\095) salir\0A\0AIntroduce tu Eleccion:\0A>>\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @menu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (...) @clear()
%4 = tail call i32 @printw(i8* getelementptr inbounds ([111 x i8], [111 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanw(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
ret i32 %6
}
void *dlopen(const char *filename, int flag) {
  printf("%s:%s:%i: "
         "%s\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/8l/kitten/refs/heads/master/user/runtime/"
         "pct/dl.c",
         __FUNCTION__, 11, filename);
  return (void *)1;
}


x86 assembly (clang, -O0):
<dlopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%r8
lea    0xed6(%rip),%rdi
lea    0xedd(%rip),%rsi
lea    0xf62(%rip),%rdx
mov    $0xb,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlopen>:
push   %rax
mov    %rdi,%r8
lea    0xee5(%rip),%rdi
lea    0xeec(%rip),%rsi
lea    0xf71(%rip),%rdx
mov    $0xb,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"%s:%s:%i: %s\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/kitten/refs/heads/master/user/runtime/pct/dl.c\00"
@__FUNCTION__.dlopen = [7 x i8] c"dlopen\00"
define i8* @dlopen(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.dlopen, i64 0, i64 0), i32 11, i8* %5)
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@.str = [14 x i8] c"%s:%s:%i: %s\0A\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/8l/kitten/refs/heads/master/user/runtime/pct/dl.c\00"
@__FUNCTION__.dlopen = [7 x i8] c"dlopen\00"
define i8* @dlopen(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__FUNCTION__.dlopen, i64 0, i64 0), i32 11, i8* %0)
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x0b() {
  Assert_real((isascii(11)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              60, ("isascii should be 1 for 0x0b"));
}


x86 assembly (clang, -O0):
<t_isascii_0x0b>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x3c,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x0b>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x3c,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0b\00"
define void @t_isascii_0x0b() {
%1 = call i32 @isascii(i32 11)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 1 for 0x0b\00"
define void @t_isascii_0x0b() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 60, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print();
void changesize(int width, int height) { print(); }


x86 assembly (clang, -O0):
<changesize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <print@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @changesize(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @print()
ret void
}

LLVM IR (-O2):
define void @changesize(i32 %0, i32 %1) {
%3 = tail call i32 (...) @print()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daxpy_(int *, double *, double *, int *, double *, int *);
void wcc_daxpy_(int *n, char *da, char *dx, int *incx, char *dy, int *incy) {
  daxpy_(n, (double *)da, (double *)dx, incx, (double *)dy, incy);
}


x86 assembly (clang, -O0):
<wcc_daxpy_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
call   1030 <daxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcc_daxpy_>:
jmp    1030 <daxpy_@plt>

LLVM IR (-O0):
define void @wcc_daxpy_(i32* %0, i8* %1, i8* %2, i32* %3, i8* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i32*
store i32* %0, i32** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
store i32* %5, i32** %12
%13 = load i32*, i32** %7
%14 = load i8*, i8** %8
%15 = bitcast i8* %14 to double*
%16 = load i8*, i8** %9
%17 = bitcast i8* %16 to double*
%18 = load i32*, i32** %10
%19 = load i8*, i8** %11
%20 = bitcast i8* %19 to double*
%21 = load i32*, i32** %12
%22 = call i32 @daxpy_(i32* %13, double* %15, double* %17, i32* %18, double* %20, i32* %21)
ret void
}

LLVM IR (-O2):
define void @wcc_daxpy_(i32* %0, i8* %1, i8* %2, i32* %3, i8* %4, i32* %5) {
%7 = bitcast i8* %1 to double*
%8 = bitcast i8* %2 to double*
%9 = bitcast i8* %4 to double*
%10 = tail call i32 @daxpy_(i32* %0, double* %7, double* %8, i32* %3, double* %9, i32* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i = 0;
  int a = 0;
  int b = 10;
  int c = 0;
  do {
    a = b * 4;
    c = a * b;
    i++;
  } while (i < 5);
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xa,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jl     113b <main+0x2b>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x190,%edi
call   1030 <__print_int@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 0, i32* %3
store i32 10, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 4
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %14
14: ; preds = %6
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 5
br i1 %16, label %6, label %17
17: ; preds = %14
%18 = load i32, i32* %5
%19 = call i32 @__print_int(i32 %18)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 400)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void ph_fatal_error(char *msg, char *data) {
  printf("phapi_client: %s %s\n", msg, data);
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"phapi_client: %s %s\0A\00"
define void @ph_fatal_error(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 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

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


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

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

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

LLVM IR (-O2):
define void @serial_tx_handler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *my_malloc(long bytes) {
  void *ptr;
  if (bytes < 1L || ((size_t)bytes != bytes) ||
      (ptr = malloc((size_t)bytes)) == NULL) {
    fprintf(stderr, "Allocation of %ld bytes failed. File too big.\n", bytes);
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1,-0x8(%rbp)
jl     116c <my_malloc+0x3c>
mov    -0x8(%rbp),%rax
cmp    -0x8(%rbp),%rax
jne    116c <my_malloc+0x3c>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    118f <my_malloc+0x5f>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe80(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jle    1148 <my_malloc+0x18>
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1148 <my_malloc+0x18>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xea8(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [47 x i8] c"Allocation of %ld bytes failed. File too big.\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp slt i64 %4, 1
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = load i64, i64* %2
%9 = icmp ne i64 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i64, i64* %2
%12 = call i8* @malloc(i64 %11)
store i8* %12, i8** %3
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %10, %6, %1
%15 = load i32, i32* @stderr
%16 = load i64, i64* %2
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %16)
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %10
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [47 x i8] c"Allocation of %ld bytes failed. File too big.\0A\00"
define noalias i8* @my_malloc(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3, %1
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i64 %0)
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %3
ret i8* %4
}
/* Type definitions */
struct vector_cnets_osblinnikov_github_com {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vector_cnets_osblinnikov_github_com_onDestroy(
    struct vector_cnets_osblinnikov_github_com *);
void vector_cnets_osblinnikov_github_com_deinit(
    struct vector_cnets_osblinnikov_github_com *that) {
  vector_cnets_osblinnikov_github_com_onDestroy(that);
}


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

x86 assembly (clang, -O2):
<vector_cnets_osblinnikov_github_com_deinit>:
jmp    1030 <vector_cnets_osblinnikov_github_com_onDestroy@plt>

LLVM IR (-O0):
%struct.vector_cnets_osblinnikov_github_com = type { i32 }
define void @vector_cnets_osblinnikov_github_com_deinit(%struct.vector_cnets_osblinnikov_github_com* %0) {
%2 = alloca %struct.vector_cnets_osblinnikov_github_com*
store %struct.vector_cnets_osblinnikov_github_com* %0, %struct.vector_cnets_osblinnikov_github_com** %2
%3 = load %struct.vector_cnets_osblinnikov_github_com*, %struct.vector_cnets_osblinnikov_github_com** %2
%4 = call i32 @vector_cnets_osblinnikov_github_com_onDestroy(%struct.vector_cnets_osblinnikov_github_com* %3)
ret void
}

LLVM IR (-O2):
%struct.vector_cnets_osblinnikov_github_com = type { i32 }
define void @vector_cnets_osblinnikov_github_com_deinit(%struct.vector_cnets_osblinnikov_github_com* %0) {
%2 = tail call i32 @vector_cnets_osblinnikov_github_com_onDestroy(%struct.vector_cnets_osblinnikov_github_com* %0)
ret void
}
void i2a(char *dest, unsigned long x) {
  int div = 10;
  *dest++ = x / div + '0';
  *dest++ = x % div + '0';
  *dest++ = '\0';
}


x86 assembly (clang, -O0):
<i2a>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
add    $0x30,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    %edx,%edx
div    %rcx
add    $0x30,%rdx
mov    %dl,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2a>:
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rsi,%rax
mul    %rcx
shr    $0x3,%rdx
lea    0x30(%rdx),%eax
mov    %al,(%rdi)
add    %edx,%edx
lea    (%rdx,%rdx,4),%eax
sub    %eax,%esi
or     $0x30,%sil
mov    %sil,0x1(%rdi)
movb   $0x0,0x2(%rdi)
ret

LLVM IR (-O0):
define void @i2a(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 10, i32* %5
%6 = load i64, i64* %4
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = udiv i64 %6, %8
%10 = add i64 %9, 48
%11 = trunc i64 %10 to i8
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %3
store i8 %11, i8* %12
%14 = load i64, i64* %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = urem i64 %14, %16
%18 = add i64 %17, 48
%19 = trunc i64 %18 to i8
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %3
store i8 %19, i8* %20
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %3
store i8 0, i8* %22
ret void
}

LLVM IR (-O2):
define void @i2a(i8* nocapture writeonly %0, i64 %1) {
%3 = udiv i64 %1, 10
%4 = trunc i64 %3 to i8
%5 = add i8 %4, 48
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %0
%7 = urem i64 %1, 10
%8 = trunc i64 %7 to i8
%9 = or i8 %8, 48
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %6
store i8 0, i8* %10
ret void
}
/* Type definitions */
struct VectorNumBase {
  int dummy;
};

/* Variables and functions */
unsigned long long const SimhasherRes(struct VectorNumBase *);
const unsigned long long int simhasher_res(struct VectorNumBase *basev) {
  return SimhasherRes(basev);
}


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

x86 assembly (clang, -O2):
<simhasher_res>:
jmp    1030 <SimhasherRes@plt>

LLVM IR (-O0):
%struct.VectorNumBase = type { i32 }
define i64 @simhasher_res(%struct.VectorNumBase* %0) {
%2 = alloca %struct.VectorNumBase*
store %struct.VectorNumBase* %0, %struct.VectorNumBase** %2
%3 = load %struct.VectorNumBase*, %struct.VectorNumBase** %2
%4 = call i64 @SimhasherRes(%struct.VectorNumBase* %3)
ret i64 %4
}

LLVM IR (-O2):
%struct.VectorNumBase = type { i32 }
define i64 @simhasher_res(%struct.VectorNumBase* %0) {
%2 = tail call i64 @SimhasherRes(%struct.VectorNumBase* %0)
ret i64 %2
}
/* Variables and functions */
scalar_t__ isspace(char);
void evf_eat_spaces(char **str) {
  while (isspace(**str))
    (*str)++;
}


x86 assembly (clang, -O0):
<evf_eat_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1148 <evf_eat_spaces+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    111c <evf_eat_spaces+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evf_eat_spaces>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
movsbl (%rax),%edi
nopw   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     113a <evf_eat_spaces+0x2a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1120 <evf_eat_spaces+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @evf_eat_spaces(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = tail call i64 @isspace(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %1, %6
%7 = load i8*, i8** %0
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8* %8, i8** %0
%9 = load i8, i8* %8
%10 = tail call i64 @isspace(i8 signext %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
__attribute__((weak)) void USART0_IrqHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<USART0_IrqHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <USART0_IrqHandler+0x9>
jmp    1109 <USART0_IrqHandler+0x9>

x86 assembly (clang, -O2):
<USART0_IrqHandler>:
jmp    1100 <USART0_IrqHandler>

LLVM IR (-O0):
define weak void @USART0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @USART0_IrqHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
void settings_size(int rows, int cols) {}


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

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

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

LLVM IR (-O2):
define void @settings_size(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ devclose();
int /*<<< orphan*/ devrestore();
int /*<<< orphan*/ exit(int);
void doexit(int status) {
  devrestore();
  devclose();
  exit(status);
}


x86 assembly (clang, -O0):
<doexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <devrestore@plt>
mov    $0x0,%al
call   1040 <devclose@plt>
mov    -0x4(%rbp),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<doexit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <devrestore@plt>
xor    %eax,%eax
call   1040 <devclose@plt>
mov    %ebx,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @doexit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @devrestore()
%4 = call i32 (...) @devclose()
%5 = load i32, i32* %2
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
define void @doexit(i32 %0) {
%2 = tail call i32 (...) @devrestore()
%3 = tail call i32 (...) @devclose()
%4 = tail call i32 @exit(i32 %0)
unreachable
}
unsigned long round_down(unsigned long val, unsigned long boundary) {
  return (val & ~(boundary - 1));
}


x86 assembly (clang, -O0):
<round_down>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_down>:
mov    %rsi,%rax
neg    %rax
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @round_down(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub i64 %6, 1
%8 = xor i64 %7, -1
%9 = and i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @round_down(i64 %0, i64 %1) {
%3 = sub i64 0, %1
%4 = and i64 %3, %0
ret i64 %4
}
const char *module2_f(void) {
  static int count = 0;
  ++count;
  return __func__;
}


x86 assembly (clang, -O0):
<module2_f>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1a(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2f11(%rip)
lea    0xee6(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<module2_f>:
addl   $0x1,0x2f1d(%rip)
lea    0xef2(%rip),%rax
ret

LLVM IR (-O0):
@module2_f.count = internal global i32 0
@__func__.module2_f = [10 x i8] c"module2_f\00"
define i8* @module2_f() {
%1 = load i32, i32* @module2_f.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @module2_f.count
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.module2_f, i64 0, i64 0)
}

LLVM IR (-O2):
@module2_f.count = internal unnamed_addr global i32 0
@__func__.module2_f = [10 x i8] c"module2_f\00"
define i8* @module2_f() {
%1 = load i32, i32* @module2_f.count
%2 = add nsw i32 %1, 1
store i32 %2, i32* @module2_f.count
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.module2_f, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ foo(int, int /*<<< orphan*/);
int main() {
  foo(1, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void PrintArgs(char *name) {
  fprintf(stderr,
          "                                                   \n"
          "Usage: %s [max] < input > output                   \n"
          "                                                   \n"
          "It analyses the quality-scores of a FASTQ file.    \n"
          "max stands for the lenght of the maximum window.   \n",
          name);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [261 x i8] c" \0AUsage: %s [max] < input > output \0A \0AIt analyses the quality-scores of a FASTQ file. \0Amax stands for the lenght of the maximum window. \0A\00"
define void @PrintArgs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [261 x i8] c" \0AUsage: %s [max] < input > output \0A \0AIt analyses the quality-scores of a FASTQ file. \0Amax stands for the lenght of the maximum window. \0A\00"
define void @PrintArgs(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([261 x i8], [261 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void ssmash_tilde(char *str) {
  for (; *str != '\0'; str++) {
    if (*str == '~')
      *str = '-';
  }
  return;
}


x86 assembly (clang, -O0):
<ssmash_tilde>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <ssmash_tilde+0x45>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7e,%eax
jne    112f <ssmash_tilde+0x2f>
mov    -0x8(%rbp),%rax
movb   $0x2d,(%rax)
jmp    1134 <ssmash_tilde+0x34>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ssmash_tilde+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ssmash_tilde>:
jmp    1117 <ssmash_tilde+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x2d,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x7e,%al
je     1110 <ssmash_tilde+0x10>
test   %al,%al
jne    1113 <ssmash_tilde+0x13>
ret

LLVM IR (-O0):
define void @ssmash_tilde(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 126
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load i8*, i8** %2
store i8 45, i8* %14
br label %15
15: ; preds = %13, %8
br label %16
16: ; preds = %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @ssmash_tilde(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 126, label %5
]
5: ; preds = %2
store i8 45, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret void
}
void access(int *buf, int n) {
  for (int i = 0; i < n; i++)
    buf[i] = 0;
  if (n > 10)
    access(buf + 10, n - 10);
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    114f <access+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <access+0x16>
cmpl   $0xa,-0xc(%rbp)
jle    116c <access+0x5c>
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
mov    -0xc(%rbp),%esi
sub    $0xa,%esi
call   1030 <access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<access>:
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1142 <access+0x32>
mov    %esi,%r14d
mov    %rdi,%rbx
xchg   %ax,%ax
mov    %r14d,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x28,%rbx
lea    -0xa(%r14),%eax
cmp    $0xa,%r14d
mov    %eax,%r14d
jg     1120 <access+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @access(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i32* [ %10, %4 ], [ %0, %2 ]
%7 = zext i32 %5 to i64
%8 = shl nuw nsw i64 %7, 2
%9 = bitcast i32* %6 to i8*
%10 = getelementptr inbounds i32, i32* %6, i64 10
%11 = add nsw i32 %5, -10
%12 = icmp sgt i32 %5, 10
br i1 %12, label %4, label %13
13: ; preds = %4, %2
ret void
}
unsigned xrop3_33_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return stk1;
}


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

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

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

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

/* Variables and functions */
int mkdir(char const *, int /*<<< orphan*/);
int _mkdir(const char *path, mode_t mode) { return mkdir(path, mode); }


x86 assembly (clang, -O0):
<_mkdir>:
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 <mkdir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mkdir>:
jmp    1030 <mkdir@plt>

LLVM IR (-O0):
define i32 @_mkdir(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 @mkdir(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @_mkdir(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @mkdir(i8* %0, i32 %1)
ret i32 %3
}
double logb(double x) {
  double res;
  asm("fxtract\n\t"
      "fstp	%%st"
      : "=t"(res)
      : "0"(x));
  return res;
}


x86 assembly (clang, -O0):
<logb>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
fldl   -0x18(%rbp)
fxtract
fstp   %st(0)
fstpl  -0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logb>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fxtract
fstp   %st(0)
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @logb(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = call double asm "fxtract\0A\09fstp\09%st", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @logb(double %0) {
%2 = tail call double asm "fxtract\0A\09fstp\09%st", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
ret double %2
}
int rframe(int fr, int slen) {
  int md = slen % 3 - 1;
  if (md == 0)
    md = 3;
  return (md - fr);
}


x86 assembly (clang, -O0):
<rframe>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
sub    $0x1,%edx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112c <rframe+0x2c>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rframe>:
movslq %esi,%rcx
imul   $0x55555556,%rcx,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
add    %edx,%eax
lea    (%rax,%rax,2),%eax
not    %eax
add    %eax,%ecx
mov    $0x3,%eax
cmovne %ecx,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @rframe(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = srem i32 %6, 3
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 3, i32* %5
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %5
%14 = load i32, i32* %3
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @rframe(i32 %0, i32 %1) {
%3 = srem i32 %1, 3
%4 = add nsw i32 %3, -1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 3, i32 %4
%7 = sub nsw i32 %6, %0
ret i32 %7
}
int min(int i, int j) {
  if (i < j)
    return i;
  return j;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
unsigned int getInt16(unsigned char *data, int offset) {
  unsigned int res;
  res = data[offset + 0] << 0;
  res += data[offset + 1] << 8;
  return (int)res;
}


x86 assembly (clang, -O0):
<getInt16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getInt16>:
movslq %esi,%rax
movzwl (%rdi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @getInt16(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 0
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 0
store i32 %13, i32* %5
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = shl i32 %20, 8
%22 = load i32, i32* %5
%23 = add i32 %22, %21
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @getInt16(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 8
%13 = or i32 %12, %6
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ PicoCStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void PicoCStatusRequestUpdate() { UAVObjRequestUpdate(PicoCStatusHandle()); }


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

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

LLVM IR (-O0):
define void @PicoCStatusRequestUpdate() {
%1 = call i32 (...) @PicoCStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PicoCStatusRequestUpdate() {
%1 = tail call i32 (...) @PicoCStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
outint(n) int n;
{
  int q;
  q = n / 10;
  if (q)
    outint(q);
  outbyte('0' - (n - q * 10));
}


x86 assembly (clang, -O0):
<outint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114b <outint+0x2b>
mov    -0xc(%rbp),%edi
call   1030 <outint@plt>
mov    -0x8(%rbp),%eax
imul   $0xa,-0xc(%rbp),%ecx
sub    %ecx,%eax
mov    $0x30,%edi
sub    %eax,%edi
mov    $0x0,%al
call   1040 <outbyte@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outint>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
movslq %edi,%rax
imul   $0x66666667,%rax,%rbx
mov    %rbx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rbx
add    %ecx,%ebx
add    $0x9,%eax
cmp    $0x13,%eax
jb     114b <outint+0x2b>
mov    %ebx,%edi
call   1030 <outint@plt>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%edi
sub    %ebp,%edi
add    $0x30,%edi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <outbyte@plt>

LLVM IR (-O0):
define i32 @outint(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sdiv i32 %5, 10
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %4
%11 = call i32 @outint(i32 %10)
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %14, 10
%16 = sub nsw i32 %13, %15
%17 = sub nsw i32 48, %16
%18 = call i32 (i32, ...) bitcast (i32 (...)* @outbyte to i32 (i32, ...)*)(i32 %17)
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @outint(i32 %0) {
%2 = sdiv i32 %0, 10
%3 = add i32 %0, 9
%4 = icmp ult i32 %3, 19
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @outint(i32 %2)
br label %7
7: ; preds = %5, %1
%8 = mul nsw i32 %2, 10
%9 = sub i32 48, %0
%10 = add i32 %9, %8
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @outbyte to i32 (i32, ...)*)(i32 %10)
ret i32 undef
}
void BN_GF2m_mod_inv(void) {}


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

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

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

LLVM IR (-O2):
define void @BN_GF2m_mod_inv() {
ret void
}
int test_imm_32uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x32 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_32uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 50
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ kernel_older_than(char *, int, int);
int kernel_has_ipv6_subtrees(void) {
  return (kernel_older_than("Linux", 3, 11) == 0);
}


x86 assembly (clang, -O0):
<kernel_has_ipv6_subtrees>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
mov    $0xb,%edx
call   1030 <kernel_older_than@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kernel_has_ipv6_subtrees>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
mov    $0xb,%edx
call   1030 <kernel_older_than@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Linux\00"
define i32 @kernel_has_ipv6_subtrees() {
%1 = call i64 @kernel_older_than(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3, i32 11)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"Linux\00"
define i32 @kernel_has_ipv6_subtrees() {
%1 = tail call i64 @kernel_older_than(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 3, i32 11)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t adjust_seed_1(uint32_t seed) { return seed ^ (seed << 1); }


x86 assembly (clang, -O0):
<adjust_seed_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjust_seed_1>:
lea    (%rdi,%rdi,1),%eax
xor    %edi,%eax
ret

LLVM IR (-O0):
define i32 @adjust_seed_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = shl i32 %4, 1
%6 = xor i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @adjust_seed_1(i32 %0) {
%2 = shl i32 %0, 1
%3 = xor i32 %2, %0
ret i32 %3
}