xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x0c() {
  Assert_real((isprint(12) == 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",
              65, ("isprint should be 0 for 0x0c"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x0c>:
push   %rax
mov    $0xc,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41,%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 0x0c\00"
define void @t_isprint_0x0c() {
%1 = call i64 @isprint(i32 12)
%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 65, 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 0x0c\00"
define void @t_isprint_0x0c() {
%1 = tail call i64 @isprint(i32 12)
%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 65, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int x86_family(unsigned int);
unsigned int x86_model(unsigned int sig) {
  unsigned int fam, model;
  fam = x86_family(sig);
  model = (sig >> 4) & 0xf;
  if (fam >= 0x6)
    model += ((sig >> 16) & 0xf) << 4;
  return model;
}


x86 assembly (clang, -O0):
<x86_model>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <x86_family@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x4,%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x6,-0x8(%rbp)
jb     114e <x86_model+0x3e>
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
and    $0xf,%eax
shl    $0x4,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x86_model>:
push   %rbx
mov    %edi,%ebx
call   1030 <x86_family@plt>
mov    %ebx,%edx
shr    $0x4,%edx
and    $0xf,%edx
shr    $0xc,%ebx
and    $0xf0,%ebx
xor    %ecx,%ecx
cmp    $0x6,%eax
cmovae %ebx,%ecx
or     %edx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @x86_model(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @x86_family(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = lshr i32 %7, 4
%9 = and i32 %8, 15
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = icmp uge i32 %10, 6
br i1 %11, label %12, label %19
12: ; preds = %1
%13 = load i32, i32* %2
%14 = lshr i32 %13, 16
%15 = and i32 %14, 15
%16 = shl i32 %15, 4
%17 = load i32, i32* %4
%18 = add i32 %17, %16
store i32 %18, i32* %4
br label %19
19: ; preds = %12, %1
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @x86_model(i32 %0) {
%2 = tail call i32 @x86_family(i32 %0)
%3 = lshr i32 %0, 4
%4 = and i32 %3, 15
%5 = icmp ugt i32 %2, 5
%6 = lshr i32 %0, 12
%7 = and i32 %6, 240
%8 = select i1 %5, i32 %7, i32 0
%9 = or i32 %8, %4
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ vram_adr(unsigned int);
int /*<<< orphan*/ vram_put(int);
void put_str(unsigned int adr, const char *str) {
  vram_adr(adr);
  while (1) {
    if (!*str)
      break;
    vram_put((*str++) - 0x20);
  }
}


x86 assembly (clang, -O0):
<put_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <vram_adr@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1149 <put_str+0x29>
jmp    1168 <put_str+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
sub    $0x20,%edi
call   1030 <vram_put@plt>
jmp    1137 <put_str+0x17>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_str>:
push   %rbx
mov    %rsi,%rbx
call   1040 <vram_adr@plt>
mov    (%rbx),%al
test   %al,%al
je     1156 <put_str+0x36>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
add    $0xffffffe0,%edi
call   1030 <vram_put@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <put_str+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @put_str(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @vram_adr(i32 %0)
%4 = load i8, i8* %1
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %13, %6 ], [ %4, %2 ]
%8 = phi i8* [ %9, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = sext i8 %7 to i32
%11 = add nsw i32 %10, -32
%12 = tail call i32 @vram_put(i32 %11)
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ lecture();
int main(int argc, const char *argv[]) {
  lecture();
  return EXIT_SUCCESS;
}


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)
mov    $0x0,%al
call   1030 <lecture@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <lecture@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @lecture()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @lecture()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void genhash_str_free_func(void *vkey) { free(vkey); }


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

x86 assembly (clang, -O2):
<genhash_str_free_func>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @genhash_str_free_func(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_pkey_alloc;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int pkey_alloc(void) { return syscall(SYS_pkey_alloc, 0, 0); }


x86 assembly (clang, -O0):
<pkey_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkey_alloc>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_pkey_alloc = global i32 0
define i32 @pkey_alloc() {
%1 = load i32, i32* @SYS_pkey_alloc
%2 = call i32 @syscall(i32 %1, i32 0, i32 0)
ret i32 %2
}

LLVM IR (-O2):
@SYS_pkey_alloc = global i32 0
define i32 @pkey_alloc() {
%1 = load i32, i32* @SYS_pkey_alloc
%2 = tail call i32 @syscall(i32 %1, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _XSend() {
  printf("_XSend called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"_XSend called\00"
define i32 @_XSend() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
double decode_speed(uint8_t s) {
  if (!s)
    return 0.0;
  if (s == 63)
    return 1968;
  return 32 * (s - 1);
}


x86 assembly (clang, -O0):
<decode_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    111e <decode_speed+0x1e>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <decode_speed+0x4c>
cmpl   $0x3f,-0xc(%rbp)
jne    113a <decode_speed+0x3a>
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114c <decode_speed+0x4c>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
shl    $0x5,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_speed>:
test   %edi,%edi
je     1112 <decode_speed+0x12>
cmp    $0x3f,%edi
jne    1116 <decode_speed+0x16>
movsd  0xeef(%rip),%xmm0
ret
xorps  %xmm0,%xmm0
ret
shl    $0x5,%edi
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
ret

LLVM IR (-O0):
define double @decode_speed(i32 %0) {
%2 = alloca double
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store double 0.000000e+00, double* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 63
br i1 %9, label %10, label %11
10: ; preds = %7
store double 1.968000e+03, double* %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = mul nsw i32 32, %13
%15 = sitofp i32 %14 to double
store double %15, double* %2
br label %16
16: ; preds = %11, %10, %6
%17 = load double, double* %2
ret double %17
}

LLVM IR (-O2):
define double @decode_speed(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %7
i32 63, label %2
]
2: ; preds = %1
br label %7
3: ; preds = %1
%4 = shl i32 %0, 5
%5 = add i32 %4, -32
%6 = sitofp i32 %5 to double
br label %7
7: ; preds = %1, %3, %2
%8 = phi double [ 1.968000e+03, %2 ], [ %6, %3 ], [ 0.000000e+00, %1 ]
ret double %8
}
int foo() {
  void (*q)(void);
  int r = q;
  if (r != 0)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1121 <foo+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1128 <foo+0x28>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 2
}
/* Variables and functions */
int errno;
scalar_t__ fsetxattr(int, char const *, char const *, size_t,
                     int /*<<< orphan*/);
size_t strlen(char const *);
int fxsets(int fd, const char *xname, const char *s) {
  size_t s_len;
  s_len = strlen(s);
  if (fsetxattr(fd, xname, s, s_len, 0) < 0)
    return -errno;
  return 0;
}


x86 assembly (clang, -O0):
<fxsets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <fsetxattr@plt>
cmp    $0x0,%rax
jge    1174 <fxsets+0x54>
xor    %eax,%eax
mov    0x2e76(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    117b <fxsets+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fxsets>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%r15d
mov    %rdx,%rdi
call   1040 <strlen@plt>
xor    %ebp,%ebp
mov    %r15d,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
xor    %r8d,%r8d
call   1030 <fsetxattr@plt>
mov    0x2e8b(%rip),%rcx
sub    (%rcx),%ebp
sar    $0x3f,%rax
and    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @fxsets(i32 %0, i8* %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = tail call i64 @fsetxattr(i32 %0, i8* %1, i8* %2, i64 %4, i32 0)
%6 = icmp slt i64 %5, 0
%7 = load i32, i32* @errno
%8 = sub nsw i32 0, %7
%9 = select i1 %6, i32 %8, i32 0
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __softboundcets_metadata_store(void *, void *, void *,
                                                  size_t, void *);
__attribute__((__weak__, __always___)) void
__softboundcets_metadata_store_vector(void *addr_of_ptr, void *base,
                                      void *bound, size_t key, void *lock,
                                      int index) {
  size_t val = index * 8;
  size_t addr = (size_t)addr_of_ptr;
  addr = addr + val;
  __softboundcets_metadata_store((void *)addr, base, bound, key, lock);
}


x86 assembly (clang, -O0):
<__softboundcets_metadata_store_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
shl    $0x3,%eax
cltq
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
add    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <__softboundcets_metadata_store@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__softboundcets_metadata_store_vector>:
shl    $0x3,%r9d
movslq %r9d,%rax
add    %rax,%rdi
jmp    1030 <__softboundcets_metadata_store@plt>

LLVM IR (-O0):
define weak void @__softboundcets_metadata_store_vector(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
store i8* %0, i8** %7
store i8* %1, i8** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%15 = load i32, i32* %12
%16 = mul nsw i32 %15, 8
%17 = sext i32 %16 to i64
store i64 %17, i64* %13
%18 = load i8*, i8** %7
%19 = ptrtoint i8* %18 to i64
store i64 %19, i64* %14
%20 = load i64, i64* %14
%21 = load i64, i64* %13
%22 = add i64 %20, %21
store i64 %22, i64* %14
%23 = load i64, i64* %14
%24 = inttoptr i64 %23 to i8*
%25 = load i8*, i8** %8
%26 = load i8*, i8** %9
%27 = load i64, i64* %10
%28 = load i8*, i8** %11
%29 = call i32 @__softboundcets_metadata_store(i8* %24, i8* %25, i8* %26, i64 %27, i8* %28)
ret void
}

LLVM IR (-O2):
define weak void @__softboundcets_metadata_store_vector(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4, i32 %5) {
%7 = shl nsw i32 %5, 3
%8 = sext i32 %7 to i64
%9 = ptrtoint i8* %0 to i64
%10 = add i64 %8, %9
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 @__softboundcets_metadata_store(i8* %11, i8* %1, i8* %2, i64 %3, i8* %4)
ret void
}
void compact_nodes() {}


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

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

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

LLVM IR (-O2):
define void @compact_nodes() {
ret void
}
/* Variables and functions */
float __nv_atan2f(float, float);
float atan2f(float __a, float __b) { return __nv_atan2f(__a, __b); }


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

x86 assembly (clang, -O2):
<atan2f>:
jmp    1030 <__nv_atan2f@plt>

LLVM IR (-O0):
define float @atan2f(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__nv_atan2f(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @atan2f(float %0, float %1) {
%3 = tail call float @__nv_atan2f(float %0, float %1)
ret float %3
}
map_keypad(ch) char *ch;
{
  int c;
  int key, rawkey, n;
  char side;
}


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

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

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

LLVM IR (-O2):
define i32 @map_keypad(i8* nocapture readnone %0) {
ret i32 undef
}
int iswhite(int ch) {
  return ch == '\000' || ch == '\011' || ch == '\012' || ch == '\014' ||
         ch == '\015' || ch == '\040';
}


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <iswhite+0x5c>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <iswhite+0x5c>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <iswhite+0x5c>
mov    $0x1,%al
cmpl   $0xc,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <iswhite+0x5c>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     115c <iswhite+0x5c>
cmpl   $0x20,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0xd,%edi
ja     1115 <iswhite+0x15>
mov    $0x1,%eax
mov    $0x3601,%ecx
bt     %edi,%ecx
jae    1115 <iswhite+0x15>
ret
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @iswhite(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %20, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %20, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br i1 %10, label %20, label %11
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 12
br i1 %13, label %20, label %14
14: ; preds = %11
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 13
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 32
br label %20
20: ; preds = %17, %14, %11, %8, %5, %1
%21 = phi i1 [ true, %14 ], [ true, %11 ], [ true, %8 ], [ true, %5 ], [ true, %1 ], [ %19, %17 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @iswhite(i32 %0) {
switch i32 %0, label %2 [
i32 13, label %5
i32 12, label %5
i32 10, label %5
i32 9, label %5
i32 0, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 32
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
/* Type definitions */
struct rtas_usr_hdr_scn {
  int dummy;
};
struct rtas_event {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_re_scn(struct rtas_event *, int);
struct rtas_usr_hdr_scn *rtas_get_usr_hdr_scn(struct rtas_event *re) {
  return (struct rtas_usr_hdr_scn *)get_re_scn(re, 12);
}


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

x86 assembly (clang, -O2):
<rtas_get_usr_hdr_scn>:
mov    $0xc,%esi
jmp    1030 <get_re_scn@plt>

LLVM IR (-O0):
%struct.rtas_usr_hdr_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_usr_hdr_scn* @rtas_get_usr_hdr_scn(%struct.rtas_event* %0) {
%2 = alloca %struct.rtas_event*
store %struct.rtas_event* %0, %struct.rtas_event** %2
%3 = load %struct.rtas_event*, %struct.rtas_event** %2
%4 = call i64 @get_re_scn(%struct.rtas_event* %3, i32 12)
%5 = inttoptr i64 %4 to %struct.rtas_usr_hdr_scn*
ret %struct.rtas_usr_hdr_scn* %5
}

LLVM IR (-O2):
%struct.rtas_usr_hdr_scn = type { i32 }
%struct.rtas_event = type { i32 }
define %struct.rtas_usr_hdr_scn* @rtas_get_usr_hdr_scn(%struct.rtas_event* %0) {
%2 = tail call i64 @get_re_scn(%struct.rtas_event* %0, i32 12)
%3 = inttoptr i64 %2 to %struct.rtas_usr_hdr_scn*
ret %struct.rtas_usr_hdr_scn* %3
}
/* Type definitions */
struct h262_picparm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct h262_picparm *);
void h262_del_picparm(struct h262_picparm *picparm) { free(picparm); }


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

x86 assembly (clang, -O2):
<h262_del_picparm>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.h262_picparm = type { i32 }
define void @h262_del_picparm(%struct.h262_picparm* nocapture %0) {
%2 = tail call i32 @free(%struct.h262_picparm* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello C\n"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
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 = [9 x i8] c"Hello C\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [8 x i8] c"Hello C\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void usage(int status) {
  fprintf(status ? stderr : stdout, "Usage: lp_test [options]\n"
                                    "\n"
                                    "Options:\n");
  exit(status);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <usage+0x26>
mov    0x2ea4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
jmp    1152 <usage+0x32>
mov    0x2e8b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xea4(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
test   %edi,%edi
jne    1130 <usage+0x10>
mov    0x2eaa(%rip),%rax
jmp    1137 <usage+0x17>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdout = global i32 0
@.str = [36 x i8] c"Usage: lp_test [options]\0A\0AOptions:\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i32, i32* @stderr
br label %9
7: ; preds = %1
%8 = load i32, i32* @stdout
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @exit(i32 %12)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@stdout = global i32 0
@.str = [36 x i8] c"Usage: lp_test [options]\0A\0AOptions:\0A\00"
define void @usage(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = load i32, i32* @stderr
%4 = load i32, i32* @stdout
%5 = select i1 %2, i32 %4, i32 %3
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 %0)
unreachable
}
void foo510(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo510(i32 %0) {
ret void
}
int main() {
  int a = 10;
  int b = 20;
  int result;
  result = a * b;
  asm("nop");
  printf("The result is %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
nop
mov    -0x10(%rbp),%esi
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"The result is %d\0A\00"
define i32 @main() {
tail call void asm sideeffect "nop", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 200)
ret i32 0
}
/* Variables and functions */
int close_fmap_ascii();
int teardown() { return close_fmap_ascii(); }


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

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

LLVM IR (-O0):
define i32 @teardown() {
%1 = call i32 (...) @close_fmap_ascii()
ret i32 %1
}

LLVM IR (-O2):
define i32 @teardown() {
%1 = tail call i32 (...) @close_fmap_ascii()
ret i32 %1
}
float _nonz_min(float oldval, float newval) {
  if (newval != 0.f && (oldval == 0.f || newval < oldval))
    return (newval);
  else
    return (oldval);
}


x86 assembly (clang, -O0):
<_nonz_min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    112a <_nonz_min+0x2a>
jp     112a <_nonz_min+0x2a>
jmp    1168 <_nonz_min+0x68>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1146 <_nonz_min+0x46>
jp     1146 <_nonz_min+0x46>
jmp    1159 <_nonz_min+0x59>
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1168 <_nonz_min+0x68>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1172 <_nonz_min+0x72>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nonz_min>:
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jne    110a <_nonz_min+0xa>
jnp    1116 <_nonz_min+0x16>
ucomiss %xmm2,%xmm0
jne    1111 <_nonz_min+0x11>
jnp    1119 <_nonz_min+0x19>
ucomiss %xmm1,%xmm0
ja     1119 <_nonz_min+0x19>
movaps %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @_nonz_min(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %5
%7 = fcmp une float %6, 0.000000e+00
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load float, float* %4
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %15, label %11
11: ; preds = %8
%12 = load float, float* %5
%13 = load float, float* %4
%14 = fcmp olt float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11, %8
%16 = load float, float* %5
store float %16, float* %3
br label %19
17: ; preds = %11, %2
%18 = load float, float* %4
store float %18, float* %3
br label %19
19: ; preds = %17, %15
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @_nonz_min(float %0, float %1) {
%3 = fcmp une float %1, 0.000000e+00
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = fcmp oeq float %0, 0.000000e+00
%6 = fcmp olt float %1, %0
%7 = or i1 %5, %6
br i1 %7, label %9, label %8
8: ; preds = %4, %2
br label %9
9: ; preds = %4, %8
%10 = phi float [ %0, %8 ], [ %1, %4 ]
ret float %10
}
int *f(int *p, int *q) {
  q = p;
  return q;
}


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

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

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

LLVM IR (-O2):
define i32* @f(i32* readnone returned %0, i32* nocapture readnone %1) {
ret i32* %0
}
int stringLength(char *string) {
  if (*string == '\0') {
    return 1;
  }
  int count = 0;
  char *counterP = string;
  while (*counterP++) {
    count++;
  }
  return count + 1;
}


x86 assembly (clang, -O0):
<stringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1124 <stringLength+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1162 <stringLength+0x62>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
cmpb   $0x0,(%rax)
je     1159 <stringLength+0x59>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <stringLength+0x33>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringLength>:
cmpb   $0x0,(%rdi)
je     111b <stringLength+0x1b>
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringLength+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @stringLength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %0, %1 ]
%6 = phi i32 [ %8, %4 ], [ 1, %1 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = add i32 %6, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
void d_storesw(unsigned char **ptr, signed short data) {
  *(*ptr)++ = ((unsigned short)data & 0xff00) >> 8;
  *(*ptr)++ = ((unsigned short)data & 0x00ff) >> 0;
}


x86 assembly (clang, -O0):
<d_storesw>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
movzwl -0xa(%rbp),%eax
and    $0xff,%eax
sar    $0x0,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_storesw>:
mov    %esi,%eax
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %ah,(%rcx)
mov    (%rdi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rdi)
mov    %al,(%rcx)
ret

LLVM IR (-O0):
define void @d_storesw(i8** %0, i16 signext %1) {
%3 = alloca i8**
%4 = alloca i16
store i8** %0, i8*** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = trunc i32 %8 to i8
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %10
store i8 %9, i8* %11
%13 = load i16, i16* %4
%14 = zext i16 %13 to i32
%15 = and i32 %14, 255
%16 = ashr i32 %15, 0
%17 = trunc i32 %16 to i8
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
store i8 %17, i8* %19
ret void
}

LLVM IR (-O2):
define void @d_storesw(i8** nocapture %0, i16 signext %1) {
%3 = lshr i16 %1, 8
%4 = trunc i16 %3 to i8
%5 = load i8*, i8** %0
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %0
store i8 %4, i8* %5
%7 = trunc i16 %1 to i8
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8* %9, i8** %0
store i8 %7, i8* %8
ret void
}
int verify_benchmark(int r) {
  int expected = 4037914;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x3d9d1a,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x3d9d1a,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @verify_benchmark(i32 %0) {
%2 = icmp eq i32 %0, 4037914
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int *QuickSortEnhancedInt(int *, int, int, char *);
int *SortInt(int *sorted, int sortedTot, int startIndices, char *indicesPath) {
  return QuickSortEnhancedInt(sorted, sortedTot, startIndices, indicesPath);
}


x86 assembly (clang, -O0):
<SortInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1030 <QuickSortEnhancedInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SortInt>:
jmp    1030 <QuickSortEnhancedInt@plt>

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

LLVM IR (-O2):
define i32* @SortInt(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32* @QuickSortEnhancedInt(i32* %0, i32 %1, i32 %2, i8* %3)
ret i32* %5
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t size = 0;
  while (string[size])
    size++;
  return size;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void PresentBuffer(void) {}


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

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

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

LLVM IR (-O2):
define void @PresentBuffer() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fact_recursive(int);
int /*<<< orphan*/ printChar(char);
int /*<<< orphan*/ printInt(int /*<<< orphan*/);
int /*<<< orphan*/ printStr(char *);
int /*<<< orphan*/ readInt(int);
int main() {
  int n;
  printStr("n? ");
  readInt(n);
  printInt(fact_recursive(n));
  printChar('\n');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rdi
call   1040 <printStr@plt>
mov    -0x4(%rbp),%edi
call   1050 <readInt@plt>
mov    -0x4(%rbp),%edi
call   1070 <fact_recursive@plt>
mov    %eax,%edi
call   1030 <printInt@plt>
mov    $0xa,%edi
call   1060 <printChar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea8(%rip),%rdi
call   1040 <printStr@plt>
call   1050 <readInt@plt>
call   1070 <fact_recursive@plt>
mov    %eax,%edi
call   1030 <printInt@plt>
mov    $0xa,%edi
call   1060 <printChar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"n? \00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printStr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
%4 = call i32 @readInt(i32 %3)
%5 = load i32, i32* %1
%6 = call i32 @fact_recursive(i32 %5)
%7 = call i32 @printInt(i32 %6)
%8 = call i32 @printChar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"n? \00"
define i32 @main() {
%1 = tail call i32 @printStr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @readInt(i32 undef)
%3 = tail call i32 @fact_recursive(i32 undef)
%4 = tail call i32 @printInt(i32 %3)
%5 = tail call i32 @printChar(i8 signext 10)
ret i32 0
}
void dec_zcache_obj_count(void) {}


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

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

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

LLVM IR (-O2):
define void @dec_zcache_obj_count() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ term_send(char);
void term_erase_to_start_of_line() {
  term_send(27);
  term_send('[');
  term_send('1');
  term_send('K');
}


x86 assembly (clang, -O0):
<term_erase_to_start_of_line>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x31,%edi
call   1030 <term_send@plt>
mov    $0x4b,%edi
call   1030 <term_send@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_erase_to_start_of_line>:
push   %rax
mov    $0x1b,%edi
call   1030 <term_send@plt>
mov    $0x5b,%edi
call   1030 <term_send@plt>
mov    $0x31,%edi
call   1030 <term_send@plt>
mov    $0x4b,%edi
pop    %rax
jmp    1030 <term_send@plt>

LLVM IR (-O0):
define void @term_erase_to_start_of_line() {
%1 = call i32 @term_send(i8 signext 27)
%2 = call i32 @term_send(i8 signext 91)
%3 = call i32 @term_send(i8 signext 49)
%4 = call i32 @term_send(i8 signext 75)
ret void
}

LLVM IR (-O2):
define void @term_erase_to_start_of_line() {
%1 = tail call i32 @term_send(i8 signext 27)
%2 = tail call i32 @term_send(i8 signext 91)
%3 = tail call i32 @term_send(i8 signext 49)
%4 = tail call i32 @term_send(i8 signext 75)
ret void
}
int bang(int x) {
  x = x | (~x + 1);
  x = x >> 31;
  return x + 1;
}


x86 assembly (clang, -O0):
<bang>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bang>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @bang(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
%6 = add nsw i32 %5, 1
%7 = or i32 %3, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = ashr i32 %8, 31
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
ret i32 %11
}

LLVM IR (-O2):
define i32 @bang(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ atmel_atmega328_PD0_clear__E();
int /*<<< orphan*/ atmel_atmega328_PD0_makeOutput__E();
void test24_Blink5_pollen__reset__E() {
  atmel_atmega328_PD0_clear__E();
  atmel_atmega328_PD0_makeOutput__E();
}


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

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

LLVM IR (-O0):
define void @test24_Blink5_pollen__reset__E() {
%1 = call i32 (...) @atmel_atmega328_PD0_clear__E()
%2 = call i32 (...) @atmel_atmega328_PD0_makeOutput__E()
ret void
}

LLVM IR (-O2):
define void @test24_Blink5_pollen__reset__E() {
%1 = tail call i32 (...) @atmel_atmega328_PD0_clear__E()
%2 = tail call i32 (...) @atmel_atmega328_PD0_makeOutput__E()
ret void
}
int parasail_sse41_dummy() { return 0; }


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

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

LLVM IR (-O0):
define i32 @parasail_sse41_dummy() {
ret i32 0
}

LLVM IR (-O2):
define i32 @parasail_sse41_dummy() {
ret i32 0
}
void print_debug_char(int c) {
  asm volatile("int $0x80" : : "a"(4), "b"(1), "c"(addr_of_char(c)), "d"(1));
}


x86 assembly (clang, -O0):
<print_debug_char>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x0,%al
call   1030 <addr_of_char@plt>
mov    %eax,%ecx
mov    $0x4,%eax
mov    $0x1,%edx
mov    %edx,%ebx
int    $0x80
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_char>:
push   %rbx
xor    %eax,%eax
call   1030 <addr_of_char@plt>
mov    %eax,%ecx
mov    $0x4,%eax
mov    $0x1,%ebx
mov    $0x1,%edx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @print_debug_char(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @addr_of_char to i32 (i32, ...)*)(i32 %3)
ret void
}

LLVM IR (-O2):
define void @print_debug_char(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @addr_of_char to i32 (i32, ...)*)(i32 %0)
tail call void asm sideeffect "int $$0x80", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 4, i32 1, i32 %2, i32 1)
ret void
}
void foo059() {}


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

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

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

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