xunge/DecIR huggingface dataset:
/* Variables and functions */
int dup_untraced(int);
int /*<<< orphan*/ trace_dup(int, int);
int dup(int oldfd) {
  ;
  int rc = dup_untraced(oldfd);
  if (rc >= 0) {
    trace_dup(oldfd, rc);
  }
  return rc;
}


x86 assembly (clang, -O0):
<dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <dup_untraced@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114b <dup+0x2b>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <trace_dup@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1030 <dup_untraced@plt>
mov    %eax,%ebx
test   %eax,%eax
js     1139 <dup+0x19>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <trace_dup@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @dup(i32 %0) {
%2 = tail call i32 @dup_untraced(i32 %0)
%3 = icmp sgt i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @trace_dup(i32 %0, i32 %2)
br label %6
6: ; preds = %4, %1
ret i32 %2
}
void pcp_def_net_eip_metrics(void) {}


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

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

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

LLVM IR (-O2):
define void @pcp_def_net_eip_metrics() {
ret void
}
/* Variables and functions */
int RAND_MAX;
int rand();
double rand_norm(void) {
  return 2.0 * (double)(rand() - RAND_MAX / 2) / (double)RAND_MAX;
}


x86 assembly (clang, -O0):
<rand_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ebf(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeba(%rip),%xmm0
mulsd  %xmm1,%xmm0
mov    0x2e97(%rip),%rax
cvtsi2sdl (%rax),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_norm>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
mov    0x2ec9(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
add    %ecx,%edx
sar    %edx
sub    %edx,%eax
cvtsi2sd %eax,%xmm0
addsd  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@RAND_MAX = global i32 0
define double @rand_norm() {
%1 = call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, 2
%4 = sub nsw i32 %1, %3
%5 = sitofp i32 %4 to double
%6 = fmul double 2.000000e+00, %5
%7 = load i32, i32* @RAND_MAX
%8 = sitofp i32 %7 to double
%9 = fdiv double %6, %8
ret double %9
}

LLVM IR (-O2):
@RAND_MAX = global i32 0
define double @rand_norm() {
%1 = tail call i32 (...) @rand()
%2 = load i32, i32* @RAND_MAX
%3 = sdiv i32 %2, -2
%4 = add i32 %3, %1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 2.000000e+00
%7 = sitofp i32 %2 to double
%8 = fdiv double %6, %7
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: luac [-dlpv] [-o output] file ...\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"usage: luac [-dlpv] [-o output] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"usage: luac [-dlpv] [-o output] file ...\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ unsetenv(char const *);
void env_remove(const char name[]) { unsetenv(name); }


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

x86 assembly (clang, -O2):
<env_remove>:
jmp    1030 <unsetenv@plt>

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

LLVM IR (-O2):
define void @env_remove(i8* nocapture %0) {
%2 = tail call i32 @unsetenv(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ farey(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("digite o número de sequencia: \n");
  scanf("%d", &n);
  farey(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <farey@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <farey@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"digite o n\C3\BAmero de sequencia: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @farey(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [32 x i8] c"digite o n\C3\BAmero de sequencia: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @farey(i32 %5)
ret i32 0
}
int test_06(const char *s1) { return __builtin_strncmp(s1, "abcdabcd", 8); }


x86 assembly (clang, -O0):
<test_06>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
mov    $0x8,%edx
call   1030 <strncmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_06>:
lea    0xee9(%rip),%rsi
mov    $0x8,%edx
jmp    1030 <strncmp@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"abcdabcd\00"
define i32 @test_06(i8* nocapture %0) {
%2 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 8)
ret i32 %2
}
int test_imm_1Eint32_mem(int *val) {
  return ((*val) & (0x1E << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Eint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x1e,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_1Eint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 30
%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_1Eint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 30
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void test_foo(void) { assert(0); }


x86 assembly (clang, -O0):
<test_foo>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_foo>:
xor    %edi,%edi
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @test_foo() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @test_foo() {
%1 = tail call i32 @assert(i32 0)
ret void
}
unsigned long hash_str_djb2(unsigned char const *str) {
  unsigned long hash = 5381;
  int c;
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<hash_str_djb2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <hash_str_djb2+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <hash_str_djb2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_str_djb2>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <hash_str_djb2+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_str_djb2+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @hash_str_djb2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ a1(int);
int main(void) {
  int i;
  for (i = 0; i < 10; i++)
    a1(400);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1148 <main+0x38>
mov    $0x190,%edi
call   1030 <a1@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @a1(i32 400)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @a1(i32 400)
%2 = tail call i32 @a1(i32 400)
%3 = tail call i32 @a1(i32 400)
%4 = tail call i32 @a1(i32 400)
%5 = tail call i32 @a1(i32 400)
%6 = tail call i32 @a1(i32 400)
%7 = tail call i32 @a1(i32 400)
%8 = tail call i32 @a1(i32 400)
%9 = tail call i32 @a1(i32 400)
%10 = tail call i32 @a1(i32 400)
ret i32 0
}
/* Type definitions */
struct inotify_event {
  scalar_t__ len;
  int /*<<< orphan*/ name;
};

/* Variables and functions */
int /*<<< orphan*/ puts(int /*<<< orphan*/);
void dirnotify_printname(const struct inotify_event *event) {
  if (event->len > 0) {
    puts(event->name);
  }
}


x86 assembly (clang, -O0):
<dirnotify_printname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jle    1136 <dirnotify_printname+0x26>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dirnotify_printname>:
cmpq   $0x0,(%rdi)
jle    111e <dirnotify_printname+0xe>
mov    0x8(%rdi),%edi
jmp    1030 <puts@plt>
ret

LLVM IR (-O0):
%struct.inotify_event = type { i64, i32 }
define void @dirnotify_printname(%struct.inotify_event* %0) {
%2 = alloca %struct.inotify_event*
store %struct.inotify_event* %0, %struct.inotify_event** %2
%3 = load %struct.inotify_event*, %struct.inotify_event** %2
%4 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %3, i32 0, i32 0
%5 = load i64, i64* %4
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load %struct.inotify_event*, %struct.inotify_event** %2
%9 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %8, i32 0, i32 1
%10 = load i32, i32* %9
%11 = call i32 @puts(i32 %10)
br label %12
12: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
%struct.inotify_event = type { i64, i32 }
define void @dirnotify_printname(%struct.inotify_event* nocapture %0) {
%2 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %0, i64 0, i32 0
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = getelementptr inbounds %struct.inotify_event, %struct.inotify_event* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = tail call i32 @puts(i32 %7)
br label %9
9: ; preds = %5, %1
ret void
}
int zynq_pm_late_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @zynq_pm_late_init() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void Error(char *x) {
  endwin();
  printf("%s\n", x);
  exit(1);
}


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

x86 assembly (clang, -O2):
<Error>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <endwin@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @Error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @endwin()
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @Error(i8* %0) {
%2 = tail call i32 (...) @endwin()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ close_packet();
int /*<<< orphan*/ decode_packet();
scalar_t__ open_packet();
void decode(void) {
  while (1) {
    if (open_packet())
      break;
    decode_packet();
    close_packet();
  }
  {};
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
jmp    1139 <decode+0x9>
mov    $0x0,%al
call   1030 <open_packet@plt>
cmp    $0x0,%rax
je     114f <decode+0x1f>
jmp    1162 <decode+0x32>
mov    $0x0,%al
call   1050 <decode_packet@plt>
mov    $0x0,%al
call   1040 <close_packet@plt>
jmp    1139 <decode+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <open_packet@plt>
test   %rax,%rax
jne    115c <decode+0x2c>
xor    %eax,%eax
call   1050 <decode_packet@plt>
xor    %eax,%eax
call   1040 <close_packet@plt>
jmp    1140 <decode+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @decode() {
br label %1
1: ; preds = %0, %5
%2 = call i64 (...) @open_packet()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %8
5: ; preds = %1
%6 = call i32 (...) @decode_packet()
%7 = call i32 (...) @close_packet()
br label %1
8: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @decode() {
%1 = tail call i64 (...) @open_packet()
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = tail call i32 (...) @decode_packet()
%5 = tail call i32 (...) @close_packet()
%6 = tail call i64 (...) @open_packet()
%7 = icmp eq i64 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3, %0
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
pid_t octave_fork_wrapper(void) { return -1; }


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

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

LLVM IR (-O0):
define i32 @octave_fork_wrapper() {
ret i32 -1
}

LLVM IR (-O2):
define i32 @octave_fork_wrapper() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("hello from rpi-docker-hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [28 x i8] c"hello from rpi-docker-hello\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/, int /*<<< orphan*/);
int silc_net_accept_connection(int sock) { return accept(sock, 0, 0); }


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

x86 assembly (clang, -O2):
<silc_net_accept_connection>:
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <accept@plt>

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

LLVM IR (-O2):
define i32 @silc_net_accept_connection(i32 %0) {
%2 = tail call i32 @accept(i32 %0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ GenTermSignatureDefault(double *, int, double);
void GenTermSignature(double *termsig, int col, double nval) {
  GenTermSignatureDefault(termsig, col, nval);
}


x86 assembly (clang, -O0):
<GenTermSignature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <GenTermSignatureDefault@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenTermSignature>:
jmp    1030 <GenTermSignatureDefault@plt>

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

LLVM IR (-O2):
define void @GenTermSignature(double* %0, i32 %1, double %2) {
%4 = tail call i32 @GenTermSignatureDefault(double* %0, i32 %1, double %2)
ret void
}
int validate_class_input(int input) {
  switch (input) {
  case '1':
    return 0;
  case '2':
    return 1;
  case '3':
    return 2;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<validate_class_input>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x31,%eax
je     113d <validate_class_input+0x3d>
jmp    111b <validate_class_input+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x32,%eax
je     1149 <validate_class_input+0x49>
jmp    112c <validate_class_input+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x33,%eax
je     1155 <validate_class_input+0x55>
jmp    1161 <validate_class_input+0x61>
movl   $0x0,-0x4(%rbp)
jmp    1168 <validate_class_input+0x68>
movl   $0x1,-0x4(%rbp)
jmp    1168 <validate_class_input+0x68>
movl   $0x2,-0x4(%rbp)
jmp    1168 <validate_class_input+0x68>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_class_input>:
lea    -0x31(%rdi),%ecx
cmp    $0x3,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @validate_class_input(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 49, label %5
i32 50, label %6
i32 51, label %7
]
5: ; preds = %1
store i32 0, i32* %2
br label %9
6: ; preds = %1
store i32 1, i32* %2
br label %9
7: ; preds = %1
store i32 2, i32* %2
br label %9
8: ; preds = %1
store i32 -1, i32* %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @validate_class_input(i32 %0) {
%2 = add i32 %0, -49
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 %2, i32 -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_List_basics();
int /*<<< orphan*/ test_List_erase();
int /*<<< orphan*/ test_List_insert();
void test_List(void) {
  test_List_basics();
  test_List_insert();
  test_List_erase();
}


x86 assembly (clang, -O0):
<test_List>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_List_basics@plt>
mov    $0x0,%al
call   1030 <test_List_insert@plt>
mov    $0x0,%al
call   1050 <test_List_erase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_List>:
push   %rax
xor    %eax,%eax
call   1040 <test_List_basics@plt>
xor    %eax,%eax
call   1030 <test_List_insert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_List_erase@plt>

LLVM IR (-O0):
define void @test_List() {
%1 = call i32 (...) @test_List_basics()
%2 = call i32 (...) @test_List_insert()
%3 = call i32 (...) @test_List_erase()
ret void
}

LLVM IR (-O2):
define void @test_List() {
%1 = tail call i32 (...) @test_List_basics()
%2 = tail call i32 (...) @test_List_insert()
%3 = tail call i32 (...) @test_List_erase()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr,
          "Usage: %s [-s {seed}] [-m mean] [-t std dev] {num samples}\n",
          argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s [-s {seed}] [-m mean] [-t std dev] {num samples}\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Usage: %s [-s {seed}] [-m mean] [-t std dev] {num samples}\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ free(double *);
void free_dvector(double *m, int minx) { free(m + minx); }


x86 assembly (clang, -O0):
<free_dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_dvector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_dvector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = call i32 @free(double* %8)
ret void
}

LLVM IR (-O2):
define void @free_dvector(double* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = tail call i32 @free(double* %4)
ret void
}
int main(void) { ((1) < (2) ? (1) : (2)); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *strchr(char *, char);
char *remove_comments(char *line) {
  char *comment;
  comment = strchr(line, '#');
  if (comment) {
    *comment = '\0';
  }
  return line;
}


x86 assembly (clang, -O0):
<remove_comments>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x23,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1140 <remove_comments+0x30>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_comments>:
push   %rbx
mov    %rdi,%rbx
mov    $0x23,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1126 <remove_comments+0x16>
movb   $0x0,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @remove_comments(i8* returned %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 35)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret i8* %0
}
unsigned int swapl(unsigned int n) {
  return ((n & 0xff) << 24) | ((n & 0xff00) << 8) | ((n & 0xff0000) >> 8) |
         ((n & 0xff000000u) >> 24);
}


x86 assembly (clang, -O0):
<swapl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @swapl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = lshr i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @swapl(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
/* Type definitions */
struct vec2 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec2_negative(float *, float *);
__attribute__((always_)) struct vec2 *psvec2_negative(struct vec2 *result,
                                                      struct vec2 *a) {
  vec2_negative((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec2_negative>:
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 <vec2_negative@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec2_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec2_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_negative(%struct.vec2* %0, %struct.vec2* %1) {
%3 = alloca %struct.vec2*
%4 = alloca %struct.vec2*
store %struct.vec2* %0, %struct.vec2** %3
store %struct.vec2* %1, %struct.vec2** %4
%5 = load %struct.vec2*, %struct.vec2** %3
%6 = bitcast %struct.vec2* %5 to float*
%7 = load %struct.vec2*, %struct.vec2** %4
%8 = bitcast %struct.vec2* %7 to float*
%9 = call i32 @vec2_negative(float* %6, float* %8)
%10 = load %struct.vec2*, %struct.vec2** %3
ret %struct.vec2* %10
}

LLVM IR (-O2):
%struct.vec2 = type { i32 }
define %struct.vec2* @psvec2_negative(%struct.vec2* returned %0, %struct.vec2* %1) {
%3 = bitcast %struct.vec2* %0 to float*
%4 = bitcast %struct.vec2* %1 to float*
%5 = tail call i32 @vec2_negative(float* %3, float* %4)
ret %struct.vec2* %0
}
int do_XML(char *XML_name) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @do_XML(i8* nocapture readnone %0) {
ret i32 0
}
double fabsd(double x) { return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<fabsd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    113d <fabsd+0x3d>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1147 <fabsd+0x47>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabsd>:
movapd 0xef8(%rip),%xmm2
xorpd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fabsd(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load double, double* %2
%7 = fneg double %6
br label %10
8: ; preds = %1
%9 = load double, double* %2
br label %10
10: ; preds = %8, %5
%11 = phi double [ %7, %5 ], [ %9, %8 ]
ret double %11
}

LLVM IR (-O2):
define double @fabsd(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
ret double %4
}
int main2() {
  int *arr1 = (int *)0x02000000;
  *(arr1 + 2) = 0;
  for (int i = 0; i < 10; i++) {
    *(arr1 + 2) += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2000000,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,0x8(%rax)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1144 <main2+0x44>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <main2+0x1f>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main2>:
movl   $0xa,0x2000008
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main2() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 33554432 to i32*), i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 2
store i32 0, i32* %4
store i32 0, i32* %2
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
store i32 %12, i32* %10
br label %13
13: ; preds = %8
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main2() {
store i32 10, i32* inttoptr (i64 33554440 to i32*)
ret i32 0
}
void avpriv_io_move() {}


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

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

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

LLVM IR (-O2):
define void @avpriv_io_move() {
ret void
}
/* Variables and functions */
scalar_t__ is_mark(char);
scalar_t__ isalnum(char);
int is_unreserved(char in) {
  if (isalnum(in) || (is_mark(in)))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<is_unreserved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
jne    1154 <is_unreserved+0x34>
movsbl -0x5(%rbp),%edi
call   1040 <is_mark@plt>
cmp    $0x0,%rax
je     1160 <is_unreserved+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1167 <is_unreserved+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_unreserved>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_unreserved+0x17>
pop    %rbx
ret
movsbl %bl,%edi
call   1040 <is_mark@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_unreserved(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i64 @isalnum(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = call i64 @is_mark(i8 signext %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 %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_unreserved(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_mark(i8 signext %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
double trio_pinf();
double trio_ninf(void) {
  static double result = 0.0;
  if (result == 0.0) {
    result = -trio_pinf();
  }
  return result;
}


x86 assembly (clang, -O0):
<trio_ninf>:
push   %rbp
mov    %rsp,%rbp
movsd  0x2f14(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1155 <trio_ninf+0x45>
jp     1155 <trio_ninf+0x45>
mov    $0x0,%al
call   1030 <trio_pinf@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,0x2edb(%rip)
movsd  0x2ed3(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_ninf>:
push   %rax
movsd  0x2f17(%rip),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    113c <trio_ninf+0x2c>
jp     113c <trio_ninf+0x2c>
xor    %eax,%eax
call   1030 <trio_pinf@plt>
xorpd  0xecc(%rip),%xmm0
movlpd %xmm0,0x2ef4(%rip)
pop    %rax
ret

LLVM IR (-O0):
@trio_ninf.result = internal global double 0.000000e+00
define double @trio_ninf() {
%1 = load double, double* @trio_ninf.result
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call double (...) @trio_pinf()
%5 = fneg double %4
store double %5, double* @trio_ninf.result
br label %6
6: ; preds = %3, %0
%7 = load double, double* @trio_ninf.result
ret double %7
}

LLVM IR (-O2):
@trio_ninf.result = internal unnamed_addr global double 0.000000e+00
define double @trio_ninf() {
%1 = load double, double* @trio_ninf.result
%2 = fcmp oeq double %1, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call double (...) @trio_pinf()
%5 = fneg double %4
store double %5, double* @trio_ninf.result
br label %6
6: ; preds = %3, %0
%7 = phi double [ %5, %3 ], [ %1, %0 ]
ret double %7
}
int test_imm_51int16_mem(short *val) {
  return ((*val) & (0x51 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_51int16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
and    $0x51,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_51int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 81
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
void display_version(void) {
  printf("mkpasswd %s\n\n", "5.2.13");
  puts("Copyright (C) 2001-2018 Marco d'Itri\n"
       "This is free software; see the source for copying conditions.  There "
       "is NO\n"
       "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR "
       "PURPOSE.");
}


x86 assembly (clang, -O0):
<display_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedc(%rip),%rsi
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_version>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"mkpasswd %s\0A\0A\00"
@.str.1 = [7 x i8] c"5.2.13\00"
@.str.2 = [188 x i8] c"Copyright (C) 2001-2018 Marco d'Itri\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @display_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([188 x i8], [188 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"mkpasswd %s\0A\0A\00"
@.str.1 = [7 x i8] c"5.2.13\00"
@.str.2 = [188 x i8] c"Copyright (C) 2001-2018 Marco d'Itri\0AThis is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\00"
define void @display_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([188 x i8], [188 x i8]* @.str.2, i64 0, i64 0))
ret void
}
unsigned xrop3_4_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D | T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_4_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_4_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = or i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = xor i32 %25, -1
store i32 %26, i32* %9
%27 = load i32, i32* %6
%28 = load i32, i32* %9
%29 = and i32 %27, %28
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %7
%35 = xor i32 %34, -1
%36 = and i32 %33, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %6
%39 = and i32 %37, %38
%40 = or i32 %36, %39
%41 = load i32, i32* %5
%42 = load i32, i32* %7
%43 = and i32 %41, %42
%44 = or i32 %40, %43
ret i32 %44
}

LLVM IR (-O2):
define i32 @xrop3_4_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
void _help(FILE *fp, const char *prog) {
  fprintf(fp, "Usage : %s <table size> <num_entries>\n", prog);
}


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

x86 assembly (clang, -O2):
<_help>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [39 x i8] c"Usage : %s <table size> <num_entries>\0A\00"
define void @_help(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = load i8*, i8** %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [39 x i8] c"Usage : %s <table size> <num_entries>\0A\00"
define void @_help(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
char *hello();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[argc]) {
  printf("%s, world.\n", hello());
  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    $0x0,%al
call   1040 <hello@plt>
mov    %rax,%rsi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"%s, world.\0A\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 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = call i8* (...) @hello()
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s, world.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* (...) @hello()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ add_scroll_1_msg_idx(long);
int /*<<< orphan*/ print_log_back_1();
void scroll_1_msg(long add) {
  add_scroll_1_msg_idx(add);
  print_log_back_1();
}


x86 assembly (clang, -O0):
<scroll_1_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <add_scroll_1_msg_idx@plt>
mov    $0x0,%al
call   1030 <print_log_back_1@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @scroll_1_msg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @add_scroll_1_msg_idx(i64 %3)
%5 = call i32 (...) @print_log_back_1()
ret void
}

LLVM IR (-O2):
define void @scroll_1_msg(i64 %0) {
%2 = tail call i32 @add_scroll_1_msg_idx(i64 %0)
%3 = tail call i32 (...) @print_log_back_1()
ret void
}
void RTAvlrGCPtrGetBestFit(void) {}


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

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

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

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