xunge/DecIR huggingface dataset:
int ascii_to_integer(char *string) {
  int nr = 0;
  while (*string >= '0' && *string <= '9') {
    nr *= 10;
    nr += *string - '0';
    string++;
  }
  return nr;
}


x86 assembly (clang, -O0):
<ascii_to_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0xd(%rbp)
jl     1134 <ascii_to_integer+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <ascii_to_integer+0x44>
jmp    116c <ascii_to_integer+0x6c>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <ascii_to_integer+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_to_integer>:
mov    (%rdi),%cl
lea    -0x30(%rcx),%edx
xor    %eax,%eax
cmp    $0x9,%dl
ja     113b <ascii_to_integer+0x3b>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
lea    -0x30(%rcx),%edx
add    $0x1,%rdi
cmp    $0xa,%dl
jb     1120 <ascii_to_integer+0x20>
ret

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

LLVM IR (-O2):
define i32 @ascii_to_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %12, %5 ], [ 0, %1 ]
%8 = phi i8* [ %13, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = mul nsw i32 %7, 10
%11 = add i32 %10, -48
%12 = add i32 %11, %9
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %13
%15 = add i8 %14, -48
%16 = icmp ult i8 %15, 10
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %12, %5 ]
ret i32 %18
}
/* Variables and functions */
char *malloc(int);
char *c() { return malloc(12); }


