xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ COLS;
scalar_t__ LINES;
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mvcur(int /*<<< orphan*/, scalar_t__, scalar_t__,
                         int /*<<< orphan*/);
void end_proc() {
  mvcur(0, COLS - 1, LINES - 1, 0);
  endwin();
  exit(SIGINT);
}


x86 assembly (clang, -O0):
<end_proc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%rsi
sub    $0x1,%rsi
mov    0x2e97(%rip),%rax
mov    (%rax),%rdx
sub    $0x1,%rdx
xor    %ecx,%ecx
mov    %ecx,%edi
call   1030 <mvcur@plt>
mov    $0x0,%al
call   1040 <endwin@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<end_proc>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%rsi
add    $0xffffffffffffffff,%rsi
mov    0x2e9a(%rip),%rax
mov    (%rax),%rdx
add    $0xffffffffffffffff,%rdx
xor    %edi,%edi
xor    %ecx,%ecx
call   1030 <mvcur@plt>
xor    %eax,%eax
call   1040 <endwin@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@COLS = global i64 0
@LINES = global i64 0
@SIGINT = global i32 0
define void @end_proc() {
%1 = load i64, i64* @COLS
%2 = sub nsw i64 %1, 1
%3 = load i64, i64* @LINES
%4 = sub nsw i64 %3, 1
%5 = call i32 @mvcur(i32 0, i64 %2, i64 %4, i32 0)
%6 = call i32 (...) @endwin()
%7 = load i32, i32* @SIGINT
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@COLS = global i64 0
@LINES = global i64 0
@SIGINT = global i32 0
define void @end_proc() {
%1 = load i64, i64* @COLS
%2 = add nsw i64 %1, -1
%3 = load i64, i64* @LINES
%4 = add nsw i64 %3, -1
%5 = tail call i32 @mvcur(i32 0, i64 %2, i64 %4, i32 0)
%6 = tail call i32 (...) @endwin()
%7 = load i32, i32* @SIGINT
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Type definitions */
typedef scalar_t__ volatile uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ _UARTBaseValid(scalar_t__ volatile);
void UARTIntDisable(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ASSERT(_UARTBaseValid(ui32Base));
  (*((volatile uint32_t *)(ui32Base + 0x00000038))) &= ~(ui32IntFlags);
}


x86 assembly (clang, -O0):
<UARTIntDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    -0x10(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rcx
and    %rdx,%rcx
mov    %rcx,0x38(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTIntDisable>:
sub    $0x18,%rsp
mov    %rdi,0x8(%rsp)
mov    %rsi,0x10(%rsp)
mov    0x8(%rsp),%rdi
call   1030 <_UARTBaseValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
mov    0x10(%rsp),%rax
not    %rax
mov    0x8(%rsp),%rcx
and    %rax,0x38(%rcx)
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @UARTIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = call i32 @_UARTBaseValid(i64 %5)
%7 = call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = xor i64 %8, -1
%10 = load volatile i64, i64* %3
%11 = add nsw i64 %10, 56
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}

LLVM IR (-O2):
define void @UARTIntDisable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store volatile i64 %0, i64* %3
store volatile i64 %1, i64* %4
%5 = load volatile i64, i64* %3
%6 = tail call i32 @_UARTBaseValid(i64 %5)
%7 = tail call i32 @ASSERT(i32 %6)
%8 = load volatile i64, i64* %4
%9 = xor i64 %8, -1
%10 = load volatile i64, i64* %3
%11 = add nsw i64 %10, 56
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
%14 = and i64 %13, %9
store volatile i64 %14, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TestAll();
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Aciklama: One-point iteration harici fonksiyonlar pozitif degerler "
         "verildiginde calisiyor.\n\n");
  TestAll();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <TestAll@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [93 x i8] c"Aciklama: One-point iteration harici fonksiyonlar pozitif degerler verildiginde calisiyor.\0A\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @TestAll()
ret i32 0
}

LLVM IR (-O2):
@str = [92 x i8] c"Aciklama: One-point iteration harici fonksiyonlar pozitif degerler verildiginde calisiyor.\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @TestAll()
ret i32 0
}
int not_in_ldconfig(int n) { return n + 1; }


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

x86 assembly (clang, -O2):
<not_in_ldconfig>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @not_in_ldconfig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @not_in_ldconfig(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
double RAND_MAX;
scalar_t__ rand();
double random_initializer(int i, int j) { return (double)(rand()) / RAND_MAX; }


x86 assembly (clang, -O0):
<random_initializer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb7(%rip),%rax
divsd  (%rax),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_initializer>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global double 0.000000e+00
define double @random_initializer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load double, double* @RAND_MAX
%8 = fdiv double %6, %7
ret double %8
}

