xunge/DecIR huggingface dataset:
/* Variables and functions */
void *dsbrk(int, int /*<<< orphan*/);
void *getdbrk(int devnum) { return dsbrk(devnum, 0); }


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

x86 assembly (clang, -O2):
<getdbrk>:
xor    %esi,%esi
jmp    1030 <dsbrk@plt>

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

LLVM IR (-O2):
define i8* @getdbrk(i32 %0) {
%2 = tail call i8* @dsbrk(i32 %0, i32 0)
ret i8* %2
}
/* Variables and functions */
void *cs2qrcb();
void *cs2qrcb_(void) { return cs2qrcb(); }


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

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

LLVM IR (-O0):
define i8* @cs2qrcb_() {
%1 = call i8* (...) @cs2qrcb()
ret i8* %1
}

LLVM IR (-O2):
define i8* @cs2qrcb_() {
%1 = tail call i8* (...) @cs2qrcb()
ret i8* %1
}
double tan(x)
double x;
{ return tansub(x, fabs(x), 0); }


x86 assembly (clang, -O0):
<tan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movaps 0xed2(%rip),%xmm2
pand   %xmm2,%xmm1
xor    %edi,%edi
mov    $0x2,%al
call   1030 <tansub@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tan>:
push   %rax
movaps 0xee8(%rip),%xmm1
andps  %xmm0,%xmm1
xor    %edi,%edi
mov    $0x2,%al
call   1030 <tansub@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @tan(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = call double @llvm.fabs.f64(double %4)
%6 = call i32 (double, double, i32, ...) bitcast (i32 (...)* @tansub to i32 (double, double, i32, ...)*)(double %3, double %5, i32 0)
%7 = sitofp i32 %6 to double
ret double %7
}

