xunge/DecIR huggingface dataset:
/* Variables and functions */
int write(int, char *, int);
int console_write(char *buf, int count) {
  int result;
  result = write(1, buf, count);
  return result;
}


x86 assembly (clang, -O0):
<console_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x1,%edi
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_write>:
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @console_write(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @write(i32 1, i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x1e() {
  Assert_real((isdigit(30) == 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",
              155, ("isdigit should be 0 for 0x1e"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x9b,%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 0x1e\00"
define void @t_isdigit_0x1e() {
%1 = call i64 @isdigit(i32 30)
%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 155, 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 0x1e\00"
define void @t_isdigit_0x1e() {
%1 = tail call i64 @isdigit(i32 30)
%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 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void hexdump(unsigned char *ptr, int len) {
  while (len > 0) {
    printf("%.2X ", *ptr);
    ptr++;
    len--;
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<hexdump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1158 <hexdump+0x48>
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <hexdump+0xf>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
jle    1159 <hexdump+0x39>
mov    %esi,%ebp
mov    %rdi,%rbx
add    $0x1,%ebp
lea    0xec9(%rip),%r14
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1140 <hexdump+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2X \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @hexdump(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %5
17: ; preds = %5
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2X \00"
define void @hexdump(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ %1, %2 ]
%6 = phi i8* [ %10, %4 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nsw i32 %5, -1
%12 = icmp ugt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %4, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
XWindowEvent() {}


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

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

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

LLVM IR (-O2):
define i32 @XWindowEvent() {
ret i32 undef
}
int st_strhash(string, modulus)
register char *string;
int modulus;
{
  register int val = 0;
  register int c;
  while ((c = *string++) != '\0') {
    val = val * 997 + c;
  }
  return ((val < 0) ? -val : val) % modulus;
}


x86 assembly (clang, -O0):
<st_strhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1142 <st_strhash+0x42>
imul   $0x3e5,-0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <st_strhash+0x12>
cmpl   $0x0,-0x10(%rbp)
jge    1159 <st_strhash+0x59>
xor    %eax,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    115f <st_strhash+0x5f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<st_strhash>:
mov    (%rdi),%al
test   %al,%al
je     1128 <st_strhash+0x28>
add    $0x1,%rdi
xor    %ecx,%ecx
nopl   0x0(%rax)
movsbl %al,%eax
imul   $0x3e5,%ecx,%ecx
add    %eax,%ecx
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <st_strhash+0x10>
jmp    112a <st_strhash+0x2a>
xor    %ecx,%ecx
mov    %ecx,%eax
neg    %eax
cmovs  %ecx,%eax
cltd
idiv   %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @st_strhash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i32 [ %12, %5 ], [ 0, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = mul nsw i32 %8, 997
%12 = add nsw i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
%17 = tail call i32 @llvm.abs.i32(i32 %16, i1 true)
%18 = srem i32 %17, %1
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("char is %i\n", sizeof(char));
  printf("int is %i\n", sizeof(int));
  printf("pointer is %i\n", sizeof(void *));
  printf("double is %i\n", sizeof(double));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"char is %i\0A\00"
@.str.1 = [11 x i8] c"int is %i\0A\00"
@.str.2 = [15 x i8] c"pointer is %i\0A\00"
@.str.3 = [14 x i8] c"double is %i\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"char is %i\0A\00"
@.str.1 = [11 x i8] c"int is %i\0A\00"
@.str.2 = [15 x i8] c"pointer is %i\0A\00"
@.str.3 = [14 x i8] c"double is %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SHA256(void const *, size_t, unsigned char *);
void cryp_hash(unsigned char *out, void const *in, size_t len) {
  SHA256(in, len, out);
}


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

x86 assembly (clang, -O2):
<cryp_hash>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
jmp    1030 <SHA256@plt>

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

LLVM IR (-O2):
define void @cryp_hash(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @SHA256(i8* %1, i64 %2, i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void WatchdogIntClear(uint32_t ui32Base) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x0000000C))) = 0x00000001;
}


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

x86 assembly (clang, -O2):
<WatchdogIntClear>:
movslq %edi,%rax
movl   $0x1,0xc(%rax)
ret

LLVM IR (-O0):
define void @WatchdogIntClear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 12
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 1, i32* %6
ret void
}

LLVM IR (-O2):
define void @WatchdogIntClear(i32 %0) {
%2 = add nsw i32 %0, 12
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i32*
store volatile i32 1, i32* %4
ret void
}
int colon_builtin(char *ignore) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @colon_builtin(i8* nocapture readnone %0) {
ret i32 0
}
int syscall_vga_print_str(const char *p1) {
  int a;
  __asm__ __volatile__("int $0x80" : "=a"(a) : "0"(1), "b"((int)p1));
  return a;
}


x86 assembly (clang, -O0):
<syscall_vga_print_str>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ebx
mov    $0x1,%eax
int    $0x80
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_vga_print_str>:
push   %rbx
mov    %rdi,%rbx
mov    $0x1,%eax
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define i32 @syscall_vga_print_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i32
%6 = call i32 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i32 1, i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
define i32 @syscall_vga_print_str(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 asm sideeffect "int $$0x80", "={ax},0,{bx},~{dirflag},~{fpsr},~{flags}"(i32 1, i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _bytecode_write(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                   int, int, int /*<<< orphan*/);
int /*<<< orphan*/ assert(int);
uint32_t bytecode_push(uint8_t r0, uint8_t r1) {
  assert(r1 > 0 && r1 <= 4);
  return _bytecode_write(1, 0, 0, r0, r1, 0);
}


x86 assembly (clang, -O0):
<bytecode_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1147 <bytecode_push+0x27>
cmpl   $0x4,-0x8(%rbp)
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x4(%rbp),%ecx
mov    -0x8(%rbp),%r8d
mov    $0x1,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
call   1030 <_bytecode_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bytecode_push>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    -0x1(%rbx),%eax
xor    %edi,%edi
cmp    $0x4,%eax
setb   %dil
call   1040 <assert@plt>
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %ebp,%ecx
mov    %ebx,%r8d
xor    %r9d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_bytecode_write@plt>

LLVM IR (-O0):
define i32 @bytecode_push(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 4
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ false, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @_bytecode_write(i32 1, i32 0, i32 0, i32 %14, i32 %15, i32 0)
ret i32 %16
}

LLVM IR (-O2):
define i32 @bytecode_push(i32 %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 4
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @_bytecode_write(i32 1, i32 0, i32 0, i32 %0, i32 %1, i32 0)
ret i32 %7
}
int fun474() { return 474; }


x86 assembly (clang, -O0):
<fun474>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1da,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun474() {
ret i32 474
}

LLVM IR (-O2):
define i32 @fun474() {
ret i32 474
}
unsigned long rdtsc() {
  unsigned int low;
  unsigned int high;
  asm volatile("rdtsc" : "=a"(low), "=d"(high));
  return ((unsigned long)high) << 32 | low;
}


x86 assembly (clang, -O0):
<rdtsc>:
push   %rbp
mov    %rsp,%rbp
rdtsc
mov    %eax,-0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x20,%rax
mov    -0x4(%rbp),%ecx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdtsc>:
rdtsc
shl    $0x20,%rdx
mov    %eax,%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @rdtsc() {
%1 = alloca i32
%2 = alloca i32
%3 = call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%4 = extractvalue { i32, i32 } %3, 0
%5 = extractvalue { i32, i32 } %3, 1
store i32 %4, i32* %1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = shl i64 %7, 32
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = or i64 %8, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @rdtsc() {
%1 = tail call { i32, i32 } asm sideeffect "rdtsc", "={ax},={dx},~{dirflag},~{fpsr},~{flags}"()
%2 = extractvalue { i32, i32 } %1, 0
%3 = extractvalue { i32, i32 } %1, 1
%4 = zext i32 %3 to i64
%5 = shl nuw i64 %4, 32
%6 = zext i32 %2 to i64
%7 = or i64 %5, %6
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ getuid();
uid_t Sys_Getuid(void) { return getuid(); }


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

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

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

LLVM IR (-O2):
define i32 @Sys_Getuid() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
void fsl_udc_ep_barrier(void) {}


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

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

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

LLVM IR (-O2):
define void @fsl_udc_ep_barrier() {
ret void
}
/* Variables and functions */
float M_PI;
float sin(float);
float sine(float input) { return sin(input * 2 * M_PI); }


x86 assembly (clang, -O0):
<sine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xedb(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
mov    0x2eb7(%rip),%rax
mulss  (%rax),%xmm0
call   1030 <sin@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sine>:
addss  %xmm0,%xmm0
mov    0x2ecd(%rip),%rax
mulss  (%rax),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
@M_PI = global float 0.000000e+00
define float @sine(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 2.000000e+00
%5 = load float, float* @M_PI
%6 = fmul float %4, %5
%7 = call float @sin(float %6)
ret float %7
}

LLVM IR (-O2):
@M_PI = global float 0.000000e+00
define float @sine(float %0) {
%2 = fmul float %0, 2.000000e+00
%3 = load float, float* @M_PI
%4 = fmul float %2, %3
%5 = tail call float @sin(float %4)
ret float %5
}
/* Type definitions */
struct main_args_info {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear_args(struct main_args_info *);
int /*<<< orphan*/ clear_given(struct main_args_info *);
int /*<<< orphan*/ init_args_info(struct main_args_info *);
void main_cmdline_parser_init(struct main_args_info *args_info) {
  clear_given(args_info);
  clear_args(args_info);
  init_args_info(args_info);
}


x86 assembly (clang, -O0):
<main_cmdline_parser_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <clear_given@plt>
mov    -0x8(%rbp),%rdi
call   1030 <clear_args@plt>
mov    -0x8(%rbp),%rdi
call   1050 <init_args_info@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_cmdline_parser_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <clear_given@plt>
mov    %rbx,%rdi
call   1030 <clear_args@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <init_args_info@plt>

LLVM IR (-O0):
%struct.main_args_info = type { i32 }
define void @main_cmdline_parser_init(%struct.main_args_info* %0) {
%2 = alloca %struct.main_args_info*
store %struct.main_args_info* %0, %struct.main_args_info** %2
%3 = load %struct.main_args_info*, %struct.main_args_info** %2
%4 = call i32 @clear_given(%struct.main_args_info* %3)
%5 = load %struct.main_args_info*, %struct.main_args_info** %2
%6 = call i32 @clear_args(%struct.main_args_info* %5)
%7 = load %struct.main_args_info*, %struct.main_args_info** %2
%8 = call i32 @init_args_info(%struct.main_args_info* %7)
ret void
}

LLVM IR (-O2):
%struct.main_args_info = type { i32 }
define void @main_cmdline_parser_init(%struct.main_args_info* %0) {
%2 = tail call i32 @clear_given(%struct.main_args_info* %0)
%3 = tail call i32 @clear_args(%struct.main_args_info* %0)
%4 = tail call i32 @init_args_info(%struct.main_args_info* %0)
ret void
}
void oer_c_source_h_encode_inner(struct encoder_t *encoder_p,
                                 const struct oer_c_source_h_t *src_p) {
  (void)encoder_p;
  (void)src_p;
}


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

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

LLVM IR (-O0):
%struct.encoder_t = type opaque
%struct.oer_c_source_h_t = type opaque
define void @oer_c_source_h_encode_inner(%struct.encoder_t* %0, %struct.oer_c_source_h_t* %1) {
%3 = alloca %struct.encoder_t*
%4 = alloca %struct.oer_c_source_h_t*
store %struct.encoder_t* %0, %struct.encoder_t** %3
store %struct.oer_c_source_h_t* %1, %struct.oer_c_source_h_t** %4
%5 = load %struct.encoder_t*, %struct.encoder_t** %3
%6 = load %struct.oer_c_source_h_t*, %struct.oer_c_source_h_t** %4
ret void
}

LLVM IR (-O2):
%struct.encoder_t = type opaque
%struct.oer_c_source_h_t = type opaque
define void @oer_c_source_h_encode_inner(%struct.encoder_t* nocapture %0, %struct.oer_c_source_h_t* nocapture %1) {
ret void
}
void ABGRToNV12() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToNV12() {
ret void
}
/* Variables and functions */
float expf(float const);
void glmExp3f(float out[3], const float x[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = expf(x[i]);
}


x86 assembly (clang, -O0):
<glmExp3f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x3,-0x18(%rbp)
jae    1163 <glmExp3f+0x53>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1030 <expf@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <glmExp3f+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmExp3f>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movss  (%rsi),%xmm0
call   1030 <expf@plt>
movss  %xmm0,(%r14)
movss  0x4(%rbx),%xmm0
call   1030 <expf@plt>
movss  %xmm0,0x4(%r14)
movss  0x8(%rbx),%xmm0
call   1030 <expf@plt>
movss  %xmm0,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @glmExp3f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca i64
store float* %0, float** %3
store float* %1, float** %4
store i64 0, i64* %5
br label %6
6: ; preds = %18, %2
%7 = load i64, i64* %5
%8 = icmp ult i64 %7, 3
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load float*, float** %4
%11 = load i64, i64* %5
%12 = getelementptr inbounds float, float* %10, i64 %11
%13 = load float, float* %12
%14 = call float @expf(float %13)
%15 = load float*, float** %3
%16 = load i64, i64* %5
%17 = getelementptr inbounds float, float* %15, i64 %16
store float %14, float* %17
br label %18
18: ; preds = %9
%19 = load i64, i64* %5
%20 = add i64 %19, 1
store i64 %20, i64* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @glmExp3f(float* nocapture writeonly %0, float* nocapture %1) {
%3 = load float, float* %1
%4 = tail call float @expf(float %3)
store float %4, float* %0
%5 = getelementptr inbounds float, float* %1, i64 1
%6 = load float, float* %5
%7 = tail call float @expf(float %6)
%8 = getelementptr inbounds float, float* %0, i64 1
store float %7, float* %8
%9 = getelementptr inbounds float, float* %1, i64 2
%10 = load float, float* %9
%11 = tail call float @expf(float %10)
%12 = getelementptr inbounds float, float* %0, i64 2
store float %11, float* %12
ret void
}
/* Variables and functions */
char *strrchr(char *, char);
char *basename(char *path) {
  char *s = strrchr(path, '/');
  return (s == NULL) ? path : ++s;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <basename+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1156 <basename+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %3
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ test_endswap_int();
int /*<<< orphan*/ test_endswap_int64_t();
int /*<<< orphan*/ test_endswap_short();
void test_endswap(void) {
  test_endswap_short();
  test_endswap_int();
  test_endswap_int64_t();
}


x86 assembly (clang, -O0):
<test_endswap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_endswap_short@plt>
mov    $0x0,%al
call   1030 <test_endswap_int@plt>
mov    $0x0,%al
call   1050 <test_endswap_int64_t@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_endswap>:
push   %rax
xor    %eax,%eax
call   1040 <test_endswap_short@plt>
xor    %eax,%eax
call   1030 <test_endswap_int@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_endswap_int64_t@plt>

LLVM IR (-O0):
define void @test_endswap() {
%1 = call i32 (...) @test_endswap_short()
%2 = call i32 (...) @test_endswap_int()
%3 = call i32 (...) @test_endswap_int64_t()
ret void
}

LLVM IR (-O2):
define void @test_endswap() {
%1 = tail call i32 (...) @test_endswap_short()
%2 = tail call i32 (...) @test_endswap_int()
%3 = tail call i32 (...) @test_endswap_int64_t()
ret void
}
double *herwig6_addressd_(double *arg) { return arg; }


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

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

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

LLVM IR (-O2):
define double* @herwig6_addressd_(double* readnone returned %0) {
ret double* %0
}
/* Variables and functions */
int /*<<< orphan*/ get();
int /*<<< orphan*/ put();
void main(int i) {
  get();
  if (1) {
    put();
  }
  put();
}


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

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

LLVM IR (-O0):
define void @main(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @get()
%4 = call i32 (...) @put()
%5 = call i32 (...) @put()
ret void
}

LLVM IR (-O2):
define void @main(i32 %0) {
%2 = tail call i32 (...) @get()
%3 = tail call i32 (...) @put()
%4 = tail call i32 (...) @put()
ret void
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *str_ndup(const char *src, size_t n) {
  char *r = (char *)malloc(n + 1);
  strncpy(r, src, n);
  r[n] = '\0';
  return r;
}


x86 assembly (clang, -O0):
<str_ndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_ndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
lea    0x1(%rsi),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <strncpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @str_ndup(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = add i64 %6, 1
%8 = call i64 @malloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i64, i64* %4
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
%14 = load i8*, i8** %5
%15 = load i64, i64* %4
%16 = getelementptr inbounds i8, i8* %14, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
define i8* @str_ndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
%7 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %7
ret i8* %5
}
int main() {
  while (1) {
    int c = getchar();
    switch (c) {
    case -1:
      return 0;
    case '(':
      putchar('p');
      break;
    case '-':
    case '0' ... '9':
      putchar('n');
      break;
    default:
      putchar('o');
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x3a,%eax
ja     1191 <main+0x71>
mov    -0x10(%rbp),%rax
lea    0xea7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x70,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    119d <main+0x7d>
jmp    1180 <main+0x60>
mov    $0x6e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    119d <main+0x7d>
mov    $0x6f,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    112f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
jmp    113c <main+0x1c>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x6e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    -0x30(%rax),%ecx
cmp    $0xa,%ecx
jb     1130 <main+0x10>
cmp    $0x28,%eax
je     1161 <main+0x41>
cmp    $0x2d,%eax
je     1130 <main+0x10>
cmp    $0xffffffff,%eax
je     1168 <main+0x48>
mov    $0x6f,%edi
jmp    1135 <main+0x15>
mov    $0x70,%edi
jmp    1135 <main+0x15>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %14
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = load i32, i32* %2
switch i32 %5, label %12 [
i32 -1, label %6
i32 40, label %7
i32 45, label %9
i32 48, label %10
i32 49, label %10
i32 50, label %10
i32 51, label %10
i32 52, label %10
i32 53, label %10
i32 54, label %10
i32 55, label %10
i32 56, label %10
i32 57, label %10
]
6: ; preds = %3
ret i32 0
7: ; preds = %3
%8 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 112)
br label %14
9: ; preds = %3
br label %10
10: ; preds = %3, %3, %3, %3, %3, %3, %3, %3, %3, %3, %9
%11 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 110)
br label %14
12: ; preds = %3
%13 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 111)
br label %14
14: ; preds = %12, %10, %7
br label %3
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %5, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %4 [
i32 -1, label %8
i32 40, label %5
i32 45, label %3
i32 48, label %3
i32 49, label %3
i32 50, label %3
i32 51, label %3
i32 52, label %3
i32 53, label %3
i32 54, label %3
i32 55, label %3
i32 56, label %3
i32 57, label %3
]
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
br label %5
4: ; preds = %1
br label %5
5: ; preds = %1, %3, %4
%6 = phi i32 [ 110, %3 ], [ 111, %4 ], [ 112, %1 ]
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %6)
br label %1
8: ; preds = %1
ret i32 0
}
void DES_genkey(void *out, char *str) {}


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

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

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

LLVM IR (-O2):
define void @DES_genkey(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmdline_stop();
void server_close_cmd() {
  cmdline_stop();
  return;
}


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

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

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

LLVM IR (-O2):
define void @server_close_cmd() {
%1 = tail call i32 (...) @cmdline_stop()
ret void
}
int IsPowerOfTwo(unsigned x) {
  if (x < 2)
    return 0;
  if (x & (x - 1))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<IsPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jae    111d <IsPowerOfTwo+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <IsPowerOfTwo+0x44>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     113d <IsPowerOfTwo+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    1144 <IsPowerOfTwo+0x44>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsPowerOfTwo>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     1111 <IsPowerOfTwo+0x11>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @IsPowerOfTwo(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
void g_closure_new_simple() {}


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

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

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

LLVM IR (-O2):
define void @g_closure_new_simple() {
ret void
}
/* Variables and functions */
scalar_t__ KIONIX_ACCEL_read_bytes(int, char *, int);
int /*<<< orphan*/ KIONIX_ACCEL_write_byte(int, char);
int KIONIX_ACCEL_disable_outputs(void) {
  char ctlreg_1 = 0;
  int status = 0;
  if (KIONIX_ACCEL_read_bytes(0x1B, &ctlreg_1, 1) == 0) {
    ctlreg_1 &= ~0x80;
    KIONIX_ACCEL_write_byte(0x1B, ctlreg_1);
  } else
    status = 1;
  return status;
}


x86 assembly (clang, -O0):
<KIONIX_ACCEL_disable_outputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1b,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
cmp    $0x0,%rax
jne    116f <KIONIX_ACCEL_disable_outputs+0x4f>
movsbl -0x1(%rbp),%eax
and    $0xffffff7f,%eax
mov    %al,-0x1(%rbp)
mov    $0x1b,%edi
movsbl -0x1(%rbp),%esi
call   1040 <KIONIX_ACCEL_write_byte@plt>
jmp    1176 <KIONIX_ACCEL_disable_outputs+0x56>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<KIONIX_ACCEL_disable_outputs>:
push   %rbx
sub    $0x10,%rsp
movb   $0x0,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%ebx
mov    $0x1b,%edi
mov    $0x1,%edx
call   1030 <KIONIX_ACCEL_read_bytes@plt>
test   %rax,%rax
jne    1161 <KIONIX_ACCEL_disable_outputs+0x41>
movzbl 0xf(%rsp),%esi
and    $0x7f,%esi
mov    %sil,0xf(%rsp)
mov    $0x1b,%edi
call   1040 <KIONIX_ACCEL_write_byte@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @KIONIX_ACCEL_disable_outputs() {
%1 = alloca i8
%2 = alloca i32
store i8 0, i8* %1
store i32 0, i32* %2
%3 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = load i8, i8* %1
%7 = sext i8 %6 to i32
%8 = and i32 %7, -129
%9 = trunc i32 %8 to i8
store i8 %9, i8* %1
%10 = load i8, i8* %1
%11 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %10)
br label %13
12: ; preds = %0
store i32 1, i32* %2
br label %13
13: ; preds = %12, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @KIONIX_ACCEL_disable_outputs() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i64 @KIONIX_ACCEL_read_bytes(i32 27, i8* %1, i32 1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i8, i8* %1
%6 = and i8 %5, 127
store i8 %6, i8* %1
%7 = call i32 @KIONIX_ACCEL_write_byte(i32 27, i8 signext %6)
br label %8
8: ; preds = %0, %4
%9 = phi i32 [ 0, %4 ], [ 1, %0 ]
ret i32 %9
}
int calcScore(int tab[4][4]) {
  int x, y, temp = 0;
  for (x = 0; x < 4; x++)
    for (y = 0; y < 4; y++)
      temp += tab[x][y];
  return temp;
}


x86 assembly (clang, -O0):
<calcScore>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    116e <calcScore+0x6e>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    115b <calcScore+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1127 <calcScore+0x27>
jmp    1160 <calcScore+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <calcScore+0x16>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcScore>:
movdqu (%rdi),%xmm0
movdqu 0x10(%rdi),%xmm1
movdqu 0x20(%rdi),%xmm2
paddd  %xmm0,%xmm2
movdqu 0x30(%rdi),%xmm0
paddd  %xmm1,%xmm0
paddd  %xmm2,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
ret

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

LLVM IR (-O2):
define i32 @calcScore([4 x i32]* nocapture %0) {
%2 = bitcast [4 x i32]* %0 to <16 x i32>*
%3 = load <16 x i32>, <16 x i32>* %2
%4 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void MallocDefaultOOMHandler(int size) {
  fprintf(stderr, "Malloc: Out of memory trying to allocate %d bytes\n", size);
  fflush(stderr);
  abort();
}


x86 assembly (clang, -O0):
<MallocDefaultOOMHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<MallocDefaultOOMHandler>:
push   %rbx
mov    %edi,%edx
mov    0x2ea6(%rip),%rbx
mov    (%rbx),%edi
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [51 x i8] c"Malloc: Out of memory trying to allocate %d bytes\0A\00"
define void @MallocDefaultOOMHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fflush(i32 %6)
%8 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [51 x i8] c"Malloc: Out of memory trying to allocate %d bytes\0A\00"
define void @MallocDefaultOOMHandler(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
%6 = tail call i32 (...) @abort()
unreachable
}
const char *rcsid(const char *p) {
  return rcsid(p = "@(#)$Id: compress.c 10 2006-07-10 18:22:27Z hyin $");
}


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

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

LLVM IR (-O0):
@.str = [51 x i8] c"@(#)$Id: compress.c 10 2006-07-10 18:22:27Z hyin $\00"
define i8* @rcsid(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = call i8* @rcsid(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
ret i8* %3
}

LLVM IR (-O2):
define noalias i8* @rcsid(i8* nocapture readnone %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void codeSynchronization_clearCache(long unsigned codeStart,
                                    long unsigned codeSize) {
  long unsigned codeEnd = codeStart + codeSize;
  __builtin___clear_cache((char *)codeStart, (char *)codeEnd);
}


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

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

LLVM IR (-O0):
define void @codeSynchronization_clearCache(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = add i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %3
%10 = inttoptr i64 %9 to i8*
%11 = load i64, i64* %5
%12 = inttoptr i64 %11 to i8*
ret void
}

LLVM IR (-O2):
define void @codeSynchronization_clearCache(i64 %0, i64 %1) {
%3 = add i64 %1, %0
%4 = inttoptr i64 %0 to i8*
%5 = inttoptr i64 %3 to i8*
tail call void @llvm.clear_cache(i8* %4, i8* %5)
ret void
}
/* Type definitions */
typedef int uint_fast32_t;

/* Variables and functions */
__attribute__((unused)) uint_fast32_t cop_ld_ule24(const void *buf) {
  const unsigned char *b = buf;
  return ((uint_fast32_t)b[0] << 0) | ((uint_fast32_t)b[1] << 8) |
         ((uint_fast32_t)b[2] << 16);
}


x86 assembly (clang, -O0):
<cop_ld_ule24>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cop_ld_ule24>:
movzwl (%rdi),%ecx
movzbl 0x2(%rdi),%eax
shl    $0x10,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cop_ld_ule24(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
ret i32 %13
}