xunge/DecIR huggingface dataset:
char *_cgiDir() { return "/cgi-bin/"; }


x86 assembly (clang, -O0):
<_cgiDir>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cgiDir>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"/cgi-bin/\00"
define i8* @_cgiDir() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"/cgi-bin/\00"
define i8* @_cgiDir() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ CmdLO_Add(char *, char *);
int /*<<< orphan*/ CmdLO_AddDescription(char *, char *);
int /*<<< orphan*/ CmdLO_Init(int);
void configureOptions() {
  CmdLO_Init(1);
  CmdLO_Add("test", "--test");
  CmdLO_Add("test", "-t");
  CmdLO_AddDescription("test", "This is a test Option.");
}


x86 assembly (clang, -O0):
<configureOptions>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <CmdLO_Init@plt>
lea    0xebd(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1050 <CmdLO_Add@plt>
lea    0xeaa(%rip),%rdi
lea    0xea8(%rip),%rsi
call   1050 <CmdLO_Add@plt>
lea    0xe97(%rip),%rdi
lea    0xe98(%rip),%rsi
call   1040 <CmdLO_AddDescription@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<configureOptions>:
push   %rbx
mov    $0x1,%edi
call   1030 <CmdLO_Init@plt>
lea    0xec0(%rip),%rbx
lea    0xeb7(%rip),%rsi
mov    %rbx,%rdi
call   1050 <CmdLO_Add@plt>
lea    0xeaf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <CmdLO_Add@plt>
lea    0xea3(%rip),%rsi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <CmdLO_AddDescription@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"test\00"
@.str.1 = [7 x i8] c"--test\00"
@.str.2 = [3 x i8] c"-t\00"
@.str.3 = [23 x i8] c"This is a test Option.\00"
define void @configureOptions() {
%1 = call i32 @CmdLO_Init(i32 1)
%2 = call i32 @CmdLO_Add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @CmdLO_Add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @CmdLO_AddDescription(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"test\00"
@.str.1 = [7 x i8] c"--test\00"
@.str.2 = [3 x i8] c"-t\00"
@.str.3 = [23 x i8] c"This is a test Option.\00"
define void @configureOptions() {
%1 = tail call i32 @CmdLO_Init(i32 1)
%2 = tail call i32 @CmdLO_Add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @CmdLO_Add(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @CmdLO_AddDescription(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f2(void) { puts("f2() is working."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"f2() is working.\00"
define void @f2() {
%1 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"f2() is working.\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  while ((c = getchar()) != EOF) {
    if (c == '\n') {
      putchar(c);
    } else {
      putchar(c - 7);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2ea5(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     117d <main+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1169 <main+0x49>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    1178 <main+0x58>
movsbl -0x5(%rbp),%eax
sub    $0x7,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb7(%rip),%rbx
cmp    (%rbx),%al
je     115e <main+0x3e>
mov    $0xa,%ebp
nopw   0x0(%rax,%rax,1)
lea    -0x7(%rax),%ecx
cmp    $0xa,%al
movzbl %cl,%eax
cmove  %ebp,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %22, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %23
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8, i8* %2
%15 = call i32 @putchar(i8 signext %14)
br label %22
16: ; preds = %9
%17 = load i8, i8* %2
%18 = sext i8 %17 to i32
%19 = sub nsw i32 %18, 7
%20 = trunc i32 %19 to i8
%21 = call i32 @putchar(i8 signext %20)
br label %22
22: ; preds = %16, %13
br label %3
23: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %13, label %4
4: ; preds = %0, %4
%5 = phi i8 [ %10, %4 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 10
%7 = add i8 %5, -7
%8 = select i1 %6, i8 10, i8 %7
%9 = tail call i32 @putchar(i8 signext %8)
%10 = tail call signext i8 (...) @getchar()
%11 = load i8, i8* @EOF
%12 = icmp eq i8 %10, %11
br i1 %12, label %13, label %4
13: ; preds = %4, %0
ret i32 0
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t bitscan(uint64_t val) {
  uint64_t r;
  __asm__("bsfq %1,%0\n\t" : "=r"(r) : "rm"(val));
  return r;
}


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

x86 assembly (clang, -O2):
<bitscan>:
mov    %rdi,-0x8(%rsp)
bsf    -0x8(%rsp),%rax
ret

LLVM IR (-O0):
define i8* @bitscan(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "bsfq $1,$0\0A\09", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @bitscan(i8* %0) {
%2 = tail call i8* asm "bsfq $1,$0\0A\09", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_164() {
  Assert_real((isqrt(164) == 12),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/stdlib/isqrt.c",
              825, ("Integer square root of 164 should be 12"));
}


x86 assembly (clang, -O0):
<t_sqrt_164>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa4,%edi
call   1030 <isqrt@plt>
cmp    $0xc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x339,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_164>:
push   %rax
mov    $0xa4,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xc,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x339,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 164 should be 12\00"
define void @t_sqrt_164() {
%1 = call i32 @isqrt(i32 164)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 825, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 164 should be 12\00"
define void @t_sqrt_164() {
%1 = tail call i32 @isqrt(i32 164)
%2 = icmp eq i32 %1, 12
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 825, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void mt65xx_backlight_on(void) {}


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

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

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

LLVM IR (-O2):
define void @mt65xx_backlight_on() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int skip_whitespace(int /*<<< orphan*/ *);
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/ *);
bool check_next(char match, FILE *f) {
  int ch = skip_whitespace(f);
  if (ch == match)
    return true;
  if (ch != EOF)
    ungetc(ch, f);
  return false;
}


x86 assembly (clang, -O0):
<check_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <skip_whitespace@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    1159 <check_next+0x39>
movl   $0x1,-0x4(%rbp)
jmp    117e <check_next+0x5e>
mov    -0x14(%rbp),%eax
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%eax
je     1177 <check_next+0x57>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_next>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
mov    %rsi,%rdi
call   1030 <skip_whitespace@plt>
mov    $0x1,%ebp
cmp    %ebx,%eax
je     1151 <check_next+0x31>
mov    0x2ea7(%rip),%rcx
xor    %ebp,%ebp
cmp    (%rcx),%eax
je     1151 <check_next+0x31>
mov    %eax,%edi
mov    %r14,%rsi
call   1040 <ungetc@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @check_next(i8 signext %0, i32* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32*
%6 = alloca i32
store i8 %0, i8* %4
store i32* %1, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @skip_whitespace(i32* %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %9, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 1, i32* %3
br label %23
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i32, i32* @EOF
%17 = icmp ne i32 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %6
%20 = load i32*, i32** %5
%21 = call i32 @ungetc(i32 %19, i32* %20)
br label %22
22: ; preds = %18, %14
store i32 0, i32* %3
br label %23
23: ; preds = %22, %13
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @check_next(i8 signext %0, i32* %1) {
%3 = tail call i32 @skip_whitespace(i32* %1)
%4 = sext i8 %0 to i32
%5 = icmp eq i32 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = load i32, i32* @EOF
%8 = icmp eq i32 %3, %7
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @ungetc(i32 %3, i32* %1)
br label %11
11: ; preds = %6, %9, %2
%12 = phi i32 [ 1, %2 ], [ 0, %9 ], [ 0, %6 ]
ret i32 %12
}
void update_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @update_cleanup() {
ret void
}
/* Variables and functions */
int PAPI_set_multiplex(int);
void papif_set_multiplex_(int *EventSet, int *check) {
  *check = PAPI_set_multiplex(*EventSet);
}


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

x86 assembly (clang, -O2):
<papif_set_multiplex_>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_set_multiplex@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @papif_set_multiplex_(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_set_multiplex(i32 %3)
store i32 %4, i32* %1
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ perf_scan_1_upd();
int main(void) {
  perf_scan_1_upd();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <perf_scan_1_upd@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <perf_scan_1_upd@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @perf_scan_1_upd()
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int file_is_absolute_path(const char *zPath) {
  if (zPath[0] == '/') {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<file_is_absolute_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1124 <file_is_absolute_path+0x24>
movl   $0x1,-0x4(%rbp)
jmp    112b <file_is_absolute_path+0x2b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_is_absolute_path>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @file_is_absolute_path(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 47
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %2
br label %11
10: ; preds = %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @file_is_absolute_path(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
%4 = zext i1 %3 to i32
ret i32 %4
}
void dump_actions() {}


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

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

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

LLVM IR (-O2):
define void @dump_actions() {
ret void
}
/* Variables and functions */
scalar_t__ fork();
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("1");
  if (fork() > 0) {
    printf("2");
    printf("3");
  } else {
    printf("4");
    printf("5");
  }
  printf("\n");
  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    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <fork@plt>
cmp    $0x0,%rax
jle    1170 <main+0x50>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
jmp    1188 <main+0x68>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x31,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <fork@plt>
xor    %ecx,%ecx
test   %rax,%rax
setle  %cl
lea    (%rcx,%rcx,1),%edi
add    $0x32,%edi
lea    (%rcx,%rcx,1),%ebx
add    $0x33,%ebx
call   1030 <putchar@plt>
mov    %ebx,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 49)
%4 = tail call i64 (...) @fork()
%5 = icmp sgt i64 %4, 0
%6 = select i1 %5, i32 50, i32 52
%7 = select i1 %5, i32 51, i32 53
%8 = tail call i32 @putchar(i32 %6)
%9 = tail call i32 @putchar(i32 %7)
%10 = tail call i32 @putchar(i32 10)
ret i32 0
}
short minv(short a, short b) {
  if (a < b)
    return a;
  else
    return b;
}


x86 assembly (clang, -O0):
<minv>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x4(%rbp),%eax
movswl -0x6(%rbp),%ecx
cmp    %ecx,%eax
jge    112f <minv+0x2f>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1137 <minv+0x37>
mov    -0x6(%rbp),%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minv>:
mov    %esi,%eax
cmp    %ax,%di
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define signext i16 @minv(i16 signext %0, i16 signext %1) {
%3 = icmp slt i16 %0, %1
%4 = select i1 %3, i16 %0, i16 %1
ret i16 %4
}
/* Variables and functions */
int is_hex_digit(char c) {
  return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
         (c >= 'A' && c <= 'F');
}


x86 assembly (clang, -O0):
<is_hex_digit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <is_hex_digit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_digit+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <is_hex_digit+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <is_hex_digit+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <is_hex_digit+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_digit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_hex_digit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %28, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 97
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 102
br i1 %17, label %28, label %18
18: ; preds = %14, %10
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp sge i32 %20, 65
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = load i8, i8* %2
%24 = sext i8 %23 to i32
%25 = icmp sle i32 %24, 70
br label %26
26: ; preds = %22, %18
%27 = phi i1 [ false, %18 ], [ %25, %22 ]
br label %28
28: ; preds = %26, %14, %6
%29 = phi i1 [ true, %14 ], [ true, %6 ], [ %27, %26 ]
%30 = zext i1 %29 to i32
ret i32 %30
}

LLVM IR (-O2):
define i32 @is_hex_digit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int startMonitoringConsoleBell();
int /*<<< orphan*/ stopMonitoringConsoleBell();
int setConsoleBellMonitoring(int on) {
  if (on)
    return startMonitoringConsoleBell();
  stopMonitoringConsoleBell();
  return 1;
}


x86 assembly (clang, -O0):
<setConsoleBellMonitoring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1144 <setConsoleBellMonitoring+0x24>
mov    $0x0,%al
call   1030 <startMonitoringConsoleBell@plt>
mov    %eax,-0x4(%rbp)
jmp    1152 <setConsoleBellMonitoring+0x32>
mov    $0x0,%al
call   1040 <stopMonitoringConsoleBell@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setConsoleBellMonitoring>:
test   %edi,%edi
je     112b <setConsoleBellMonitoring+0xb>
xor    %eax,%eax
jmp    1030 <startMonitoringConsoleBell@plt>
push   %rax
xor    %eax,%eax
call   1040 <stopMonitoringConsoleBell@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @setConsoleBellMonitoring(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 (...) @startMonitoringConsoleBell()
br label %7
5: ; preds = %1
%6 = tail call i32 (...) @stopMonitoringConsoleBell()
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ 1, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ aes_cbc(unsigned char *, unsigned char *, unsigned char *,
                           size_t, unsigned char *, int, int);
void openssl_AES_enc192_CBC(unsigned char *in, unsigned char *out,
                            unsigned char *key, size_t num_blocks,
                            unsigned char *iv) {
  aes_cbc(in, out, key, num_blocks, iv, 192, 1);
}


x86 assembly (clang, -O0):
<openssl_AES_enc192_CBC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    $0xc0,%r9d
movl   $0x1,(%rsp)
call   1030 <aes_cbc@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_AES_enc192_CBC>:
push   %rax
movl   $0x1,(%rsp)
mov    $0xc0,%r9d
call   1030 <aes_cbc@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @openssl_AES_enc192_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @aes_cbc(i8* %11, i8* %12, i8* %13, i64 %14, i8* %15, i32 192, i32 1)
ret void
}

LLVM IR (-O2):
define void @openssl_AES_enc192_CBC(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4) {
%6 = tail call i32 @aes_cbc(i8* %0, i8* %1, i8* %2, i64 %3, i8* %4, i32 192, i32 1)
ret void
}
/* Variables and functions */
int write(int, char *, int);
int g_file_write(int fd, char *ptr, int len) { return write(fd, ptr, len); }


x86 assembly (clang, -O0):
<g_file_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_file_write>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @g_file_write(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
int main(int argc, char **argv) {
  void *boot_pageset;
  do {
    const void *__vpp_verify = (typeof(boot_pageset))0;
    (void)__vpp_verify;
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %2
store i8* null, i8** %7
%9 = load i8*, i8** %7
br label %10
10: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned int __native_popcnt(unsigned int);
unsigned int __native_ctz(unsigned int x) {
  return __native_popcnt((x & -(int)x) - 1);
}


x86 assembly (clang, -O0):
<__native_ctz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
sub    -0x4(%rbp),%eax
and    %eax,%edi
sub    $0x1,%edi
call   1030 <__native_popcnt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__native_ctz>:
mov    %edi,%eax
neg    %eax
and    %eax,%edi
add    $0xffffffff,%edi
jmp    1030 <__native_popcnt@plt>

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

LLVM IR (-O2):
define i32 @__native_ctz(i32 %0) {
%2 = sub nsw i32 0, %0
%3 = and i32 %2, %0
%4 = add i32 %3, -1
%5 = tail call i32 @__native_popcnt(i32 %4)
ret i32 %5
}
int mt_cmp(int *m, int *n) { return *m > *n ? 1 : (*m < *n ? -1 : 0); }


x86 assembly (clang, -O0):
<mt_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jle    112b <mt_cmp+0x2b>
mov    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1146 <mt_cmp+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @mt_cmp(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = icmp sgt i32 %6, %8
br i1 %9, label %10, label %11
10: ; preds = %2
br label %19
11: ; preds = %2
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = icmp slt i32 %13, %15
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 -1, i32 0
br label %19
19: ; preds = %11, %10
%20 = phi i32 [ 1, %10 ], [ %18, %11 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @mt_cmp(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %3, %4
%6 = icmp slt i32 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayAlertUsage() {
  printf("Usage:\n");
  printf("  lattice-msg alert (audio|date|time|workspace)\n");
}


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

x86 assembly (clang, -O2):
<displayAlertUsage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [49 x i8] c" lattice-msg alert (audio|date|time|workspace)\0A\00"
define void @displayAlertUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [48 x i8] c" lattice-msg alert (audio|date|time|workspace)\00"
define void @displayAlertUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sockaddr_in {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ PF_UNIX;
int /*<<< orphan*/ SOCK_STREAM;
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int initialize(long ip) {
  int sockid = socket(PF_UNIX, SOCK_STREAM, IPPROTO_TCP);
  struct sockaddr_in net_data;
}


x86 assembly (clang, -O0):
<initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
call   1030 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    0x2eb7(%rip),%rax
mov    (%rax),%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@PF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @initialize(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca %struct.sockaddr_in
store i64 %0, i64* %3
%6 = load i32, i32* @PF_UNIX
%7 = load i32, i32* @SOCK_STREAM
%8 = load i32, i32* @IPPROTO_TCP
%9 = call i32 @socket(i32 %6, i32 %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@PF_UNIX = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
define i32 @initialize(i64 %0) {
%2 = load i32, i32* @PF_UNIX
%3 = load i32, i32* @SOCK_STREAM
%4 = load i32, i32* @IPPROTO_TCP
%5 = tail call i32 @socket(i32 %2, i32 %3, i32 %4)
ret i32 undef
}
/* Variables and functions */
int height(int);
int left(int x) {
  int h = height(x);
  return x - (1 << (h - 1));
}


x86 assembly (clang, -O0):
<left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <height@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<left>:
push   %rbx
mov    %edi,%ebx
call   1030 <height@plt>
lea    -0x1(%rax),%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @left(i32 %0) {
%2 = tail call i32 @height(i32 %0)
%3 = add nsw i32 %2, -1
%4 = shl nsw i32 -1, %3
%5 = add i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ matNf_mult_matNf_new(float *, float const *, float const *,
                                        int);
void mat4f_mult_mat4f_new(float result[16], const float matA[16],
                          const float matB[16]) {
  matNf_mult_matNf_new(result, matA, matB, 4);
}


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

x86 assembly (clang, -O2):
<mat4f_mult_mat4f_new>:
mov    $0x4,%ecx
jmp    1030 <matNf_mult_matNf_new@plt>

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

LLVM IR (-O2):
define void @mat4f_mult_mat4f_new(float* %0, float* %1, float* %2) {
%4 = tail call i32 @matNf_mult_matNf_new(float* %0, float* %1, float* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m_abort(int);
void *malloc(size_t);
void *m_xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    m_abort(1);
  return p;
}


x86 assembly (clang, -O0):
<m_xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <m_xmalloc+0x2e>
mov    $0x1,%edi
call   1040 <m_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1138 <m_xmalloc+0x18>
mov    $0x1,%edi
call   1040 <m_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @m_xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @m_abort(i32 1)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ ph_event_get();
void *ph_api_thread(void *arg) {
  ph_event_get();
  return 0;
}


x86 assembly (clang, -O0):
<ph_api_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ph_event_get@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ph_api_thread>:
push   %rax
xor    %eax,%eax
call   1030 <ph_event_get@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @ph_api_thread(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @ph_event_get()
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ph_api_thread(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @ph_event_get()
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
double quedaLibre(unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *);
void exe02(void) {
  unsigned int hi;
  printf("\n\nDigite a altura inicial do corpo: ");
  scanf("%u", &hi);
  printf("O corpo levara %.2f segundo(s) para se chocar contra o solo e queda "
         "livre.",
         quedaLibre(hi));
}


x86 assembly (clang, -O0):
<exe02>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%edi
call   1050 <quedaLibre@plt>
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe02>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <quedaLibre@plt>
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [37 x i8] c"\0A\0ADigite a altura inicial do corpo: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [75 x i8] c"O corpo levara %.2f segundo(s) para se chocar contra o solo e queda livre.\00"
define void @exe02() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call double @quedaLibre(i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), double %5)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"\0A\0ADigite a altura inicial do corpo: \00"
@.str.1 = [3 x i8] c"%u\00"
@.str.2 = [75 x i8] c"O corpo levara %.2f segundo(s) para se chocar contra o solo e queda livre.\00"
define void @exe02() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 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 double @quedaLibre(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.2, i64 0, i64 0), double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
int _umount_error(char const *message, int ret) {
  fputs("umount"
        ": ",
        stderr);
  perror(message);
  return ret;
}


x86 assembly (clang, -O0):
<_umount_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_umount_error>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <fputs@plt>
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"umount: \00"
@stderr = global i32 0
define i32 @_umount_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @perror(i8* %7)
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
@.str = [9 x i8] c"umount: \00"
@stderr = global i32 0
define i32 @_umount_error(i8* nocapture %0, i32 returned %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @perror(i8* %0)
ret i32 %1
}
void bch_debug_init_cache_set(struct cache_set *c) {}


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

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

LLVM IR (-O0):
%struct.cache_set = type opaque
define void @bch_debug_init_cache_set(%struct.cache_set* %0) {
%2 = alloca %struct.cache_set*
store %struct.cache_set* %0, %struct.cache_set** %2
ret void
}

LLVM IR (-O2):
%struct.cache_set = type opaque
define void @bch_debug_init_cache_set(%struct.cache_set* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ read_record(int /*<<< orphan*/);
void op_read() { read_record(0); }


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

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

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

LLVM IR (-O2):
define void @op_read() {
%1 = tail call i32 @read_record(i32 0)
ret void
}
int test_imm_B4uint32_mem(unsigned int *val) {
  return ((*val) & (0xB4 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_B4uint32_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, 180
%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_B4uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 180
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Send_Byte(int);
void EBSY() {
  CE_Low();
  Send_Byte(0x70);
  CE_High();
}


x86 assembly (clang, -O0):
<EBSY>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <CE_Low@plt>
mov    $0x70,%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EBSY>:
push   %rax
xor    %eax,%eax
call   1050 <CE_Low@plt>
mov    $0x70,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <CE_High@plt>

LLVM IR (-O0):
define void @EBSY() {
%1 = call i32 (...) @CE_Low()
%2 = call i32 @Send_Byte(i32 112)
%3 = call i32 (...) @CE_High()
ret void
}

LLVM IR (-O2):
define void @EBSY() {
%1 = tail call i32 (...) @CE_Low()
%2 = tail call i32 @Send_Byte(i32 112)
%3 = tail call i32 (...) @CE_High()
ret void
}
/* Variables and functions */
char *strchr(char *, char);
int rcsrev_istrunk(char *revnum) {
  char *tmp;
  tmp = strchr(revnum, '.');
  tmp++;
  if (strchr(tmp, '.') != NULL)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<rcsrev_istrunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
je     115e <rcsrev_istrunk+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1165 <rcsrev_istrunk+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcsrev_istrunk>:
push   %rax
mov    $0x2e,%esi
call   1030 <strchr@plt>
lea    0x1(%rax),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @rcsrev_istrunk(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i8* @strchr(i8* %3, i8 signext 46)
%5 = icmp eq i8* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}