xunge/DecIR huggingface dataset:
long unsigned int yystrlen(const char *yystr) {
  register const char *yys = yystr;
  while (*yys++ != '\0')
    continue;
  return yys - yystr - 1;
}


x86 assembly (clang, -O0):
<yystrlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1130 <yystrlen+0x30>
jmp    1110 <yystrlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
sub    $0x1,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @yystrlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %3
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %4 to i64
%9 = ptrtoint i8* %0 to i64
%10 = xor i64 %9, -1
%11 = add i64 %8, %10
ret i64 %11
}
/* Variables and functions */
int strcmp(void const *, void const *);
int CompareFunction1(const void *foo, const void *bar) {
  return strcmp(foo, bar);
}


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

x86 assembly (clang, -O2):
<CompareFunction1>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @CompareFunction1(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ htons(int);
void Init_Server(struct sockaddr_in *server) {
  server->sin_family = AF_INET;
  server->sin_addr.s_addr = INADDR_ANY;
  server->sin_port = htons(8888);
}


x86 assembly (clang, -O0):
<Init_Server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    0x2ead(%rip),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    $0x22b8,%edi
call   1030 <htons@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Init_Server>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x8(%rdi)
mov    0x2eb9(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rdi)
mov    $0x22b8,%edi
call   1030 <htons@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
define void @Init_Server(%struct.sockaddr_in* %0) {
%2 = alloca %struct.sockaddr_in*
store %struct.sockaddr_in* %0, %struct.sockaddr_in** %2
%3 = load i32, i32* @AF_INET
%4 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 2
store i32 %3, i32* %5
%6 = load i32, i32* @INADDR_ANY
%7 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%8 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i32 0, i32 1
%9 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %8, i32 0, i32 0
store i32 %6, i32* %9
%10 = call i32 @htons(i32 8888)
%11 = load %struct.sockaddr_in*, %struct.sockaddr_in** %2
%12 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %11, i32 0, i32 0
store i32 %10, i32* %12
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
define void @Init_Server(%struct.sockaddr_in* nocapture writeonly %0) {
%2 = load i32, i32* @AF_INET
%3 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 2
store i32 %2, i32* %3
%4 = load i32, i32* @INADDR_ANY
%5 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 1, i32 0
store i32 %4, i32* %5
%6 = tail call i32 @htons(i32 8888)
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %0, i64 0, i32 0
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
scalar_t__ COND_GE();
int /*<<< orphan*/ EA_AY_PD_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sge_8_pd(void) {
  m68ki_write_8(EA_AY_PD_8(), COND_GE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sge_8_pd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_PD_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_GE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sge_8_pd>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_PD_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_GE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sge_8_pd() {
%1 = call i32 (...) @EA_AY_PD_8()
%2 = call i64 (...) @COND_GE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sge_8_pd() {
%1 = tail call i32 (...) @EA_AY_PD_8()
%2 = tail call i64 (...) @COND_GE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printf_bytes(void *buf, size_t len) {
  for (int i = 0; i < len; i++) {
    printf("%02x ", (unsigned int)((unsigned char *)buf)[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printf_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115d <printf_bytes+0x4d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <printf_bytes+0x17>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printf_bytes>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1158 <printf_bytes+0x38>
mov    %rsi,%r12
mov    %rdi,%r14
lea    0xec6(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printf_bytes+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%02x \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printf_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %6
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
%23 = 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"%02x \00"
define void @printf_bytes(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %2
%5 = tail call i32 @putchar(i32 10)
ret void
6: ; preds = %2, %6
%7 = phi i64 [ %12, %6 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %1
br i1 %13, label %4, label %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ malloc(int);
int /*<<< orphan*/ sleep(int);
int main() {
  malloc(127 * 1024 * 1024L * 1024L * 1024L);
  sleep(5000);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <malloc@plt>
mov    $0x1388,%edi
call   1040 <sleep@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @malloc(i32 0)
%3 = call i32 @sleep(i32 5000)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @malloc(i32 0)
%2 = tail call i32 @sleep(i32 5000)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_bytes(unsigned int *, int, int /*<<< orphan*/ *,
                               int *);
void write_int(unsigned int l, FILE *file, int *count) {
  write_bytes(&l, sizeof(int), file, count);
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <write_bytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %rax
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <write_bytes@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @write_int(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
store i32 %0, i32* %4
%5 = call i32 @write_bytes(i32* %4, i32 4, i32* %1, i32* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const);
void app_debug_putchar(const char arg) { printf("%c", arg); }


x86 assembly (clang, -O0):
<app_debug_putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<app_debug_putchar>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @app_debug_putchar(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
void asm_error(int line) {
  printf("Could not parse at line %d, Exiting\n", line);
  exit(1);
}


x86 assembly (clang, -O0):
<asm_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<asm_error>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"Could not parse at line %d, Exiting\0A\00"
define void @asm_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [37 x i8] c"Could not parse at line %d, Exiting\0A\00"
define void @asm_error(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  __print_int(1);
  goto abc;
  __print_int(0);
ghi:
  __print_int(3);
  return 0;
abc:
  __print_int(2);
  goto ghi;
  __print_int(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <__print_int@plt>
jmp    1140 <main+0x30>
mov    $0x3,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret
mov    $0x2,%edi
call   1030 <__print_int@plt>
jmp    112e <main+0x1e>

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @__print_int(i32 1)
br label %5
3: ; preds = %5
%4 = call i32 @__print_int(i32 3)
ret i32 0
5: ; preds = %0
%6 = call i32 @__print_int(i32 2)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 1)
%2 = tail call i32 @__print_int(i32 2)
%3 = tail call i32 @__print_int(i32 3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ forwpage(int, int);
int /*<<< orphan*/ nextwind(int /*<<< orphan*/, int);
int prevwind(int /*<<< orphan*/, int);
int scrnextdw(int f, int n) {
  nextwind(0, 1);
  forwpage(f, n);
  return (prevwind(0, 1));
}


x86 assembly (clang, -O0):
<scrnextdw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <nextwind@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <forwpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <prevwind@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrnextdw>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <nextwind@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <forwpage@plt>
xor    %edi,%edi
mov    $0x1,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <prevwind@plt>

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

LLVM IR (-O2):
define i32 @scrnextdw(i32 %0, i32 %1) {
%3 = tail call i32 @nextwind(i32 0, i32 1)
%4 = tail call i32 @forwpage(i32 %0, i32 %1)
%5 = tail call i32 @prevwind(i32 0, i32 1)
ret i32 %5
}
void glutVideoPan(int x, int y, int width, int height) {}


x86 assembly (clang, -O0):
<glutVideoPan>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @glutVideoPan(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
ret void
}

LLVM IR (-O2):
define void @glutVideoPan(i32 %0, i32 %1, i32 %2, i32 %3) {
ret void
}
int test_imm_ABint16_reg(short val) {
  return ((val) & (0xAB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ABint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xab,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_ABint16_reg(i16 signext %0) {
%2 = and i16 %0, 171
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int add1(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  printf("add1(2) = %d%c", add1(2), 0xa);
  printf("hello"
         " "
         "world%s",
         "!!");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x2,%edi
call   1040 <add1@plt>
mov    %eax,%esi
lea    0xeb7(%rip),%rdi
mov    $0xa,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <add1@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xecf(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"add1(2) = %d%c\00"
@.str.1 = [14 x i8] c"hello world%s\00"
@.str.2 = [3 x i8] c"!!\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @add1(i32 2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6, i32 10)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"add1(2) = %d%c\00"
@.str.1 = [14 x i8] c"hello world%s\00"
@.str.2 = [3 x i8] c"!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add1(i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3, i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct ir_remote {
  int dummy;
};
struct ir_ncode {
  int dummy;
};

/* Variables and functions */
int init_send_or_sim(struct ir_remote *, struct ir_ncode *, int, int);
int init_sim(struct ir_remote *remote, struct ir_ncode *code,
             int repeat_preset) {
  return init_send_or_sim(remote, code, 1, repeat_preset);
}


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

x86 assembly (clang, -O2):
<init_sim>:
mov    %edx,%ecx
mov    $0x1,%edx
jmp    1030 <init_send_or_sim@plt>

LLVM IR (-O0):
%struct.ir_remote = type { i32 }
%struct.ir_ncode = type { i32 }
define i32 @init_sim(%struct.ir_remote* %0, %struct.ir_ncode* %1, i32 %2) {
%4 = alloca %struct.ir_remote*
%5 = alloca %struct.ir_ncode*
%6 = alloca i32
store %struct.ir_remote* %0, %struct.ir_remote** %4
store %struct.ir_ncode* %1, %struct.ir_ncode** %5
store i32 %2, i32* %6
%7 = load %struct.ir_remote*, %struct.ir_remote** %4
%8 = load %struct.ir_ncode*, %struct.ir_ncode** %5
%9 = load i32, i32* %6
%10 = call i32 @init_send_or_sim(%struct.ir_remote* %7, %struct.ir_ncode* %8, i32 1, i32 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.ir_remote = type { i32 }
%struct.ir_ncode = type { i32 }
define i32 @init_sim(%struct.ir_remote* %0, %struct.ir_ncode* %1, i32 %2) {
%4 = tail call i32 @init_send_or_sim(%struct.ir_remote* %0, %struct.ir_ncode* %1, i32 1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_palindrome(char const *, int, int);
void test7(void) {
  const char a[] = {'a', 'B', 'c', 'D', 'E', 'D', 'c', 'B', 'a'};
  test_palindrome(a, sizeof(a), 1);
  test_palindrome(a, sizeof(a), 2);
  printf("\n");
}


x86 assembly (clang, -O0):
<test7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x9(%rbp),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
lea    -0x9(%rbp),%rdi
mov    $0x9,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test7>:
push   %rbx
sub    $0x10,%rsp
movabs $0x4263444544634261,%rax
44 63 42
mov    %rax,(%rsp)
movb   $0x61,0x8(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%edx
call   1040 <test_palindrome@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x2,%edx
call   1040 <test_palindrome@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@__const.test7.a = [9 x i8] c"aBcDEDcBa"
define void @test7() {
%1 = alloca [9 x i8]
%2 = getelementptr inbounds [9 x i8], [9 x i8]* %1, i64 0, i64 0
%3 = call i32 @test_palindrome(i8* %2, i32 9, i32 1)
%4 = call i32 @test_palindrome(i8* %2, i32 9, i32 2)
%5 = call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
float sqrtf(int /*<<< orphan*/);
int /*<<< orphan*/ vec3Dot(float const *, float const *);
float vec3Length(const float *_a) { return sqrtf(vec3Dot(_a, _a)); }


x86 assembly (clang, -O0):
<vec3Length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <vec3Dot@plt>
mov    %eax,%edi
call   1040 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec3Length>:
push   %rax
mov    %rdi,%rsi
call   1030 <vec3Dot@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <sqrtf@plt>

LLVM IR (-O0):
define float @vec3Length(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = load float*, float** %2
%5 = call i32 @vec3Dot(float* %3, float* %4)
%6 = call float @sqrtf(i32 %5)
ret float %6
}

LLVM IR (-O2):
define float @vec3Length(float* %0) {
%2 = tail call i32 @vec3Dot(float* %0, float* %0)
%3 = tail call float @sqrtf(i32 %2)
ret float %3
}
/* Type definitions */
struct list_elem {
  int dummy;
};
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_begin(struct list *);
int /*<<< orphan*/ list_insert(int /*<<< orphan*/, struct list_elem *);
void list_push_front(struct list *list, struct list_elem *elem) {
  list_insert(list_begin(list), elem);
}


x86 assembly (clang, -O0):
<list_push_front>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <list_begin@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <list_insert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_push_front>:
push   %rbx
mov    %rsi,%rbx
call   1030 <list_begin@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <list_insert@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
%struct.list_elem = type { i32 }
define void @list_push_front(%struct.list* %0, %struct.list_elem* %1) {
%3 = alloca %struct.list*
%4 = alloca %struct.list_elem*
store %struct.list* %0, %struct.list** %3
store %struct.list_elem* %1, %struct.list_elem** %4
%5 = load %struct.list*, %struct.list** %3
%6 = call i32 @list_begin(%struct.list* %5)
%7 = load %struct.list_elem*, %struct.list_elem** %4
%8 = call i32 @list_insert(i32 %6, %struct.list_elem* %7)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
%struct.list_elem = type { i32 }
define void @list_push_front(%struct.list* %0, %struct.list_elem* %1) {
%3 = tail call i32 @list_begin(%struct.list* %0)
%4 = tail call i32 @list_insert(i32 %3, %struct.list_elem* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Clear();
void TCP_Purge() {
  ;
  Clear();
}


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

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

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

LLVM IR (-O2):
define void @TCP_Purge() {
%1 = tail call i32 (...) @Clear()
ret void
}
int foo(int x) { return x * 2; }


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

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}
void foo217(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo217(i32 %0) {
ret void
}
/* Variables and functions */
void *malloc(int);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
void *zalloc(int n) {
  void *p;
  p = malloc(n);
  if (p) {
    memset(p, 0, n);
  }
  return p;
}


x86 assembly (clang, -O0):
<zalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1150 <zalloc+0x30>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zalloc>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113e <zalloc+0x1e>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @zalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i32 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
void mdp4_overlay_lcdc_vsync_push(struct msm_fb_data_type *mfd,
                                  struct mdp4_overlay_pipe *pipe) {}


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

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

LLVM IR (-O0):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_overlay_lcdc_vsync_push(%struct.msm_fb_data_type* %0, %struct.mdp4_overlay_pipe* %1) {
%3 = alloca %struct.msm_fb_data_type*
%4 = alloca %struct.mdp4_overlay_pipe*
store %struct.msm_fb_data_type* %0, %struct.msm_fb_data_type** %3
store %struct.mdp4_overlay_pipe* %1, %struct.mdp4_overlay_pipe** %4
ret void
}

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.mdp4_overlay_pipe = type opaque
define void @mdp4_overlay_lcdc_vsync_push(%struct.msm_fb_data_type* nocapture %0, %struct.mdp4_overlay_pipe* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_LengthSquaredVec2_init(void) {
  _hmt_register_covercase("HMM_LengthSquaredVec2", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_LengthSquaredVec2_init>:
lea    0xee9(%rip),%rdi
lea    0xef8(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"HMM_LengthSquaredVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LengthSquaredVec2_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"HMM_LengthSquaredVec2\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_LengthSquaredVec2_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf(
      "ccalc 1.02\nCopyright (C) 2015-2017 Gregory Kikola\nLicense GPLv3+: GNU "
      "GPL version 3 or later\n<http://www.gnu.org/licenses/gpl.html>.\nThis "
      "is free software: you are free to change and redistribute it.\nThere is "
      "NO WARRANTY, to the extent permitted by law.\n\nWritten by Gregory "
      "Kikola <gkikola@gmail.com>.\n");
}


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

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

LLVM IR (-O0):
@.str = [303 x i8] c"ccalc 1.02\0ACopyright (C) 2015-2017 Gregory Kikola\0ALicense GPLv3+: GNU GPL version 3 or later\0A<http://www.gnu.org/licenses/gpl.html>.\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Gregory Kikola <gkikola@gmail.com>.\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([303 x i8], [303 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [302 x i8] c"ccalc 1.02\0ACopyright (C) 2015-2017 Gregory Kikola\0ALicense GPLv3+: GNU GPL version 3 or later\0A<http://www.gnu.org/licenses/gpl.html>.\0AThis is free software: you are free to change and redistribute it.\0AThere is NO WARRANTY, to the extent permitted by law.\0A\0AWritten by Gregory Kikola <gkikola@gmail.com>.\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([302 x i8], [302 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int age = 10;
  int height = 72;
  printf("I am %d years old.\n", age);
  printf("I am %d inches tall.\n", height);
  printf("This \a is a bell character.\n");
  printf("This is a vertical tab -->  \v <-- right there.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x48,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%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
lea    0xed8(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x48,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeec(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
@.str.2 = [29 x i8] c"This \07 is a bell character.\0A\00"
@.str.3 = [48 x i8] c"This is a vertical tab --> \0B <-- right there.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 72, i32* %2
%3 = load i32, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"I am %d years old.\0A\00"
@.str.1 = [22 x i8] c"I am %d inches tall.\0A\00"
@str = [28 x i8] c"This \07 is a bell character.\00"
@str.4 = [47 x i8] c"This is a vertical tab --> \0B <-- right there.\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 72)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_UNLCK;
int get_file_lock(int, int /*<<< orphan*/, int /*<<< orphan*/);
int release_lock(int fd) { return (get_file_lock(fd, F_SETLK, F_UNLCK)); }


x86 assembly (clang, -O0):
<release_lock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
mov    0x2eb2(%rip),%rax
mov    (%rax),%edx
call   1030 <get_file_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<release_lock>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ec0(%rip),%rax
mov    (%rax),%edx
jmp    1030 <get_file_lock@plt>

LLVM IR (-O0):
@F_SETLK = global i32 0
@F_UNLCK = global i32 0
define i32 @release_lock(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETLK
%5 = load i32, i32* @F_UNLCK
%6 = call i32 @get_file_lock(i32 %3, i32 %4, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@F_SETLK = global i32 0
@F_UNLCK = global i32 0
define i32 @release_lock(i32 %0) {
%2 = load i32, i32* @F_SETLK
%3 = load i32, i32* @F_UNLCK
%4 = tail call i32 @get_file_lock(i32 %0, i32 %2, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello from Nios II!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"Hello from Nios II!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void usage(char *argv0) {
  printf("Usage: %s <filename> <shading>\n", argv0);
  printf("filename: filename of the 3D computer model in .obj format.\n");
  printf("shading: flat, gouraud or phong.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xf07(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: %s <filename> <shading>\0A\00"
@.str.1 = [61 x i8] c"filename: filename of the 3D computer model in .obj format.\0A\00"
@.str.2 = [34 x i8] c"shading: flat, gouraud or phong.\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: %s <filename> <shading>\0A\00"
@str = [60 x i8] c"filename: filename of the 3D computer model in .obj format.\00"
@str.3 = [33 x i8] c"shading: flat, gouraud or phong.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ io_outportw(unsigned short, unsigned short);
void io_outportsw(unsigned short port, unsigned char *data, int length) {
  for (int i = 0; i < length; i++) {
    io_outportw(port, *(((unsigned short *)data) + i));
  }
}


x86 assembly (clang, -O0):
<io_outportsw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115f <io_outportsw+0x4f>
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzwl %dx,%edi
movzwl (%rax,%rcx,2),%esi
call   1030 <io_outportw@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112d <io_outportsw+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_outportsw>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1145 <io_outportsw+0x35>
mov    %rsi,%r14
mov    %edx,%r15d
xor    %ebx,%ebx
movzwl %di,%ebp
cs nopw 0x0(%rax,%rax,1)
movzwl (%r14,%rbx,2),%esi
mov    %ebp,%edi
call   1030 <io_outportw@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <io_outportsw+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @io_outportsw(i16 zeroext %0, i8* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = bitcast i8* %1 to i16*
%7 = zext i32 %2 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %14, %9 ]
%11 = getelementptr inbounds i16, i16* %6, i64 %10
%12 = load i16, i16* %11
%13 = tail call i32 @io_outportw(i16 zeroext %0, i16 zeroext %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}
unsigned short simple_object_fetch_big_16(const unsigned char *buf) {
  return ((unsigned short)buf[0] << 8) | (unsigned short)buf[1];
}


x86 assembly (clang, -O0):
<simple_object_fetch_big_16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_object_fetch_big_16>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

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

LLVM IR (-O2):
define zeroext i16 @simple_object_fetch_big_16(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_UNBLOCK;
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
scalar_t__ sigemptyset(int /*<<< orphan*/ *);
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int my_sigrelse(int sig) {
  sigset_t sigs;
  if (sigemptyset(&sigs) || sigaddset(&sigs, sig))
    return -1;
  return sigprocmask(SIG_UNBLOCK, &sigs, NULL);
}


x86 assembly (clang, -O0):
<my_sigrelse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <sigemptyset@plt>
cmp    $0x0,%rax
jne    1164 <my_sigrelse+0x34>
mov    -0x8(%rbp),%esi
lea    -0xc(%rbp),%rdi
call   1050 <sigaddset@plt>
cmp    $0x0,%rax
je     1170 <my_sigrelse+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1189 <my_sigrelse+0x59>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_sigrelse>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
lea    0x4(%rsp),%rdi
call   1040 <sigemptyset@plt>
mov    $0xffffffff,%ebx
test   %rax,%rax
jne    1171 <my_sigrelse+0x41>
lea    0x4(%rsp),%rdi
mov    %ebp,%esi
call   1050 <sigaddset@plt>
test   %rax,%rax
jne    1171 <my_sigrelse+0x41>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@SIG_UNBLOCK = global i32 0
define i32 @my_sigrelse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i64 @sigemptyset(i32* %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i64 @sigaddset(i32* %4, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7, %1
store i32 -1, i32* %2
br label %15
12: ; preds = %7
%13 = load i32, i32* @SIG_UNBLOCK
%14 = call i32 @sigprocmask(i32 %13, i32* %4, i32* null)
store i32 %14, i32* %2
br label %15
15: ; preds = %12, %11
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@SIG_UNBLOCK = global i32 0
define i32 @my_sigrelse(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @sigemptyset(i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = call i64 @sigaddset(i32* %2, i32 %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* @SIG_UNBLOCK
%11 = call i32 @sigprocmask(i32 %10, i32* %2, i32* null)
br label %12
12: ; preds = %1, %6, %9
%13 = phi i32 [ %11, %9 ], [ -1, %6 ], [ -1, %1 ]
ret i32 %13
}
int main(int argc, char *argv[]) {
  volatile int arr[1000];
  return main(arr[argc % 2], 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xfb0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0xfb0(%rbp,%rax,4),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <main@plt>
add    $0xfb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xf28,%rsp
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
shr    $0x1f,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
movslq %edi,%rax
mov    -0x80(%rsp,%rax,4),%edi
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1000 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = srem i32 %7, 2
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [1000 x i32], [1000 x i32]* %6, i64 0, i64 %9
%11 = load volatile i32, i32* %10
%12 = call i32 @main(i32 %11, i8** null)
ret i32 %12
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1000 x i32]
%4 = bitcast [1000 x i32]* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %0, %2 ], [ %10, %5 ]
%7 = srem i32 %6, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %8
%10 = load volatile i32, i32* %9
br label %5
}