xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ BUFSIZ;
char *get_temp_buf();
int /*<<< orphan*/ strncpy(char *, char *, int /*<<< orphan*/);
const char *finish_html_color() {
  char *buf = get_temp_buf();
  strncpy(buf, "</span>", BUFSIZ);
  return buf;
}


x86 assembly (clang, -O0):
<finish_html_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_temp_buf@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea2(%rip),%rax
mov    (%rax),%edx
lea    0xeb9(%rip),%rsi
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish_html_color>:
push   %rbx
xor    %eax,%eax
call   1040 <get_temp_buf@plt>
mov    %rax,%rbx
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"</span>\00"
@BUFSIZ = global i32 0
define i8* @finish_html_color() {
%1 = alloca i8*
%2 = call i8* (...) @get_temp_buf()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = load i32, i32* @BUFSIZ
%5 = call i32 @strncpy(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %1
ret i8* %6
}

LLVM IR (-O2):
@.str = [8 x i8] c"</span>\00"
@BUFSIZ = global i32 0
define i8* @finish_html_color() {
%1 = tail call i8* (...) @get_temp_buf()
%2 = load i32, i32* @BUFSIZ
%3 = tail call i32 @strncpy(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *, void *, void *);
void test_1(void *p, void *q, void *r) {
  foo(p, q, r);
  foo(NULL, q, r);
  foo(p, NULL, r);
  foo(p, q, NULL);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <foo@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1030 <foo@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <foo@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <foo@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %edx,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @test_1(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @foo(i8* %7, i8* %8, i8* %9)
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = call i32 @foo(i8* null, i8* %11, i8* %12)
%14 = load i8*, i8** %4
%15 = load i8*, i8** %6
%16 = call i32 @foo(i8* %14, i8* null, i8* %15)
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i32 @foo(i8* %17, i8* %18, i8* null)
ret void
}

LLVM IR (-O2):
define void @test_1(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @foo(i8* %0, i8* %1, i8* %2)
%5 = tail call i32 @foo(i8* null, i8* %1, i8* %2)
%6 = tail call i32 @foo(i8* %0, i8* null, i8* %2)
%7 = tail call i32 @foo(i8* %0, i8* %1, i8* null)
ret void
}
int sub(int a, int b) {
  int c;
  c = a - b;
  return c;
}


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

x86 assembly (clang, -O2):
<sub>:
mov    %edi,%eax
sub    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @sub(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
char const *getenv(char const *);
const char *GetEnvVar(const char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<GetEnvVar>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @GetEnvVar(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
int stdout_putchar(int ch) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @stdout_putchar(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x0f() {
  Assert_real((isgraph(15) == 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_isgraph.c",
              80, ("isgraph should be 0 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_isgraph_0x0f>:
push   %rax
mov    $0xf,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x0f\00"
define void @t_isgraph_0x0f() {
%1 = call i64 @isgraph(i32 15)
%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 80, 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_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x0f\00"
define void @t_isgraph_0x0f() {
%1 = tail call i64 @isgraph(i32 15)
%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 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int mvprintw(int, int, char const *, char *);
int s_mvprintw(int y, int x, const char *fmt, char *string) {
  return (mvprintw(y, x, fmt, string));
}


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

x86 assembly (clang, -O2):
<s_mvprintw>:
jmp    1030 <mvprintw@plt>

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

LLVM IR (-O2):
define i32 @s_mvprintw(i32 %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @mvprintw(i32 %0, i32 %1, i8* %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR7A_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMR7A_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMR7A_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ vetor;
typedef int /*<<< orphan*/ vazio;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main(void) {
  int vazio[5];
  int vetor[] = {1, 2, 3};
  printf("%d\n", sizeof(vazio) / 4);
  printf("%d\n", sizeof(vetor) / 4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x24(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
void putch(unsigned ch) {
  if (ch == '\n')
    putch('\r');
  while ((*(volatile unsigned *)0xFF000000 != 0))
    ;
  (*(volatile unsigned *)0xFF000000 = (ch));
}


x86 assembly (clang, -O0):
<putch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jne    112f <putch+0x1f>
mov    $0xd,%edi
call   1030 <putch@plt>
jmp    1134 <putch+0x24>
mov    $0xff000000,%eax
mov    (%rax),%eax
cmp    $0x0,%eax
je     1149 <putch+0x39>
jmp    1134 <putch+0x24>
mov    -0x4(%rbp),%ecx
mov    $0xff000000,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putch>:
mov    $0xff000000,%eax
cmp    $0xa,%edi
jne    1120 <putch+0x20>
nopw   0x0(%rax,%rax,1)
cmpl   $0x0,(%rax)
jne    1110 <putch+0x10>
movl   $0xd,(%rax)
nopl   0x0(%rax,%rax,1)
cmpl   $0x0,(%rax)
jne    1120 <putch+0x20>
mov    %edi,(%rax)
ret

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

LLVM IR (-O2):
define void @putch(i32 %0) {
%2 = icmp eq i32 %0, 10
br i1 %2, label %3, label %7
3: ; preds = %1, %3
%4 = load volatile i32, i32* inttoptr (i64 4278190080 to i32*)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
store volatile i32 13, i32* inttoptr (i64 4278190080 to i32*)
br label %7
7: ; preds = %6, %1
br label %8
8: ; preds = %7, %8
%9 = load volatile i32, i32* inttoptr (i64 4278190080 to i32*)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %8
11: ; preds = %8
store volatile i32 %0, i32* inttoptr (i64 4278190080 to i32*)
ret void
}
unsigned int get_IEEE_sign(double d) {
  return (*(unsigned long long *)&d & 0x8000000000000000ULL) >> 63;
}


x86 assembly (clang, -O0):
<get_IEEE_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movabs $0x8000000000000000,%rax
and    -0x8(%rbp),%rax
shr    $0x3f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_IEEE_sign>:
movmskpd %xmm0,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_IEEE_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = bitcast double* %2 to i64*
%4 = load i64, i64* %3
%5 = and i64 %4, -9223372036854775808
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_IEEE_sign(double %0) {
%2 = bitcast double %0 to i64
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ cl_uint;
typedef int /*<<< orphan*/ cl_int;
typedef int /*<<< orphan*/ cl_event;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clWaitForEvents(cl_uint num_events, const cl_event *event_list) {
  unsigned int sys_args[2];
  sys_args[0] = (unsigned int)num_events;
  sys_args[1] = (unsigned int)event_list;
  return (cl_int)syscall(325, 1043, sys_args);
}


x86 assembly (clang, -O0):
<clWaitForEvents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rdx
mov    $0x145,%edi
mov    $0x413,%esi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clWaitForEvents>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %rsp,%rdx
mov    $0x145,%edi
mov    $0x413,%esi
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @clWaitForEvents(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca [2 x i32]
store i64 %0, i64* %3
store i32* %1, i32** %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %7, i32* %8
%9 = load i32*, i32** %4
%10 = ptrtoint i32* %9 to i32
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %10, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%13 = call i32 @syscall(i32 325, i32 1043, i32* %12)
ret i32 %13
}

LLVM IR (-O2):
define i32 @clWaitForEvents(i64 %0, i32* %1) {
%3 = alloca [2 x i32]
%4 = bitcast [2 x i32]* %3 to i8*
%5 = trunc i64 %0 to i32
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %5, i32* %6
%7 = ptrtoint i32* %1 to i64
%8 = trunc i64 %7 to i32
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %8, i32* %9
%10 = call i32 @syscall(i32 325, i32 1043, i32* %6)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 == 0) {
    printf("%d\n", a);
  } else {
    printf("%d\n", a + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <main+0x47>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    1179 <main+0x59>
mov    -0x8(%rbp),%esi
add    $0x1,%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%esi
and    $0x1,%esi
add    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %14
10: ; preds = %0
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %10, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = and i32 %4, 1
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ daxpy_(int *, double *, double *, int *, double *, int *);
void daxpy(int N, double ALPHA, double *X, int INCX, double *Y, int INCY) {
  daxpy_(&N, &ALPHA, X, &INCX, Y, &INCY);
}


x86 assembly (clang, -O0):
<daxpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8d,-0x2c(%rbp)
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%r8
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rcx
lea    -0x2c(%rbp),%r9
call   1030 <daxpy_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<daxpy>:
sub    $0x18,%rsp
mov    %rcx,%r10
mov    %rsi,%rax
mov    %edi,0xc(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %edx,0x8(%rsp)
mov    %r8d,0x4(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r9
mov    %rax,%rdx
mov    %r10,%r8
call   1030 <daxpy_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @daxpy(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double*
%10 = alloca i32
%11 = alloca double*
%12 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store double* %2, double** %9
store i32 %3, i32* %10
store double* %4, double** %11
store i32 %5, i32* %12
%13 = load double*, double** %9
%14 = load double*, double** %11
%15 = call i32 @daxpy_(i32* %7, double* %8, double* %13, i32* %10, double* %14, i32* %12)
ret void
}

LLVM IR (-O2):
define void @daxpy(i32 %0, double %1, double* %2, i32 %3, double* %4, i32 %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %7
store double %1, double* %8
store i32 %3, i32* %9
store i32 %5, i32* %10
%11 = call i32 @daxpy_(i32* %7, double* %8, double* %2, i32* %9, double* %4, i32* %10)
ret void
}
void reset_mask(unsigned int *mask, int e) {
  int w;
  unsigned int m, n;
  w = e / (8 * sizeof(int) - 1);
  n = 1;
  m = ~(n << e % (8 * sizeof(int) - 1));
  if (w >= 0 && w < (((2 * (12) + 2)) / (4 * 8) + 1)) {
    mask[w] &= m;
  }
}


x86 assembly (clang, -O0):
<reset_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %rcx
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movslq -0xc(%rbp),%rax
mov    $0x1f,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x1c(%rbp),%eax
mov    %edx,%ecx
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1169 <reset_mask+0x69>
cmpl   $0x1,-0x10(%rbp)
jge    1169 <reset_mask+0x69>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
and    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_mask>:
movslq %esi,%rcx
movabs $0x842108421084211,%rdx
10 42 08
mov    %rcx,%rax
mul    %rdx
mov    %rcx,%rax
sub    %rdx,%rax
shr    %rax
add    %rdx,%rax
shr    $0x4,%rax
test   %eax,%eax
je     1128 <reset_mask+0x28>
ret
mov    %rax,%rdx
shl    $0x5,%rdx
sub    %rdx,%rax
add    %rax,%rcx
mov    $0xfffffffe,%eax
rol    %cl,%eax
and    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @reset_mask(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = udiv i64 %3, 31
%5 = urem i64 %3, 31
%6 = trunc i64 %4 to i32
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = trunc i64 %5 to i32
%10 = shl nuw nsw i32 1, %9
%11 = xor i32 %10, -1
%12 = load i32, i32* %0
%13 = and i32 %12, %11
store i32 %13, i32* %0
br label %14
14: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Build_Heap(int *, int);
int /*<<< orphan*/ Exchange(int *, int, int);
int /*<<< orphan*/ Heapify(int *, int, int);
void HeapSort(int A[], int Length) {
  int heapSize;
  Build_Heap(A, Length);
  heapSize = Length;
  while (heapSize >= 2) {
    Exchange(A, 1, heapSize);
    heapSize = heapSize - 1;
    Heapify(A, 1, heapSize);
  }
}


x86 assembly (clang, -O0):
<HeapSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <Build_Heap@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jl     118b <HeapSort+0x5b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0x1,%esi
call   1050 <Exchange@plt>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
mov    $0x1,%esi
call   1040 <Heapify@plt>
jmp    1151 <HeapSort+0x21>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HeapSort>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <Build_Heap@plt>
cmp    $0x2,%ebx
jl     1178 <HeapSort+0x48>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebx,%edx
call   1050 <Exchange@plt>
lea    -0x1(%rbx),%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
call   1040 <Heapify@plt>
cmp    $0x2,%ebx
mov    %ebp,%ebx
ja     1150 <HeapSort+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @HeapSort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %4
%8 = call i32 @Build_Heap(i32* %6, i32 %7)
%9 = load i32, i32* %4
store i32 %9, i32* %5
br label %10
10: ; preds = %13, %2
%11 = load i32, i32* %5
%12 = icmp sge i32 %11, 2
br i1 %12, label %13, label %22
13: ; preds = %10
%14 = load i32*, i32** %3
%15 = load i32, i32* %5
%16 = call i32 @Exchange(i32* %14, i32 1, i32 %15)
%17 = load i32, i32* %5
%18 = sub nsw i32 %17, 1
store i32 %18, i32* %5
%19 = load i32*, i32** %3
%20 = load i32, i32* %5
%21 = call i32 @Heapify(i32* %19, i32 1, i32 %20)
br label %10
22: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @HeapSort(i32* %0, i32 %1) {
%3 = tail call i32 @Build_Heap(i32* %0, i32 %1)
%4 = icmp sgt i32 %1, 1
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %1, %2 ]
%7 = tail call i32 @Exchange(i32* %0, i32 1, i32 %6)
%8 = add nsw i32 %6, -1
%9 = tail call i32 @Heapify(i32* %0, i32 1, i32 %8)
%10 = icmp ugt i32 %6, 2
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
int exp_minus_one(int i) {
  if (i < 0)
    i *= -1;
  return (i % 2 ? -1 : 1);
}


x86 assembly (clang, -O0):
<exp_minus_one>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1118 <exp_minus_one+0x18>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp_minus_one>:
and    $0x1,%edi
neg    %edi
sbb    %eax,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
define i32 @exp_minus_one(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, -1
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = srem i32 %9, 2
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 -1, i32 1
ret i32 %13
}

LLVM IR (-O2):
define i32 @exp_minus_one(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 1, i32 -1
ret i32 %4
}
/* Type definitions */
typedef unsigned long long uint64_t;
struct timeval {
  unsigned long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint64_t realtime_now() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return ((&tv)->tv_sec * 1000000000ULL + (&tv)->tv_usec * 1000ULL);
}


x86 assembly (clang, -O0):
<realtime_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,-0x10(%rbp),%rax
3b
imul   $0x3e8,-0x8(%rbp),%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<realtime_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3b9aca00,0x8(%rsp),%rcx
9a 3b
imul   $0x3e8,0x10(%rsp),%rax
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @realtime_now() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul i64 %4, 1000000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000
%9 = add i64 %5, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @realtime_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = mul i64 %8, 1000
%10 = add i64 %9, %6
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thread_run(void *arg) {
  printf("thread 1 is running\n");
  return (void *)1;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"thread 1 is running\0A\00"
define i8* @thread_run(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
@str = [20 x i8] c"thread 1 is running\00"
define i8* @thread_run(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int witness_set_to_system_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(47, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<witness_set_to_system_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2f,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<witness_set_to_system_container>:
mov    $0x2f,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @witness_set_to_system_container() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 47, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @witness_set_to_system_container() {
%1 = tail call i32 @_ada_use_c2phc(i32 47, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void trie_cb_freecharptr(void *buf, void *userp) {
  (void)userp;
  free(*(char **)buf);
}


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

x86 assembly (clang, -O2):
<trie_cb_freecharptr>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @trie_cb_freecharptr(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errMem();
void *malloc(size_t);
void *Malloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    errMem();
  return p;
}


x86 assembly (clang, -O0):
<Malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <Malloc+0x2b>
mov    $0x0,%al
call   1030 <errMem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <Malloc+0x15>
xor    %eax,%eax
call   1030 <errMem@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @errMem()
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void cpu_to_be32wu(uint32_t *p, uint32_t v) {
  uint8_t *p1 = (uint8_t *)p;
  p1[0] = v >> 24;
  p1[1] = v >> 16;
  p1[2] = v >> 8;
  p1[3] = v;
}


x86 assembly (clang, -O0):
<cpu_to_be32wu>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_to_be32wu>:
mov    %esi,%eax
sar    $0x18,%eax
mov    %eax,(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x8(%rdi)
mov    %esi,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @cpu_to_be32wu(i32* nocapture writeonly %0, i32 %1) {
%3 = ashr i32 %1, 24
store i32 %3, i32* %0
%4 = ashr i32 %1, 16
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = ashr i32 %1, 8
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %7
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %1, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
void insert_char(char c, int n) {
  for (int i = 0; i < n; i++)
    putchar(c);
}


x86 assembly (clang, -O0):
<insert_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <insert_char+0x3b>
movsbl -0x1(%rbp),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1128 <insert_char+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_char>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <insert_char+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <insert_char+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @insert_char(i8 signext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %13, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i8, i8* %3
%12 = call i32 @putchar(i8 signext %11)
br label %13
13: ; preds = %10
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @insert_char(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @putchar(i8 signext %0)
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
int setrlimit(int resource, const struct rlimit *rlp) {
  (void)(resource);
  (void)(rlp);
  return 0;
}


x86 assembly (clang, -O0):
<setrlimit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.rlimit = type opaque
define i32 @setrlimit(i32 %0, %struct.rlimit* nocapture readnone %1) {
ret i32 0
}
int isVowel(char c) {
  char vowel[6] = {'a', 'i', 'u', 'e', 'o', 'y'};
  int i;
  for (i = 0; i < 6; i++) {
    if (c == vowel[i])
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isVowel>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeea(%rip),%ax
mov    %ax,-0x7(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x6,-0x10(%rbp)
jge    1163 <isVowel+0x63>
movsbl -0x5(%rbp),%eax
movslq -0x10(%rbp),%rcx
movsbl -0xb(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1150 <isVowel+0x50>
movl   $0x1,-0x4(%rbp)
jmp    116a <isVowel+0x6a>
jmp    1155 <isVowel+0x55>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1125 <isVowel+0x25>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVowel>:
add    $0x9f,%dil
ror    %dil
xor    %eax,%eax
cmp    $0xc,%dil
ja     111d <isVowel+0x1d>
movsbq %dil,%rax
lea    0xee6(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.isVowel.vowel = [6 x i8] c"aiueoy"
define i32 @isVowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca [6 x i8]
%5 = alloca i32
store i8 %0, i8* %3
%6 = bitcast [6 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 6
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %12, %17
br i1 %18, label %19, label %20
19: ; preds = %10
store i32 1, i32* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@switch.table.isVowel = [13 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 1]
define i32 @isVowel(i8 signext %0) {
%2 = add i8 %0, -97
%3 = call i8 @llvm.fshl.i8(i8 %2, i8 %2, i8 7)
%4 = icmp ult i8 %3, 13
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i8 %3 to i64
%7 = getelementptr inbounds [13 x i32], [13 x i32]* @switch.table.isVowel, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %1, %5
%10 = phi i32 [ %8, %5 ], [ 0, %1 ]
ret i32 %10
}
void clr_noscan(char *str) {
  register char *ptr;
  for (ptr = str; *ptr; ptr++) {
    *ptr &= ~0200;
  }
}


x86 assembly (clang, -O0):
<clr_noscan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <clr_noscan+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
and    $0xffffff7f,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <clr_noscan+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_noscan>:
mov    (%rdi),%al
test   %al,%al
je     1120 <clr_noscan+0x20>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
and    $0x7f,%al
mov    %al,-0x1(%rdi)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <clr_noscan+0x10>
ret

LLVM IR (-O0):
define void @clr_noscan(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 = %15, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = and i32 %12, -129
%14 = trunc i32 %13 to i8
store i8 %14, i8* %10
br label %15
15: ; preds = %9
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
br label %5
18: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @clr_noscan(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = and i8 %5, 127
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
int mdc(int a, int b) {
  if (!b)
    return a;
  else
    return mdc(b, a % b);
}


x86 assembly (clang, -O0):
<mdc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <mdc+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <mdc+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <mdc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdc>:
mov    %edi,%eax
test   %esi,%esi
je     111d <mdc+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <mdc+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @mdc(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *);
void not_permitted(char *directive, char *tag, char *val) {
  char *title = "Not Permitted";
  (void)printf("<HR><H2>%s</H2>\nThe filename requested in the %s %s=%s "
               "directive\nmay not be fetched.\n<HR>\n",
               title, directive, tag, val);
}


x86 assembly (clang, -O0):
<not_permitted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<not_permitted>:
mov    %rdx,%r8
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xeee(%rip),%rdi
lea    0xed9(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Not Permitted\00"
@.str.1 = [91 x i8] c"<HR><H2>%s</H2>\0AThe filename requested in the %s %s=%s directive\0Amay not be fetched.\0A<HR>\0A\00"
define void @not_permitted(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8** %7
%8 = load i8*, i8** %7
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Not Permitted\00"
@.str.1 = [91 x i8] c"<HR><H2>%s</H2>\0AThe filename requested in the %s %s=%s directive\0Amay not be fetched.\0A<HR>\0A\00"
define void @not_permitted(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
ret void
}
void glTexParameteri(int a, int b, int c) {}


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

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

LLVM IR (-O0):
define void @glTexParameteri(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
ret void
}

LLVM IR (-O2):
define void @glTexParameteri(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void print_usage_and_exit(const char *name) {
  if (name) {
    printf("Usage: %s [OPTIONS] <app name> <username> <password>\n"
           "Options:\n"
           "    -w secs        Sleep this amount of seconds between shots\n"
           "    -d             Display debug messages\n"
           "    -s             Take one single shot and exit\n"
           "    -j             Convert frames to JPEG\n"
           "    -S             Stream as fast as possible\n",
           name);
  }
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1147 <print_usage_and_exit+0x27>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_and_exit>:
push   %rax
test   %rdi,%rdi
je     1135 <print_usage_and_exit+0x15>
mov    %rdi,%rsi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [304 x i8] c"Usage: %s [OPTIONS] <app name> <username> <password>\0AOptions:\0A -w secs Sleep this amount of seconds between shots\0A -d Display debug messages\0A -s Take one single shot and exit\0A -j Convert frames to JPEG\0A -S Stream as fast as possible\0A\00"
define void @print_usage_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([304 x i8], [304 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %8
8: ; preds = %5, %1
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [304 x i8] c"Usage: %s [OPTIONS] <app name> <username> <password>\0AOptions:\0A -w secs Sleep this amount of seconds between shots\0A -d Display debug messages\0A -s Take one single shot and exit\0A -j Convert frames to JPEG\0A -S Stream as fast as possible\0A\00"
define void @print_usage_and_exit(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([304 x i8], [304 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @exit(i32 1)
unreachable
}