LLVM IR (-O2):
@RAND_MAX = global double 0.000000e+00
define double @random_initializer(i32 %0, i32 %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load double, double* @RAND_MAX
%6 = fdiv double %4, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Exit() {
  printf("\nThank you for using Pallavi Vichare's Handy Calculator\n\n");
}


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

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

LLVM IR (-O0):
@.str = [58 x i8] c"\0AThank you for using Pallavi Vichare's Handy Calculator\0A\0A\00"
define void @Exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [57 x i8] c"\0AThank you for using Pallavi Vichare's Handy Calculator\0A\00"
define void @Exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x14() {
  Assert_real((isprint(20) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              105, ("isprint should be 0 for 0x14"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x14>:
push   %rax
mov    $0x14,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x69,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x14\00"
define void @t_isprint_0x14() {
%1 = call i64 @isprint(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 105, 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_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x14\00"
define void @t_isprint_0x14() {
%1 = tail call i64 @isprint(i32 20)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int _w_usage(void) {
  fputs("Usage: "
        "w"
        "\n",
        stderr);
  return 1;
}


x86 assembly (clang, -O0):
<_w_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_w_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
call   1030 <fputs@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Usage: w\0A\00"
@stderr = global i32 0
define i32 @_w_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}

LLVM IR (-O2):
@.str = [10 x i8] c"Usage: w\0A\00"
@stderr = global i32 0
define i32 @_w_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 1
}
/* Type definitions */
struct in_addr {
  int /*<<< orphan*/ s_addr;
};
typedef int in_addr_t;

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char *);
int inet_netof(struct in_addr);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  struct in_addr addr = {};
  addr.s_addr = inet_addr("127.0.1.1");
  in_addr_t netof = inet_netof(addr);
  printf("%d\n", netof);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    0xe93(%rip),%rdi
call   1050 <inet_addr@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1060 <inet_netof@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <inet_addr@plt>
mov    %eax,%edi
call   1050 <inet_netof@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.in_addr = type { i32 }
@.str = [10 x i8] c"127.0.1.1\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.in_addr
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast %struct.in_addr* %6 to i8*
%9 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
store i32 %9, i32* %10
%11 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %6, i32 0, i32 0
%12 = load i32, i32* %11
%13 = call i32 @inet_netof(i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.1.1\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @inet_netof(i32 %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
int isaleap(int iyr) {
  int leap;
  if (((!(iyr % 4)) && (iyr % 100)) || (!(iyr % 400)))
    leap = 1;
  else
    leap = 0;
  return leap;
}


x86 assembly (clang, -O0):
<isaleap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <isaleap+0x2f>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <isaleap+0x43>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isaleap+0x4f>
movl   $0x1,-0x8(%rbp)
jmp    1156 <isaleap+0x56>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isaleap>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isaleap(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ _go(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void handle(int sig) {
  _go(1);
  exit(0);
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <_go@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<handle>:
push   %rax
mov    $0x1,%edi
call   1030 <_go@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @handle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_go(i32 1)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @handle(i32 %0) {
%2 = tail call i32 @_go(i32 1)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void VecSelfSubtract3iv(int v[3], int s) {
  v[0] -= s;
  v[1] -= s;
  v[2] -= s;
}


x86 assembly (clang, -O0):
<VecSelfSubtract3iv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    %edx,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
sub    %edx,%ecx
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
sub    %edx,%ecx
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecSelfSubtract3iv>:
sub    %esi,(%rdi)
sub    %esi,0x4(%rdi)
sub    %esi,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @VecSelfSubtract3iv(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = sub nsw i32 %3, %1
store i32 %4, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = sub nsw i32 %6, %1
store i32 %7, i32* %5
%8 = getelementptr inbounds i32, i32* %0, i64 2
%9 = load i32, i32* %8
%10 = sub nsw i32 %9, %1
store i32 %10, i32* %8
ret void
}
/* Variables and functions */
extern size_t vec_len(void *vec) {
  return (*(size_t *)(((char *)vec - (sizeof(size_t) * 3)) + sizeof(size_t)));
}


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

x86 assembly (clang, -O2):
<vec_len>:
mov    -0x10(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @vec_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -24
%5 = getelementptr inbounds i8, i8* %4, i64 8
%6 = bitcast i8* %5 to i64*
%7 = load i64, i64* %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @vec_len(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -16
%3 = bitcast i8* %2 to i64*
%4 = load i64, i64* %3
ret i64 %4
}
/* Variables and functions */
int sqrt(int);
bool isPrime(int n) {
  for (int i = 2; i < sqrt(n); i++) {
    if (n % i == 0)
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    116c <isPrime+0x5c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1159 <isPrime+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1173 <isPrime+0x63>
jmp    115e <isPrime+0x4e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <isPrime+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
call   1030 <sqrt@plt>
mov    $0x1,%r14d
cmp    $0x3,%eax
jl     114c <isPrime+0x3c>
mov    $0x2,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
cltd
idiv   %ebx
test   %edx,%edx
je     1149 <isPrime+0x39>
add    $0x1,%ebx
mov    %ebp,%edi
call   1030 <sqrt@plt>
cmp    %eax,%ebx
jl     1130 <isPrime+0x20>
jmp    114c <isPrime+0x3c>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = tail call i32 @sqrt(i32 %0)
%3 = icmp sgt i32 %2, 2
br i1 %3, label %7, label %12
4: ; preds = %7
%5 = tail call i32 @sqrt(i32 %0)
%6 = icmp slt i32 %11, %5
br i1 %6, label %7, label %12
7: ; preds = %1, %4
%8 = phi i32 [ %11, %4 ], [ 2, %1 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %4
12: ; preds = %4, %7, %1
%13 = phi i32 [ 1, %1 ], [ 0, %7 ], [ 1, %4 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_ivector(int *V, long n0, long N) { free((char *)(V + n0 - 1)); }


x86 assembly (clang, -O0):
<free_ivector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ivector>:
lea    (%rdi,%rsi,4),%rdi
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ivector(i32* %0, i64 %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32*, i32** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
%11 = bitcast i32* %10 to i8*
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
define void @free_ivector(i32* nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32, i32* %0, i64 %1
%5 = getelementptr inbounds i32, i32* %4, i64 -1
%6 = bitcast i32* %5 to i8*
%7 = tail call i32 @free(i8* %6)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  int condition = 0;
  printf("%s\n", (condition) ? "true" : "false");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
lea    0xed2(%rip),%rsi
lea    0xec6(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e88(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [5 x i8] c"true\00"
@.str.2 = [6 x i8] c"false\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%7 = load i32, i32* %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.2 = [6 x i8] c"false\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void ns_put32(unsigned long l, unsigned char *cp) {
  *cp++ = l >> 24;
  *cp++ = l >> 16;
  *cp++ = l >> 8;
  *cp++ = l;
}


x86 assembly (clang, -O0):
<ns_put32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ns_put32(i64 %0, i8* nocapture writeonly %1) {
%3 = lshr i64 %0, 24
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %4, i8* %1
%6 = lshr i64 %0, 16
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %7, i8* %5
%9 = lshr i64 %0, 8
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %10, i8* %8
%12 = trunc i64 %0 to i8
store i8 %12, i8* %11
ret void
}
double ceil_dbl(double x) {
  const double truncation = (long long)x;
  const double ceiling = truncation + (truncation < x);
  return ceiling;
}


x86 assembly (clang, -O0):
<ceil_dbl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
ucomisd %xmm2,%xmm1
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_dbl>:
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
movapd %xmm1,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xee5(%rip),%xmm0
andpd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @ceil_dbl(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i64
%7 = sitofp i64 %6 to double
store double %7, double* %3
%8 = load double, double* %3
%9 = load double, double* %3
%10 = load double, double* %2
%11 = fcmp olt double %9, %10
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
%14 = fadd double %8, %13
store double %14, double* %4
%15 = load double, double* %4
ret double %15
}

LLVM IR (-O2):
define double @ceil_dbl(double %0) {
%2 = fptosi double %0 to i64
%3 = sitofp i64 %2 to double
%4 = fcmp olt double %3, %0
%5 = uitofp i1 %4 to double
%6 = fadd double %3, %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ rcu_qs();
void rcu_softirq_qs(void) { rcu_qs(); }


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

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

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

LLVM IR (-O2):
define void @rcu_softirq_qs() {
%1 = tail call i32 (...) @rcu_qs()
ret void
}
void cli_secure_boot_cmd(const char *cmd) {}


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

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

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

LLVM IR (-O2):
define void @cli_secure_boot_cmd(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pelgpa_(double *, double *);
void cpelgpa(double *xmom, double *para) { pelgpa_(xmom, para); }


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

x86 assembly (clang, -O2):
<cpelgpa>:
jmp    1030 <pelgpa_@plt>

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

LLVM IR (-O2):
define void @cpelgpa(double* %0, double* %1) {
%3 = tail call i32 @pelgpa_(double* %0, double* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p448_carry_mul(uintptr_t, uintptr_t,
                                                uintptr_t);
void fiat_p448_carry_mul(uint64_t out1[8], const uint64_t arg1[8],
                         const uint64_t arg2[8]) {
  internal_fiat_p448_carry_mul((uintptr_t)out1, (uintptr_t)arg1,
                               (uintptr_t)arg2);
}


x86 assembly (clang, -O0):
<fiat_p448_carry_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <internal_fiat_p448_carry_mul@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p448_carry_mul>:
jmp    1030 <internal_fiat_p448_carry_mul@plt>

LLVM IR (-O0):
define void @fiat_p448_carry_mul(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = ptrtoint i32* %7 to i64
%9 = load i32*, i32** %5
%10 = ptrtoint i32* %9 to i64
%11 = load i32*, i32** %6
%12 = ptrtoint i32* %11 to i64
%13 = call i32 @internal_fiat_p448_carry_mul(i64 %8, i64 %10, i64 %12)
ret void
}

LLVM IR (-O2):
define void @fiat_p448_carry_mul(i32* %0, i32* %1, i32* %2) {
%4 = ptrtoint i32* %0 to i64
%5 = ptrtoint i32* %1 to i64
%6 = ptrtoint i32* %2 to i64
%7 = tail call i32 @internal_fiat_p448_carry_mul(i64 %4, i64 %5, i64 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_request_call_context_request_metadata() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_request_call_context_request_metadata>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_request_call_context_request_metadata>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_request_metadata() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_request_metadata() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void nested_both() {
  while (1) {
    while (1)
      assert(1);
  }
}


x86 assembly (clang, -O0):
<nested_both>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <nested_both+0x9>
jmp    111e <nested_both+0xe>
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    111e <nested_both+0xe>

x86 assembly (clang, -O2):
<nested_both>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <assert@plt>
jmp    1120 <nested_both+0x10>

LLVM IR (-O0):
define void @nested_both() {
br label %1
1: ; preds = %0
br label %2
2: ; preds = %1, %2
%3 = call i32 @assert(i32 1)
br label %2
}

LLVM IR (-O2):
define void @nested_both() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @assert(i32 1)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
void g(int a) { f(a); }


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

x86 assembly (clang, -O2):
<g>:
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define void @g(i32 %0) {
%2 = tail call i32 @f(i32 %0)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ get32rand();
uint64_t get64rand() {
  return (((uint64_t)get32rand()) << 32) | (uint32_t)get32rand();
}


x86 assembly (clang, -O0):
<get64rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get32rand@plt>
mov    $0x20,%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get32rand@plt>
mov    %rax,%rcx
mov    -0x4(%rbp),%eax
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get64rand>:
push   %rax
xor    %eax,%eax
call   1030 <get32rand@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <get32rand@plt>

LLVM IR (-O0):
define i32 @get64rand() {
%1 = call i64 (...) @get32rand()
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 32
%4 = call i64 (...) @get32rand()
%5 = trunc i64 %4 to i32
%6 = or i32 %3, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @get64rand() {
%1 = tail call i64 (...) @get32rand()
%2 = tail call i64 (...) @get32rand()
ret i32 poison
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_spinlock_t;

/* Variables and functions */
int /*<<< orphan*/ dlock_lock(int /*<<< orphan*/ *, int);
int o_pthread_spin_lock(int /*<<< orphan*/ *);
scalar_t__ pthread_self();
int ___pthread_spin_lock(pthread_spinlock_t *spin, char *lname, char *fn,
                         int ln) {
  int ret;
  ;
  ret = o_pthread_spin_lock(spin);
  dlock_lock(spin, (int)pthread_self());
  return ret;
}


x86 assembly (clang, -O0):
<___pthread_spin_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <o_pthread_spin_lock@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <dlock_lock@plt>
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<___pthread_spin_lock>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <o_pthread_spin_lock@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1050 <pthread_self@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <dlock_lock@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @___pthread_spin_lock(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load i32*, i32** %5
%11 = call i32 @o_pthread_spin_lock(i32* %10)
store i32 %11, i32* %9
%12 = load i32*, i32** %5
%13 = call i64 (...) @pthread_self()
%14 = trunc i64 %13 to i32
%15 = call i32 @dlock_lock(i32* %12, i32 %14)
%16 = load i32, i32* %9
ret i32 %16
}

LLVM IR (-O2):
define i32 @___pthread_spin_lock(i32* %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i32 %3) {
%5 = tail call i32 @o_pthread_spin_lock(i32* %0)
%6 = tail call i64 (...) @pthread_self()
%7 = trunc i64 %6 to i32
%8 = tail call i32 @dlock_lock(i32* %0, i32 %7)
ret i32 %5
}
int udg_test_decl_with_assign() { int x = 0; }


x86 assembly (clang, -O0):
<udg_test_decl_with_assign>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @udg_test_decl_with_assign() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ console_shutdown();
void shutdown(void) { console_shutdown(); }


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

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

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

LLVM IR (-O2):
define void @shutdown() {
%1 = tail call i32 (...) @console_shutdown()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int maxProduct(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a[] = {2, 3, -2, 4};
  printf("%d\n", maxProduct(a, sizeof(a) / sizeof(int)));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <maxProduct@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <maxProduct@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 2, i32 3, i32 -2, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
store i32 0, i32* %1
%3 = bitcast [4 x i32]* %2 to i8*
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%5 = call i32 @maxProduct(i32* %4, i32 4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 2, i32 3, i32 -2, i32 4]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @maxProduct(i32* %3, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutMainLoop();
int guiMainLoop() {
  glutMainLoop();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @guiMainLoop() {
%1 = call i32 (...) @glutMainLoop()
ret i32 0
}

LLVM IR (-O2):
define i32 @guiMainLoop() {
%1 = tail call i32 (...) @glutMainLoop()
ret i32 0
}
int test_imm_62int16_mem(short *val) {
  return ((*val) & (0x62 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_62int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 98
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void strcat_no_overflow(char *y) {
  char x[5] = "12";
  if (strlen(y) == 2)
    strcat(x, y);
}


x86 assembly (clang, -O0):
<strcat_no_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    115d <strcat_no_overflow+0x3d>
lea    -0xd(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_no_overflow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movb   $0x0,0xc(%rsp)
movl   $0x3231,0x8(%rsp)
call   1030 <strlen@plt>
cmp    $0x2,%eax
jne    114c <strcat_no_overflow+0x2c>
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strcat_no_overflow.x = [5 x i8] c"12\00\00\00"
define void @strcat_no_overflow(i8* %0) {
%2 = alloca i8*
%3 = alloca [5 x i8]
store i8* %0, i8** %2
%4 = bitcast [5 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @strcat(i8* %9, i8* %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@__const.strcat_no_overflow.x = [5 x i8] c"12\00\00\00"
define void @strcat_no_overflow(i8* %0) {
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strcat(i8* %3, i8* %0)
br label %8
8: ; preds = %6, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LCD_ControlWrite(int);
void LCD_Init(void) {
  LCD_ControlWrite(0x0C);
  LCD_ControlWrite(0x01);
  LCD_ControlWrite(0x06);
}


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

x86 assembly (clang, -O2):
<LCD_Init>:
push   %rax
mov    $0xc,%edi
call   1030 <LCD_ControlWrite@plt>
mov    $0x1,%edi
call   1030 <LCD_ControlWrite@plt>
mov    $0x6,%edi
pop    %rax
jmp    1030 <LCD_ControlWrite@plt>

LLVM IR (-O0):
define void @LCD_Init() {
%1 = call i32 @LCD_ControlWrite(i32 12)
%2 = call i32 @LCD_ControlWrite(i32 1)
%3 = call i32 @LCD_ControlWrite(i32 6)
ret void
}

LLVM IR (-O2):
define void @LCD_Init() {
%1 = tail call i32 @LCD_ControlWrite(i32 12)
%2 = tail call i32 @LCD_ControlWrite(i32 1)
%3 = tail call i32 @LCD_ControlWrite(i32 6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
unsigned int EEPROMDeviceName(char *DevName) {
  char *str = "EEPROM_S24CS64A";
  strcat(DevName, str);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"EEPROM_S24CS64A\00"
define i32 @EEPROMDeviceName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @strcat(i8* %4, i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"EEPROM_S24CS64A\00"
define i32 @EEPROMDeviceName(i8* %0) {
%2 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void setupTachoDisplay() {}


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

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

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

LLVM IR (-O2):
define void @setupTachoDisplay() {
ret void
}
/* Variables and functions */
long strtol(char const *, char **, int);
long int c_strtol(const char *arg0, char **arg1, int arg2) {
  return strtol(arg0, arg1, arg2);
}


x86 assembly (clang, -O0):
<c_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),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_strtol>:
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @c_strtol(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
void gtk_image_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_image_get_type() {
ret void
}