x86 assembly (clang, -O0):
<c>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
call   1030 <malloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c>:
mov    $0xc,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @c() {
%1 = call i8* @malloc(i32 12)
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @c() {
%1 = tail call dereferenceable_or_null(12) i8* @malloc(i32 12)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ yy_scan_string(char *);
void parser_setup_string(char *str) { yy_scan_string(str); }


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

x86 assembly (clang, -O2):
<parser_setup_string>:
jmp    1030 <yy_scan_string@plt>

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

LLVM IR (-O2):
define void @parser_setup_string(i8* %0) {
%2 = tail call i32 @yy_scan_string(i8* %0)
ret void
}
int arch_register_index(char *reg_name) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @arch_register_index(i8* nocapture readnone %0) {
ret i32 -1
}
void lowercase(char *text) {
  char *p = text;
  while (*p) {
    if (*p >= 'A' && *p <= 'Z')
      *p += 'a' - 'A';
    p++;
  }
}


x86 assembly (clang, -O0):
<lowercase>:
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     115a <lowercase+0x5a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <lowercase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <lowercase+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <lowercase+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
mov    (%rdi),%al
test   %al,%al
je     112a <lowercase+0x2a>
add    $0x1,%rdi
jmp    111b <lowercase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <lowercase+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <lowercase+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <lowercase+0x10>
ret

LLVM IR (-O0):
define void @lowercase(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 = %25, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %28
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %25
14: ; preds = %9
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = add nsw i32 %22, 32
%24 = trunc i32 %23 to i8
store i8 %24, i8* %20
br label %25
25: ; preds = %19, %14, %9
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %5
28: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @lowercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Ýòî òåêñò íà ðóññêîì ÿçûêå äëÿ òåñòèðîâàíèÿ äåêîìïèëÿòîðà Reko");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [113 x i8] c"\C3\9D\C3\B2\C3\AE \C3\B2\C3\A5\C3\AA\C3\B1\C3\B2 \C3\AD\C3\A0 \C3\B0\C3\B3\C3\B1\C3\B1\C3\AA\C3\AE\C3\AC \C3\BF\C3\A7\C3\BB\C3\AA\C3\A5 \C3\A4\C3\AB\C3\BF \C3\B2\C3\A5\C3\B1\C3\B2\C3\A8\C3\B0\C3\AE\C3\A2\C3\A0\C3\AD\C3\A8\C3\BF \C3\A4\C3\A5\C3\AA\C3\AE\C3\AC\C3\AF\C3\A8\C3\AB\C3\BF\C3\B2\C3\AE\C3\B0\C3\A0 Reko\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [113 x i8] c"\C3\9D\C3\B2\C3\AE \C3\B2\C3\A5\C3\AA\C3\B1\C3\B2 \C3\AD\C3\A0 \C3\B0\C3\B3\C3\B1\C3\B1\C3\AA\C3\AE\C3\AC \C3\BF\C3\A7\C3\BB\C3\AA\C3\A5 \C3\A4\C3\AB\C3\BF \C3\B2\C3\A5\C3\B1\C3\B2\C3\A8\C3\B0\C3\AE\C3\A2\C3\A0\C3\AD\C3\A8\C3\BF \C3\A4\C3\A5\C3\AA\C3\AE\C3\AC\C3\AF\C3\A8\C3\AB\C3\BF\C3\B2\C3\AE\C3\B0\C3\A0 Reko\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([113 x i8], [113 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int fork();
int /*<<< orphan*/ printf(char *, int);
int main() { printf("%d", fork()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = call i32 (...) @fork()
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @fork()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal(int, int, char *, int);
int /*<<< orphan*/ assert_str(char *, char *, char *, int);
void __ctest_foo_bar_run(void) {
  assert_str("foo", "foo",
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/master/test/"
             "data_seg.c",
             4);
  assert_equal(1, 2,
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/"
               "master/test/data_seg.c",
               5);
}


x86 assembly (clang, -O0):
<__ctest_foo_bar_run>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rsi
lea    0xed2(%rip),%rdx
mov    $0x4,%ecx
mov    %rsi,%rdi
call   1030 <assert_str@plt>
mov    $0x1,%edi
mov    $0x2,%esi
lea    0xeb4(%rip),%rdx
mov    $0x5,%ecx
call   1040 <assert_equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ctest_foo_bar_run>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rbx
mov    %rdi,%rsi
mov    %rbx,%rdx
mov    $0x4,%ecx
call   1030 <assert_str@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    %rbx,%rdx
mov    $0x5,%ecx
pop    %rbx
jmp    1040 <assert_equal@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"foo\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/master/test/data_seg.c\00"
define void @__ctest_foo_bar_run() {
%1 = call i32 @assert_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = call i32 @assert_equal(i32 1, i32 2, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"foo\00"
@.str.1 = [140 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/madphage/mpcstl/refs/heads/master/test/data_seg.c\00"
define void @__ctest_foo_bar_run() {
%1 = tail call i32 @assert_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 4)
%2 = tail call i32 @assert_equal(i32 1, i32 2, i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.1, i64 0, i64 0), i32 5)
ret void
}
int asdf(int i) { return (i + 1); }


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

x86 assembly (clang, -O2):
<asdf>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @asdf(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __libc_system(const char *line) {
  if (line == NULL)
    return 0;
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__libc_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <__libc_system+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1148 <__libc_system+0x38>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_system>:
test   %rdi,%rdi
je     112e <__libc_system+0x1e>
push   %rax
mov    0x2ecb(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__libc_system(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* @ENOSYS
%9 = call i32 @__set_errno(i32 %8)
store i32 -1, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__libc_system(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ -1, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void win() { exit(0); }


x86 assembly (clang, -O0):
<win>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<win>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @win() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @win() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int answer(int value) {}


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

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

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

LLVM IR (-O2):
define i32 @answer(i32 %0) {
ret i32 undef
}
void init_sub_rel_mask_color_pt_funcs_c(void) {}


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

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

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

LLVM IR (-O2):
define void @init_sub_rel_mask_color_pt_funcs_c() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int dashf(const char *fname) {
  struct stat st;
  return (stat(fname, &st) == 0 && S_ISREG(st.st_mode));
}


x86 assembly (clang, -O0):
<dashf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <dashf+0x3d>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dashf>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <dashf+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dashf(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISREG(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dashf(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ syncCores(int);
int handleSync(char *assembled, int currentPoint) {
  syncCores(1);
  return currentPoint;
}


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

x86 assembly (clang, -O2):
<handleSync>:
push   %rbx
mov    %esi,%ebx
mov    $0x1,%edi
call   1030 <syncCores@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @handleSync(i8* nocapture readnone %0, i32 returned %1) {
%3 = tail call i32 @syncCores(i32 1)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int /*<<< orphan*/ suma(int, int, int);
void main() {
  int d1, d2, d3;
  printf("Dame tres numeros\n");
  scanf("%d %d %d", &d1, &d2, &d3);
  suma(d1, d2, d3);
  return;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <suma@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1040 <suma@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Dame tres numeros\0A\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @suma(i32 %6, i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%d %d %d\00"
@str = [18 x i8] c"Dame tres numeros\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @suma(i32 %9, i32 %10, i32 %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: tremovexattr aname path attr\n");
  exit(1);
}


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>
mov    $0x1,%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>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: tremovexattr aname path attr\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: tremovexattr aname path attr\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_A2uint8_mem(unsigned char *val) {
  return ((*val) & (0xA2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A2uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 162
%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_A2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -94
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_Vec4v_init(void) {
  _hmt_register_covercase("HMM_Vec4v", "1");
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"HMM_Vec4v\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_Vec4v_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Olá mundo!\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Ol\C3\A1 mundo!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ack(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ atoll(char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void main(int argc, char **argv) {
  if (argc == 3)
    printf("%lld", ack(atoll(argv[1]), atoll(argv[2])));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    117e <main+0x4e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoll@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoll@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <ack@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
cmp    $0x3,%edi
jne    116c <main+0x3c>
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1050 <atoll@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoll@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <ack@plt>
lea    0xea1(%rip),%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define void @main(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 = icmp eq i32 %5, 3
br i1 %6, label %7, label %18
7: ; preds = %2
%8 = load i8**, i8*** %4
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = call i32 @atoll(i8* %10)
%12 = load i8**, i8*** %4
%13 = getelementptr inbounds i8*, i8** %12, i64 2
%14 = load i8*, i8** %13
%15 = call i32 @atoll(i8* %14)
%16 = call i32 @ack(i32 %11, i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoll(i8* %6)
%8 = getelementptr inbounds i8*, i8** %1, i64 2
%9 = load i8*, i8** %8
%10 = tail call i32 @atoll(i8* %9)
%11 = tail call i32 @ack(i32 %7, i32 %10)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %4, %2
ret void
}
/* Type definitions */
struct runlevel {
  int dummy;
};

/* Variables and functions */
char *getenv(char *);
int set_prevlevel(struct runlevel *, char);
int set_prevlevel_info(struct runlevel *prevlevel) {
  char *env_prev = getenv("PREVLEVEL");
  if (env_prev == NULL)
    return 1;
  return set_prevlevel(prevlevel, env_prev[0]);
}


x86 assembly (clang, -O0):
<set_prevlevel_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <set_prevlevel_info+0x33>
movl   $0x1,-0x4(%rbp)
jmp    1166 <set_prevlevel_info+0x46>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1040 <set_prevlevel@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_prevlevel_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1141 <set_prevlevel_info+0x21>
movsbl (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <set_prevlevel@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.runlevel = type { i32 }
@.str = [10 x i8] c"PREVLEVEL\00"
define i32 @set_prevlevel_info(%struct.runlevel* %0) {
%2 = alloca i32
%3 = alloca %struct.runlevel*
%4 = alloca i8*
store %struct.runlevel* %0, %struct.runlevel** %3
%5 = call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %15
9: ; preds = %1
%10 = load %struct.runlevel*, %struct.runlevel** %3
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = call i32 @set_prevlevel(%struct.runlevel* %10, i8 signext %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %9, %8
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%struct.runlevel = type { i32 }
@.str = [10 x i8] c"PREVLEVEL\00"
define i32 @set_prevlevel_info(%struct.runlevel* %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i8, i8* %2
%6 = tail call i32 @set_prevlevel(%struct.runlevel* %0, i8 signext %5)
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 1, %1 ]
ret i32 %8
}
/* Type definitions */
struct oscap_stringlist_iterator {
  int dummy;
};
struct oscap_iterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ oscap_iterator_free(struct oscap_iterator *);
void oscap_stringlist_iterator_free(struct oscap_stringlist_iterator *it) {
  oscap_iterator_free(((struct oscap_iterator *)(it)));
}


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

x86 assembly (clang, -O2):
<oscap_stringlist_iterator_free>:
jmp    1030 <oscap_iterator_free@plt>

LLVM IR (-O0):
%struct.oscap_stringlist_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_stringlist_iterator_free(%struct.oscap_stringlist_iterator* %0) {
%2 = alloca %struct.oscap_stringlist_iterator*
store %struct.oscap_stringlist_iterator* %0, %struct.oscap_stringlist_iterator** %2
%3 = load %struct.oscap_stringlist_iterator*, %struct.oscap_stringlist_iterator** %2
%4 = bitcast %struct.oscap_stringlist_iterator* %3 to %struct.oscap_iterator*
%5 = call i32 @oscap_iterator_free(%struct.oscap_iterator* %4)
ret void
}

LLVM IR (-O2):
%struct.oscap_stringlist_iterator = type { i32 }
%struct.oscap_iterator = type { i32 }
define void @oscap_stringlist_iterator_free(%struct.oscap_stringlist_iterator* %0) {
%2 = bitcast %struct.oscap_stringlist_iterator* %0 to %struct.oscap_iterator*
%3 = tail call i32 @oscap_iterator_free(%struct.oscap_iterator* %2)
ret void
}
/* Variables and functions */
int PAPI_enum_event(int *, int);
void papif_enum_event_(int *EventCode, int *modifier, int *check) {
  *check = PAPI_enum_event(EventCode, *modifier);
}


x86 assembly (clang, -O0):
<papif_enum_event_>:
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),%rax
mov    (%rax),%esi
call   1030 <PAPI_enum_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_enum_event_>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_enum_event@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_enum_event_(i32* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_enum_event(i32* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ disable_servos();
void lib_disable_servos() { disable_servos(); }


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

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

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

LLVM IR (-O2):
define void @lib_disable_servos() {
%1 = tail call i32 (...) @disable_servos()
ret void
}
double fmin(double x, double y) { return x < y ? x : y; }


x86 assembly (clang, -O0):
<fmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <fmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <fmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmin>:
minsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @fmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *basename) {
  printf("usage: %s <-0|-1> <filename> [<host>]\n\n"
         "\t -0, HTTP/1.0 GET request\n"
         "\t -1, HTTP/1.1 GET request\n"
         "\t <filename>, given filename (e.g. /shellcode.bin)\n"
         "\t <host>, given hostname (e.g. www.tty64.org) [required for HTTP "
         "1.1]\n\n",
         basename);
  return;
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [216 x i8] c"usage: %s <-0|-1> <filename> [<host>]\0A\0A\09 -0, HTTP/1.0 GET request\0A\09 -1, HTTP/1.1 GET request\0A\09 <filename>, given filename (e.g. /shellcode.bin)\0A\09 <host>, given hostname (e.g. www.tty64.org) [required for HTTP 1.1]\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [216 x i8] c"usage: %s <-0|-1> <filename> [<host>]\0A\0A\09 -0, HTTP/1.0 GET request\0A\09 -1, HTTP/1.1 GET request\0A\09 <filename>, given filename (e.g. /shellcode.bin)\0A\09 <host>, given hostname (e.g. www.tty64.org) [required for HTTP 1.1]\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void genc_olt_d() {}


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

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

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

LLVM IR (-O2):
define void @genc_olt_d() {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
bool selectAlmostAll(const char *name) {
  return strcmp(name, ".") != 0 && strcmp(name, "..") != 0;
}


x86 assembly (clang, -O0):
<selectAlmostAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeda(%rip),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1158 <selectAlmostAll+0x48>
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectAlmostAll>:
push   %rbx
mov    %rdi,%rbx
lea    0xee6(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <selectAlmostAll+0x31>
lea    0xed4(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @selectAlmostAll(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define i32 @selectAlmostAll(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ MADV_MERGEABLE;
int madvise(void *, unsigned long, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void set_mergeable(void *addr, unsigned long size) {
  if (madvise(addr, size, MADV_MERGEABLE) == -1) {
    perror("madvise mergeable\n");
  }
}


x86 assembly (clang, -O0):
<set_mergeable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
call   1030 <madvise@plt>
cmp    $0xffffffff,%eax
jne    115b <set_mergeable+0x3b>
lea    0xeaa(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mergeable>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edx
call   1030 <madvise@plt>
cmp    $0xffffffff,%eax
je     1136 <set_mergeable+0x16>
pop    %rax
ret
lea    0xec3(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@MADV_MERGEABLE = global i32 0
@.str = [19 x i8] c"madvise mergeable\0A\00"
define void @set_mergeable(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = load i32, i32* @MADV_MERGEABLE
%8 = call i32 @madvise(i8* %5, i64 %6, i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
@MADV_MERGEABLE = global i32 0
@.str = [19 x i8] c"madvise mergeable\0A\00"
define void @set_mergeable(i8* %0, i64 %1) {
%3 = load i32, i32* @MADV_MERGEABLE
%4 = tail call i32 @madvise(i8* %0, i64 %1, i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
int MAP_ANONYMOUS;
int MAP_PRIVATE;
int PROT_READ;
int PROT_WRITE;
void *mmap(int /*<<< orphan*/, size_t, int, int, int, size_t);
void *do_mmap(size_t size) {
  return mmap(0, size, PROT_READ | PROT_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, -1,
              (size_t)0);
}


x86 assembly (clang, -O0):
<do_mmap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
mov    0x2ea0(%rip),%rax
or     (%rax),%edx
mov    0x2ea7(%rip),%rax
mov    (%rax),%ecx
mov    0x2e86(%rip),%rax
or     (%rax),%ecx
xor    %edi,%edi
mov    $0xffffffff,%r8d
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <mmap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_mmap>:
mov    0x2ee1(%rip),%rax
mov    0x2eb2(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2eb7(%rip),%rax
mov    0x2e98(%rip),%rcx
mov    (%rcx),%ecx
or     (%rax),%ecx
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0xffffffff,%r8d
xor    %r9d,%r9d
jmp    1030 <mmap@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_ANONYMOUS = global i32 0
@MAP_PRIVATE = global i32 0
define i8* @do_mmap(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i32, i32* @PROT_READ
%5 = load i32, i32* @PROT_WRITE
%6 = or i32 %4, %5
%7 = load i32, i32* @MAP_ANONYMOUS
%8 = load i32, i32* @MAP_PRIVATE
%9 = or i32 %7, %8
%10 = call i8* @mmap(i32 0, i64 %3, i32 %6, i32 %9, i32 -1, i64 0)
ret i8* %10
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_ANONYMOUS = global i32 0
@MAP_PRIVATE = global i32 0
define i8* @do_mmap(i64 %0) {
%2 = load i32, i32* @PROT_READ
%3 = load i32, i32* @PROT_WRITE
%4 = or i32 %3, %2
%5 = load i32, i32* @MAP_ANONYMOUS
%6 = load i32, i32* @MAP_PRIVATE
%7 = or i32 %6, %5
%8 = tail call i8* @mmap(i32 0, i64 %0, i32 %4, i32 %7, i32 -1, i64 0)
ret i8* %8
}
/* Variables and functions */
int validateChoiceEx(unsigned int *, char const *, char const *const *, int);
int validateChoice(unsigned int *value, const char *string,
                   const char *const *choices) {
  return validateChoiceEx(value, string, choices, sizeof(*choices));
}


x86 assembly (clang, -O0):
<validateChoice>:
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
mov    $0x8,%ecx
call   1030 <validateChoiceEx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validateChoice>:
mov    $0x8,%ecx
jmp    1030 <validateChoiceEx@plt>

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

LLVM IR (-O2):
define i32 @validateChoice(i32* %0, i8* %1, i8** %2) {
%4 = tail call i32 @validateChoiceEx(i32* %0, i8* %1, i8** %2, i32 8)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char *skip_leading(char *s, char c) {
  assert(s != NULL);
  while (*s == c)
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_leading>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1158 <skip_leading+0x48>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <skip_leading+0x24>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_leading>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
add    $0xffffffffffffffff,%rbx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rax
add    $0x1,%rbx
cmp    %bpl,0x1(%rax)
je     1130 <skip_leading+0x20>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @skip_leading(i8* %0, i8 signext %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
br label %6
6: ; preds = %6, %2
%7 = phi i8* [ %0, %2 ], [ %10, %6 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
%10 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %9, label %6, label %11
11: ; preds = %6
ret i8* %7
}
/* Variables and functions */
int ft_strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int);
void ft_putendl_fd(char const *s, int fd) {
  if (!s) {
    write(1, "(null)\n", 7);
    return;
  }
  write(fd, s, ft_strlen(s));
  write(fd, "\n", 1);
}


x86 assembly (clang, -O0):
<ft_putendl_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1155 <ft_putendl_fd+0x35>
mov    $0x1,%edi
lea    0xeba(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
jmp    118e <ft_putendl_fd+0x6e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    -0xc(%rbp),%edi
lea    0xe82(%rip),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putendl_fd>:
test   %rdi,%rdi
je     1157 <ft_putendl_fd+0x37>
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
lea    0xec1(%rip),%rsi
mov    %ebp,%edi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>
lea    0xea2(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"(null)\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(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 = icmp ne i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i8*, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @ft_strlen(i8* %12)
%14 = call i32 @write(i32 %10, i8* %11, i32 %13)
%15 = load i32, i32* %4
%16 = call i32 @write(i32 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %17
17: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"(null)\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @ft_putendl_fd(i8* %0, i32 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
br label %10
6: ; preds = %2
%7 = tail call i32 @ft_strlen(i8* %0)
%8 = tail call i32 @write(i32 %1, i8* %0, i32 %7)
%9 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %10
10: ; preds = %6, %4
ret void
}