LLVM IR (-O2):
define double @tan(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = tail call i32 (double, double, i32, ...) bitcast (i32 (...)* @tansub to i32 (double, double, i32, ...)*)(double %0, double %2, i32 0)
%4 = sitofp i32 %3 to double
ret double %4
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_append_array_space(void *m, char type, size_t size, void **ptr) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_append_array_space>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
mov    0x2ec1(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_append_array_space>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array_space(i8* %0, i8 signext %1, i64 %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i64
%8 = alloca i8**
store i8* %0, i8** %5
store i8 %1, i8* %6
store i64 %2, i64* %7
store i8** %3, i8*** %8
%9 = load i32, i32* @EINVAL
%10 = sub nsw i32 0, %9
ret i32 %10
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_append_array_space(i8* nocapture readnone %0, i8 signext %1, i64 %2, i8** nocapture readnone %3) {
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}
/* Variables and functions */
unsigned int ffi_accept();
int /*<<< orphan*/ ffi_send(unsigned int, int, char *);
int main() {
  unsigned int sock = ffi_accept();
  ffi_send(sock, 13, "hello, world");
  ffi_send(sock, 13, "hello, world");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ffi_accept@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xd,%esi
lea    0xeb8(%rip),%rdx
call   1040 <ffi_send@plt>
mov    -0x8(%rbp),%edi
mov    $0xd,%esi
lea    0xea4(%rip),%rdx
call   1040 <ffi_send@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <ffi_accept@plt>
mov    %eax,%ebx
lea    0xecc(%rip),%r14
mov    %eax,%edi
mov    $0xd,%esi
mov    %r14,%rdx
call   1040 <ffi_send@plt>
mov    %ebx,%edi
mov    $0xd,%esi
mov    %r14,%rdx
call   1040 <ffi_send@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @ffi_accept()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ffi_send(i32 %4, i32 13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %2
%7 = call i32 @ffi_send(i32 %6, i32 13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello, world\00"
define i32 @main() {
%1 = tail call i32 (...) @ffi_accept()
%2 = tail call i32 @ffi_send(i32 %1, i32 13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ffi_send(i32 %1, i32 13, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0xb6() {
  Assert_real((isdigit(182) == 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_isdigit.c",
              915, ("isdigit should be 0 for 0xb6"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0xb6>:
push   %rax
mov    $0xb6,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x393,%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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb6\00"
define void @t_isdigit_0xb6() {
%1 = call i64 @isdigit(i32 182)
%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 915, 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0xb6\00"
define void @t_isdigit_0xb6() {
%1 = tail call i64 @isdigit(i32 182)
%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 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *environ_get_shell_snippet();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void environ_output_application_shell(FILE *output_file) {
  fprintf(output_file, "%s", environ_get_shell_snippet());
}


x86 assembly (clang, -O0):
<environ_output_application_shell>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <environ_get_shell_snippet@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb7(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<environ_output_application_shell>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <environ_get_shell_snippet@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <fputs@plt>

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

LLVM IR (-O2):
define void @environ_output_application_shell(i32* nocapture %0) {
%2 = tail call i8* (...) @environ_get_shell_snippet()
%3 = tail call i32 @fputs(i8* %2, i32* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ scsi_modesense(int, int, unsigned char *, int);
int scsi_smartsupport(int device) {
  unsigned char buf[255];
  if (scsi_modesense(device, 0x1c, buf, sizeof(buf)) != 0)
    return 0;
  else
    return (buf[14] & 0x08) == 0;
}


x86 assembly (clang, -O0):
<scsi_smartsupport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rdx
mov    $0x1c,%esi
mov    $0xff,%ecx
call   1030 <scsi_modesense@plt>
cmp    $0x0,%rax
je     114d <scsi_smartsupport+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <scsi_smartsupport+0x55>
movzbl -0x102(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scsi_smartsupport>:
sub    $0x108,%rsp
mov    %rsp,%rdx
mov    $0x1c,%esi
mov    $0xff,%ecx
call   1030 <scsi_modesense@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     113b <scsi_smartsupport+0x2b>
add    $0x108,%rsp
ret
movzbl 0xe(%rsp),%ecx
xor    %eax,%eax
test   $0x8,%cl
sete   %al
add    $0x108,%rsp
ret

LLVM IR (-O0):
define i32 @scsi_smartsupport(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [255 x i8]
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%7 = call i64 @scsi_modesense(i32 %5, i32 28, i8* %6, i32 255)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 0, i32* %2
br label %17
10: ; preds = %1
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 14
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = and i32 %13, 8
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %17
17: ; preds = %10, %9
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @scsi_smartsupport(i32 %0) {
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%4 = call i64 @scsi_modesense(i32 %0, i32 28, i8* %3, i32 255)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 14
%8 = load i8, i8* %7
%9 = lshr i8 %8, 3
%10 = and i8 %9, 1
%11 = xor i8 %10, 1
%12 = zext i8 %11 to i32
br label %13
13: ; preds = %1, %6
%14 = phi i32 [ %12, %6 ], [ 0, %1 ]
ret i32 %14
}
dtgreet(argc, argv) int argc;
char *argv[];
{ main(argc, argv); }


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

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

LLVM IR (-O0):
define i32 @dtgreet(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %6, i8** %7)
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dtgreet(i32 %0, i8** %1) {
%3 = tail call i32 (i32, i8**, ...) bitcast (i32 (...)* @main to i32 (i32, i8**, ...)*)(i32 %0, i8** %1)
ret i32 undef
}
/* Variables and functions */
int asal_sayisi(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int main() {
  int ilk = 100, son = 300;
  int S;
  S = asal_sayisi(ilk, son);
  printf("[%d, %d] arasinda %d tane asal sayi vardir", ilk, son, S);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x64,-0x8(%rbp)
movl   $0x12c,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <asal_sayisi@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
mov    $0x12c,%esi
call   1040 <asal_sayisi@plt>
lea    0xec9(%rip),%rdi
mov    $0x64,%esi
mov    $0x12c,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"[%d, %d] arasinda %d tane asal sayi vardir\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 100, i32* %2
store i32 300, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @asal_sayisi(i32 %5, i32 %6)
store i32 %7, i32* %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %9, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [43 x i8] c"[%d, %d] arasinda %d tane asal sayi vardir\00"
define i32 @main() {
%1 = tail call i32 @asal_sayisi(i32 100, i32 300)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 100, i32 300, i32 %1)
ret i32 0
}
/* Variables and functions */
unsigned char inb_local(int);
unsigned char(inb)(int port) {
  unsigned char tmp;
  {
    tmp = inb_local(port);
    return (tmp);
  }
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <inb_local@plt>
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
jmp    1030 <inb_local@plt>

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

LLVM IR (-O2):
define zeroext i8 @inb(i32 %0) {
%2 = tail call zeroext i8 @inb_local(i32 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ close_kernel();
int /*<<< orphan*/ close_unix();
void close_all(void) {
  close_kernel();
  close_unix();
}


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

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

LLVM IR (-O0):
define void @close_all() {
%1 = call i32 (...) @close_kernel()
%2 = call i32 (...) @close_unix()
ret void
}

LLVM IR (-O2):
define void @close_all() {
%1 = tail call i32 (...) @close_kernel()
%2 = tail call i32 (...) @close_unix()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("world hello\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"world hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void vzero(float v[3]) {
  v[0] = 0.0;
  v[1] = 0.0;
  v[2] = 0.0;
}


x86 assembly (clang, -O0):
<vzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vzero>:
movq   $0x0,(%rdi)
movl   $0x0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vzero(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
ret void
}

LLVM IR (-O2):
define void @vzero(float* nocapture writeonly %0) {
store float 0.000000e+00, float* %0
%2 = getelementptr inbounds float, float* %0, i64 1
store float 0.000000e+00, float* %2
%3 = getelementptr inbounds float, float* %0, i64 2
store float 0.000000e+00, float* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void Usage(char *argv[]) {
  fprintf(stderr,
          "Usage of %s:\n\n"
          "[-dtx] mode speech_file bitstream_file \n\n"
          "or \n\n"
          "[-dtx] -modefile=mode_file speech_file bitstream_file \n\n\n"
          "mode = MR475, MR515, MR59, MR67, MR74, MR795, MR102, MR122 \n\n\n",
          argv[0]);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [180 x i8] c"Usage of %s:\0A\0A[-dtx] mode speech_file bitstream_file \0A\0Aor \0A\0A[-dtx] -modefile=mode_file speech_file bitstream_file \0A\0A\0Amode = MR475, MR515, MR59, MR67, MR74, MR795, MR102, MR122 \0A\0A\0A\00"
define void @Usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i32, i32* @stderr
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [180 x i8] c"Usage of %s:\0A\0A[-dtx] mode speech_file bitstream_file \0A\0Aor \0A\0A[-dtx] -modefile=mode_file speech_file bitstream_file \0A\0A\0Amode = MR475, MR515, MR59, MR67, MR74, MR795, MR102, MR122 \0A\0A\0A\00"
define void @Usage(i8** nocapture %0) {
%2 = load i32, i32* @stderr
%3 = load i8*, i8** %0
%4 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([180 x i8], [180 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
void *malloc(int);
void *realloc(void *, int);
void *Realloc(void *mem, int bytes) {
  mem = mem ? realloc(mem, bytes) : malloc(bytes);
  return mem;
}


x86 assembly (clang, -O0):
<Realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114f <Realloc+0x2f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
jmp    115b <Realloc+0x3b>
mov    -0xc(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Realloc>:
test   %rdi,%rdi
je     112a <Realloc+0xa>
jmp    1040 <realloc@plt>
mov    %esi,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @Realloc(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i8* @realloc(i8* %8, i32 %9)
br label %14
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i8* @malloc(i32 %12)
br label %14
14: ; preds = %11, %7
%15 = phi i8* [ %10, %7 ], [ %13, %11 ]
store i8* %15, i8** %3
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @Realloc(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i32 %1)
br label %8
6: ; preds = %2
%7 = tail call i8* @malloc(i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i8* [ %5, %4 ], [ %7, %6 ]
ret i8* %9
}
/* Variables and functions */
int LZ4_compress_HC(char const *, char *, int, int, int);
int LZ4_compressHC2_limitedOutput(const char *src, char *dst, int srcSize,
                                  int maxDstSize, int cLevel) {
  return LZ4_compress_HC(src, dst, srcSize, maxDstSize, cLevel);
}


x86 assembly (clang, -O0):
<LZ4_compressHC2_limitedOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <LZ4_compress_HC@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressHC2_limitedOutput>:
jmp    1030 <LZ4_compress_HC@plt>

LLVM IR (-O0):
define i32 @LZ4_compressHC2_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @LZ4_compress_HC(i8* %11, i8* %12, i32 %13, i32 %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @LZ4_compressHC2_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @LZ4_compress_HC(i8* %0, i8* %1, i32 %2, i32 %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int isValid(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char **argv) {
  printf("input%s output:%d \n", "(){}", isValid("(){}"));
  ;
  printf("input%s output:%d \n", "([])", isValid("([])"));
  ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed7(%rip),%rdi
call   1040 <isValid@plt>
mov    %eax,%edx
lea    0xeb5(%rip),%rdi
lea    0xec2(%rip),%rsi
call   1030 <printf@plt>
lea    0xebb(%rip),%rdi
call   1040 <isValid@plt>
mov    %eax,%edx
lea    0xe94(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee9(%rip),%rbx
mov    %rbx,%rdi
call   1040 <isValid@plt>
lea    0xec6(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
lea    0xecb(%rip),%rbx
mov    %rbx,%rdi
call   1040 <isValid@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"input%s output:%d \0A\00"
@.str.1 = [5 x i8] c"(){}\00"
@.str.2 = [5 x i8] c"([])\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @isValid(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @isValid(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"input%s output:%d \0A\00"
@.str.1 = [5 x i8] c"(){}\00"
@.str.2 = [5 x i8] c"([])\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isValid(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isValid(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int IsFarRange(long Val) { return (Val & ~0xFFFFFFL) == 0; }


x86 assembly (clang, -O0):
<IsFarRange>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffffffffff000000,%rax
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsFarRange>:
xor    %eax,%eax
cmp    $0x1000000,%rdi
setb   %al
ret

LLVM IR (-O0):
define i32 @IsFarRange(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, -16777216
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @IsFarRange(i64 %0) {
%2 = icmp ult i64 %0, 16777216
%3 = zext i1 %2 to i32
ret i32 %3
}
void FPU_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @FPU_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int vadigits(int /*<<< orphan*/);
int /*<<< orphan*/ valen(void **);
char *vafmt(void *argv[]) {
  static char fmt[10];
  sprintf(fmt, "%%%uu:", vadigits(valen(argv)));
  return fmt;
}


x86 assembly (clang, -O0):
<vafmt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <valen@plt>
mov    %eax,%edi
call   1040 <vadigits@plt>
mov    %eax,%edx
lea    0x2ee4(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1050 <sprintf@plt>
lea    0x2ed1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vafmt>:
push   %rbx
call   1030 <valen@plt>
mov    %eax,%edi
call   1040 <vadigits@plt>
lea    0x2ef5(%rip),%rbx
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@vafmt.fmt = internal global [10 x i8] zeroinitializer
@.str = [7 x i8] c"%%%uu:\00"
define i8* @vafmt(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = call i32 @valen(i8** %3)
%5 = call i32 @vadigits(i32 %4)
%6 = call i32 @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @vafmt.fmt, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @vafmt.fmt, i64 0, i64 0)
}

LLVM IR (-O2):
@vafmt.fmt = internal global [10 x i8] zeroinitializer
@.str = [7 x i8] c"%%%uu:\00"
define i8* @vafmt(i8** %0) {
%2 = tail call i32 @valen(i8** %0)
%3 = tail call i32 @vadigits(i32 %2)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @vafmt.fmt, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @vafmt.fmt, i64 0, i64 0)
}
__attribute__((noipa)) void *return_vla_plus_var(int n, int i) {
  char a[n];
  char *p = a + i;
  sink(p);
  return p;
}


x86 assembly (clang, -O0):
<return_vla_plus_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
mov    %rcx,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,%rsp
mov    %rcx,-0x18(%rbp)
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <sink@plt>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_vla_plus_var>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,%eax
mov    %rsp,%rcx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
movslq %esi,%rbx
add    %rcx,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <sink@plt>
mov    %rbx,%rax
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @return_vla_plus_var(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%8 = load i32, i32* %3
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca i8, i64 %9
store i64 %9, i64* %6
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %15)
%17 = load i8*, i8** %7
%18 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @return_vla_plus_var(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = alloca i8, i64 %3
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @sink to i32 (i8*, ...)*)(i8* %6)
ret i8* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void store16_le(uint8_t dst[2], uint16_t w) { memcpy(dst, &w, sizeof w); }


x86 assembly (clang, -O0):
<store16_le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store16_le>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @store16_le(i32* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i32* %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  if (sizeof(int) == sizeof(long))
    while (1)
      ;
  else
    printf("aba;hg'af");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"aba;hg'af\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"aba;hg'af\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ TimerISR_Disable();
void TimerISR_Stop(void) { TimerISR_Disable(); }


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

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

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

LLVM IR (-O2):
define void @TimerISR_Stop() {
%1 = tail call i32 (...) @TimerISR_Disable()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char nibble_to_hexchar(int);
__attribute__((always_)) char *string_append_two_digit_hex_byte(char *string,
                                                                uint8_t byte) {
  *string = nibble_to_hexchar((byte & 0xf0) >> 4);
  string++;
  *string = nibble_to_hexchar((byte & 0x0f) >> 0);
  string++;
  return string;
}


x86 assembly (clang, -O0):
<string_append_two_digit_hex_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xf0,%edi
sar    $0x4,%edi
call   1030 <nibble_to_hexchar@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
and    $0xf,%edi
sar    $0x0,%edi
call   1030 <nibble_to_hexchar@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_append_two_digit_hex_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
shr    $0x4,%edi
and    $0xf,%edi
call   1030 <nibble_to_hexchar@plt>
mov    %al,(%rbx)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <nibble_to_hexchar@plt>
mov    %al,0x1(%rbx)
add    $0x2,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @string_append_two_digit_hex_byte(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 240
%7 = ashr i32 %6, 4
%8 = call signext i8 @nibble_to_hexchar(i32 %7)
%9 = load i8*, i8** %3
store i8 %8, i8* %9
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i32, i32* %4
%13 = and i32 %12, 15
%14 = ashr i32 %13, 0
%15 = call signext i8 @nibble_to_hexchar(i32 %14)
%16 = load i8*, i8** %3
store i8 %15, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
define i8* @string_append_two_digit_hex_byte(i8* writeonly %0, i32 %1) {
%3 = lshr i32 %1, 4
%4 = and i32 %3, 15
%5 = tail call signext i8 @nibble_to_hexchar(i32 %4)
store i8 %5, i8* %0
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = and i32 %1, 15
%8 = tail call signext i8 @nibble_to_hexchar(i32 %7)
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %0, i64 2
ret i8* %9
}
/* Variables and functions */
double __nv_fma_rd(double, double, double);
double __fma_rd(double __a, double __b, double __c) {
  return __nv_fma_rd(__a, __b, __c);
}


x86 assembly (clang, -O0):
<__fma_rd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
call   1030 <__nv_fma_rd@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__fma_rd>:
jmp    1030 <__nv_fma_rd@plt>

LLVM IR (-O0):
define double @__fma_rd(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @__nv_fma_rd(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @__fma_rd(double %0, double %1, double %2) {
%4 = tail call double @__nv_fma_rd(double %0, double %1, double %2)
ret double %4
}
/* Variables and functions */
void *malloc(size_t);
void *cm(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<cm>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @cm(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @cm(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
int test_imm_6Aint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x6A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Aint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 455266533376
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ sysname;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int /*<<< orphan*/ uname(struct utsname *);
int main() {
  struct utsname un;
  uname(&un);
  puts(un.sysname);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x8(%rbp),%edi
call   1030 <puts@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1040 <uname@plt>
mov    (%rsp),%edi
call   1030 <puts@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.utsname
store i32 0, i32* %1
%3 = call i32 @uname(%struct.utsname* %2)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = call i32 @puts(i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @puts(i32 %5)
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}
/* Variables and functions */
scalar_t__ isalpha(int);
int toupper(int ch) {
  if (isalpha(ch)) {
    return ch & ~0x20;
  } else {
    return ch;
  }
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x8(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalpha@plt>
mov    %ebx,%ecx
and    $0xffffffdf,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @isalpha(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
struct flock {
  int l_type;
  int l_whence;
  void *l_len;
  void *l_start;
};
typedef void *off_t;

/* Variables and functions */
int fcntl(int, int, struct flock *);
int lock_reg(int fd, int cmd, int type, off_t start, int whence, off_t len) {
  struct flock lock;
  lock.l_type = type;
  lock.l_start = start;
  lock.l_whence = whence;
  lock.l_len = len;
  return (fcntl(fd, cmd, &lock));
}


x86 assembly (clang, -O0):
<lock_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_reg>:
sub    $0x18,%rsp
mov    %edx,(%rsp)
mov    %rcx,0x10(%rsp)
mov    %r8d,0x4(%rsp)
mov    %r9,0x8(%rsp)
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.flock
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i32, i32* %9
%15 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 0
store i32 %14, i32* %15
%16 = load i8*, i8** %10
%17 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 3
store i8* %16, i8** %17
%18 = load i32, i32* %11
%19 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 1
store i32 %18, i32* %19
%20 = load i8*, i8** %12
%21 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 2
store i8* %20, i8** %21
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @fcntl(i32 %22, i32 %23, %struct.flock* %13)
ret i32 %24
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca %struct.flock
%8 = bitcast %struct.flock* %7 to i8*
%9 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 0
store i32 %2, i32* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 3
store i8* %3, i8** %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 1
store i32 %4, i32* %11
%12 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 2
store i8* %5, i8** %12
%13 = call i32 @fcntl(i32 %0, i32 %1, %struct.flock* %7)
ret i32 %13
}
/* Variables and functions */
int OSI_GetAdbKey2(int *);
int OSI_GetAdbKey(void) {
  int dummy_raw_key;
  return OSI_GetAdbKey2(&dummy_raw_key);
}


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

x86 assembly (clang, -O2):
<OSI_GetAdbKey>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <OSI_GetAdbKey2@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @OSI_GetAdbKey() {
%1 = alloca i32
%2 = call i32 @OSI_GetAdbKey2(i32* %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @OSI_GetAdbKey() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @OSI_GetAdbKey2(i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int foo(int x) {
  if (x < 10) {
    printf("x is less than 10\n");
  }
  return x;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    1131 <foo+0x21>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
cmp    $0x9,%edi
jg     1124 <foo+0x14>
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"x is less than 10\0A\00"
define i32 @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@str = [18 x i8] c"x is less than 10\00"
define i32 @foo(i32 returned %0) {
%2 = icmp slt i32 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %3, %1
ret i32 %0
}
void padd(long v, void *acc) { *((long *)acc) += v; }


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

x86 assembly (clang, -O2):
<padd>:
add    %rdi,(%rsi)
ret

LLVM IR (-O0):
define void @padd(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 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = add nsw i64 %8, %5
store i64 %9, i64* %7
ret void
}

LLVM IR (-O2):
define void @padd(i64 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = load i64, i64* %3
%5 = add nsw i64 %4, %0
store i64 %5, i64* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct stat {
  int /*<<< orphan*/ st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
uint64_t get_filesize(char *filename) {
  struct stat buf;
  stat(filename, &buf);
  return buf.st_size;
}


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

x86 assembly (clang, -O2):
<get_filesize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @get_filesize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @get_filesize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
ret i32 %6
}