xunge/DecIR huggingface dataset:
extern float bar(float x) {
  register long double value;
  asm volatile("frndint" : "=t"(value) : "0"(x));
  return value;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
flds   -0x4(%rbp)
frndint
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fstps  -0x24(%rbp)
movss  -0x24(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movss  %xmm0,-0x4(%rsp)
flds   -0x4(%rsp)
frndint
fstps  -0x8(%rsp)
movss  -0x8(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @bar(float %0) {
%2 = alloca float
%3 = alloca x86_fp80
store float %0, float* %2
%4 = load float, float* %2
%5 = fpext float %4 to x86_fp80
%6 = call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %5)
store x86_fp80 %6, x86_fp80* %3
%7 = load x86_fp80, x86_fp80* %3
%8 = fptrunc x86_fp80 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @bar(float %0) {
%2 = fpext float %0 to x86_fp80
%3 = tail call x86_fp80 asm sideeffect "frndint", "={st},0,~{dirflag},~{fpsr},~{flags}"(x86_fp80 %2)
%4 = fptrunc x86_fp80 %3 to float
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ error1(char *, char *);
int /*<<< orphan*/ exit(int);
void die1(char *msg, char *str) {
  error1(msg, str);
  exit(1);
}


x86 assembly (clang, -O0):
<die1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <error1@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<die1>:
push   %rax
call   1040 <error1@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @die1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @error1(i8* %5, i8* %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @die1(i8* %0, i8* %1) {
%3 = tail call i32 @error1(i8* %0, i8* %1)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int yank_char_valid(int reg) { return ('a' - 1) <= reg && reg <= 'z'; }


x86 assembly (clang, -O0):
<yank_char_valid>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x60,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <yank_char_valid+0x24>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<yank_char_valid>:
add    $0xffffffa0,%edi
xor    %eax,%eax
cmp    $0x1b,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @yank_char_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 96, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @yank_char_valid(i32 %0) {
%2 = add i32 %0, -96
%3 = icmp ult i32 %2, 27
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int panic_syserror(char *message, char *object_name) {
  fflush(stdout);
  fprintf(stderr, "%s: %s.\n", object_name, message);
  perror(object_name);
  abort();
}


x86 assembly (clang, -O0):
<panic_syserror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x8(%rbp),%rcx
lea    0xe8a(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<panic_syserror>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
call   1060 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
define i32 @panic_syserror(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @perror(i8* %11)
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@.str = [9 x i8] c"%s: %s.\0A\00"
define i32 @panic_syserror(i8* %0, i8* %1) {
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %0)
%7 = tail call i32 @perror(i8* %1)
%8 = tail call i32 (...) @abort()
unreachable
}
int newsize(int insize) {
  int size;
  size = insize + 1;
  size += (size % 64 > 56) ? 64 : 0;
  size += 64 - size % 64;
  return size;
}


x86 assembly (clang, -O0):
<newsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
mov    $0x40,%ecx
cmp    $0x38,%edx
cmovg  %ecx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    $0x40,%eax
sub    %edx,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<newsize>:
lea    0x1(%rdi),%eax
lea    0x40(%rdi),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
neg    %ecx
lea    (%rdi,%rcx,1),%eax
add    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x39,%eax
setge  %cl
shl    $0x6,%ecx
lea    (%rcx,%rdi,1),%edx
add    $0x1,%edx
lea    (%rcx,%rdi,1),%eax
add    $0x40,%eax
test   %edx,%edx
cmovns %edx,%eax
and    $0xffffffc0,%eax
add    $0x40,%eax
ret

LLVM IR (-O0):
define i32 @newsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = srem i32 %6, 64
%8 = icmp sgt i32 %7, 56
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 64, i32 0
%11 = load i32, i32* %3
%12 = add nsw i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = srem i32 %13, 64
%15 = sub nsw i32 64, %14
%16 = load i32, i32* %3
%17 = add nsw i32 %16, %15
store i32 %17, i32* %3
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @newsize(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = srem i32 %2, 64
%4 = icmp sgt i32 %3, 56
%5 = select i1 %4, i32 64, i32 0
%6 = add nsw i32 %5, %2
%7 = srem i32 %6, 64
%8 = add i32 %6, 64
%9 = sub i32 %8, %7
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ expand(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int main() {
  char s1[] = "-a-c, e-c-a, a-a, a-Z, a-9\n-A-C, E-C-a, A-A, A-z, A-9\n-0-2, "
              "4-2-0, 0-0, 0-z, 0-Z\n";
  char s2[1000];
  expand(s1, s2);
  printf("source string:\n%s\nresult string:\n%s\n", s1, s2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x450,%rsp
lea    -0x60(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x52,%edx
call   1040 <memcpy@plt>
lea    -0x60(%rbp),%rdi
lea    -0x450(%rbp),%rsi
call   1050 <expand@plt>
lea    -0x60(%rbp),%rsi
lea    -0x450(%rbp),%rdx
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x450,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x448,%rsp
movaps 0xf0f(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9f(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0xa,0x50(%rsp)
mov    %rsp,%rbx
lea    0x60(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <expand@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x448,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s1 = [82 x i8] c"-a-c, e-c-a, a-a, a-Z, a-9\0A-A-C, E-C-a, A-A, A-z, A-9\0A-0-2, 4-2-0, 0-0, 0-z, 0-Z\0A\00"
@.str = [37 x i8] c"source string:\0A%s\0Aresult string:\0A%s\0A\00"
define i32 @main() {
%1 = alloca [82 x i8]
%2 = alloca [1000 x i8]
%3 = bitcast [82 x i8]* %1 to i8*
%4 = getelementptr inbounds [82 x i8], [82 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%6 = call i32 @expand(i8* %4, i8* %5)
%7 = getelementptr inbounds [82 x i8], [82 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [82 x i8] c"-a-c, e-c-a, a-a, a-Z, a-9\0A-A-C, E-C-a, A-A, A-z, A-9\0A-0-2, 4-2-0, 0-0, 0-z, 0-Z\0A\00"
@.str = [37 x i8] c"source string:\0A%s\0Aresult string:\0A%s\0A\00"
define i32 @main() {
%1 = alloca [82 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [82 x i8], [82 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i32 @expand(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_tssi1() { MIPS_SET_BIT((0xB0000000 + 0x28), 1); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_tssi1>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x1,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_tssi1>:
mov    $0xb0000028,%edi
mov    $0x1,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_tssi1() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 1)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_tssi1() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char **parse_cmdline(char *);
char *read_line(int /*<<< orphan*/);
int /*<<< orphan*/ start_process(char **);
int /*<<< orphan*/ stdin;
int main(void) {
  char *line;
  while (1) {
    line = read_line(stdin);
    if (line != NULL) {
      char **command = parse_cmdline(line);
      start_process(command);
    }
  }
  free(line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1040 <read_line@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <main+0x42>
mov    -0x10(%rbp),%rdi
call   1050 <parse_cmdline@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <start_process@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2eb0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
call   1040 <read_line@plt>
test   %rax,%rax
je     1140 <main+0x10>
mov    %rax,%rdi
call   1050 <parse_cmdline@plt>
mov    %rax,%rdi
call   1030 <start_process@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8**
store i32 0, i32* %1
br label %4
4: ; preds = %0, %14
%5 = load i32, i32* @stdin
%6 = call i8* @read_line(i32 %5)
store i8* %6, i8** %2
%7 = load i8*, i8** %2
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = call i8** @parse_cmdline(i8* %10)
store i8** %11, i8*** %3
%12 = load i8**, i8*** %3
%13 = call i32 @start_process(i8** %12)
br label %14
14: ; preds = %9, %4
br label %4
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main() {
br label %1
1: ; preds = %8, %0
%2 = load i32, i32* @stdin
%3 = tail call i8* @read_line(i32 %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i8** @parse_cmdline(i8* %3)
%7 = tail call i32 @start_process(i8** %6)
br label %8
8: ; preds = %5, %1
br label %1
}
int cairo_code_draw_cheapAggression_get_height() { return 18; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_cheapAggression_get_height() {
ret i32 18
}

LLVM IR (-O2):
define i32 @cairo_code_draw_cheapAggression_get_height() {
ret i32 18
}
/* Variables and functions */
int dddddd();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  printf("%d", dddddd());
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <dddddd@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(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 (...) @dddddd()
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @dddddd()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void http_close(int handle) { printf("http_close() called!\n"); }


x86 assembly (clang, -O0):
<http_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [21 x i8] c"http_close() called!\00"
define void @http_close(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Git! \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 = [7 x i8] c"Git! \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [6 x i8] c"Git! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret i32 0
}
imm0indreg1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if (22 <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movzwl (%rax),%ecx
mov    $0x16,%eax
cmp    %ecx,%eax
jg     113f <imm0indreg1+0x3f>
movl   $0x1,-0x4(%rbp)
jmp    1146 <imm0indreg1+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0indreg1>:
xor    %eax,%eax
cmpw   $0x16,(%r9)
setae  %al
ret

LLVM IR (-O0):
define i32 @imm0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %13
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = icmp sle i32 22, %18
br i1 %19, label %20, label %21
20: ; preds = %6
store i32 1, i32* %7
br label %22
21: ; preds = %6
store i32 0, i32* %7
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
define i32 @imm0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture readnone %4, i16* nocapture %5) {
%7 = load i16, i16* %5
%8 = icmp ugt i16 %7, 21
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
double log(double);
int height(int n) { return (int)(1.0 + 0.5 * log((double)n) / 1.0986122); }


x86 assembly (clang, -O0):
<height>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
call   1030 <log@plt>
movsd  0xee3(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xecf(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<height>:
push   %rax
cvtsi2sd %edi,%xmm0
call   1030 <log@plt>
mulsd  0xede(%rip),%xmm0
divsd  0xede(%rip),%xmm0
addsd  0xede(%rip),%xmm0
cvttsd2si %xmm0,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @height(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = call double @log(double %4)
%6 = fmul double 5.000000e-01, %5
%7 = fdiv double %6, 0x3FF193EA62DFC929
%8 = fadd double 1.000000e+00, %7
%9 = fptosi double %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @height(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = tail call double @log(double %2)
%4 = fmul double %3, 5.000000e-01
%5 = fdiv double %4, 0x3FF193EA62DFC929
%6 = fadd double %5, 1.000000e+00
%7 = fptosi double %6 to i32
ret i32 %7
}
/* Variables and functions */
unsigned int hash_ulong(void const *);
unsigned int hash_char(const void *key) { return hash_ulong(key); }


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

x86 assembly (clang, -O2):
<hash_char>:
jmp    1030 <hash_ulong@plt>

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

LLVM IR (-O2):
define i32 @hash_char(i8* %0) {
%2 = tail call i32 @hash_ulong(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ getCommandLine(int *, double *, int, char **);
int /*<<< orphan*/ printHeader(int, double);
int /*<<< orphan*/ printSet(int, double);
void main(int argc, char **argv) {
  int density;
  double maxRadius;
  getCommandLine(&density, &maxRadius, argc, argv);
  printHeader(density, maxRadius);
  printSet(density, maxRadius);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <getCommandLine@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1030 <printHeader@plt>
mov    -0x14(%rbp),%edi
movsd  -0x20(%rbp),%xmm0
call   1050 <printSet@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %edi,%edx
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1040 <getCommandLine@plt>
mov    0xc(%rsp),%edi
movsd  0x10(%rsp),%xmm0
call   1030 <printHeader@plt>
mov    0xc(%rsp),%edi
movsd  0x10(%rsp),%xmm0
call   1050 <printSet@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca double
%5 = bitcast i32* %3 to i8*
%6 = bitcast double* %4 to i8*
%7 = call i32 @getCommandLine(i32* %3, double* %4, i32 %0, i8** %1)
%8 = load i32, i32* %3
%9 = load double, double* %4
%10 = call i32 @printHeader(i32 %8, double %9)
%11 = load i32, i32* %3
%12 = load double, double* %4
%13 = call i32 @printSet(i32 %11, double %12)
ret void
}
void dbg_init(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
}


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

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

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

LLVM IR (-O2):
define void @dbg_init(i32 %0, i8** nocapture %1) {
ret void
}
double m_max_double(double left, double right) {
  return (left > right) ? left : right;
}


x86 assembly (clang, -O0):
<m_max_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <m_max_double+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <m_max_double+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_max_double>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @m_max_double(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 ogt 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 @m_max_double(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
char key_3() { return (((*(volatile unsigned long *)0x7F008834) & (1 << 2))); }


x86 assembly (clang, -O0):
<key_3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7f008834,%eax
mov    (%rax),%rax
and    $0x4,%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<key_3>:
mov    0x7f008834,%rax
7f
and    $0x4,%al
ret

LLVM IR (-O0):
define signext i8 @key_3() {
%1 = load volatile i64, i64* inttoptr (i64 2130741300 to i64*)
%2 = and i64 %1, 4
%3 = trunc i64 %2 to i8
ret i8 %3
}

LLVM IR (-O2):
define signext i8 @key_3() {
%1 = load volatile i64, i64* inttoptr (i64 2130741300 to i64*)
%2 = trunc i64 %1 to i8
%3 = and i8 %2, 4
ret i8 %3
}
int dht_blacklisted(const struct sockaddr *sa, int salen) { return 0; }


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

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

LLVM IR (-O0):
%struct.sockaddr = type opaque
define i32 @dht_blacklisted(%struct.sockaddr* %0, i32 %1) {
%3 = alloca %struct.sockaddr*
%4 = alloca i32
store %struct.sockaddr* %0, %struct.sockaddr** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr = type opaque
define i32 @dht_blacklisted(%struct.sockaddr* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool is_bit_set(uint32_t ch, int i) { return (uint32_t)(1 << i) & ch; }


x86 assembly (clang, -O0):
<is_bit_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_bit_set>:
mov    %esi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @is_bit_set(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = and i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printPascal(int);
int main() { printPascal(10); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <printPascal@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @printPascal(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @printPascal(i32 10)
ret i32 0
}
void parse_range(void *arg, struct Source *src, struct Result *res) {}


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

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

LLVM IR (-O0):
%struct.Source = type opaque
%struct.Result = type opaque
define void @parse_range(i8* %0, %struct.Source* %1, %struct.Result* %2) {
%4 = alloca i8*
%5 = alloca %struct.Source*
%6 = alloca %struct.Result*
store i8* %0, i8** %4
store %struct.Source* %1, %struct.Source** %5
store %struct.Result* %2, %struct.Result** %6
ret void
}

LLVM IR (-O2):
%struct.Source = type opaque
%struct.Result = type opaque
define void @parse_range(i8* nocapture %0, %struct.Source* nocapture %1, %struct.Result* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gfx_set_video_enable(int /*<<< orphan*/);
void gfx_reset_video(void) { gfx_set_video_enable(0); }


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

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

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

LLVM IR (-O2):
define void @gfx_reset_video() {
%1 = tail call i32 @gfx_set_video_enable(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  assert(3 >= 2);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
/* Variables and functions */
int WSAGetLastError();
int xmms_socket_errno() { return WSAGetLastError(); }


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

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

LLVM IR (-O0):
define i32 @xmms_socket_errno() {
%1 = call i32 (...) @WSAGetLastError()
ret i32 %1
}

LLVM IR (-O2):
define i32 @xmms_socket_errno() {
%1 = tail call i32 (...) @WSAGetLastError()
ret i32 %1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, double);
char *doubleToString(double d) {
  char *x = malloc(64);
  sprintf(x, "%f", d);
  return x;
}


x86 assembly (clang, -O0):
<doubleToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubleToString>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    $0x40,%edi
call   1030 <malloc@plt>
mov    %rax,%rbx
lea    0xec1(%rip),%rsi
mov    %rax,%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <sprintf@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i8* @doubleToString(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
%4 = call i8* @malloc(i32 64)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load double, double* %2
%7 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define noalias i8* @doubleToString(double %0) {
%2 = tail call dereferenceable_or_null(64) i8* @malloc(i32 64)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawnattr_t;
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawnp(pid_t *pid, const char *path,
                 const posix_spawn_file_actions_t *file_actions,
                 const posix_spawnattr_t *attrp, char *const argv[],
                 char *const envp[]) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawnp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%ecx
mov    0x2eac(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawnp>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnp(i32* %0, i8* %1, i32* %2, i32* %3, i8** %4, i8** %5) {
%7 = alloca i32*
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8**
%12 = alloca i8**
store i32* %0, i32** %7
store i8* %1, i8** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%13 = load i32, i32* @ENOSYS
store i32 %13, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawnp(i32* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i8** nocapture readnone %4, i8** nocapture readnone %5) {
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printasterisks(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Inserte número\n");
  scanf("%d", &n);
  printasterisks(n);
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Inserte n\C3\BAmero\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 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 i32 @printasterisks(i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [16 x i8] c"Inserte n\C3\BAmero\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printasterisks(i32 %5)
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/);
int /*<<< orphan*/ lstat(char *, struct stat *);
int /*<<< orphan*/ open_rdonly(char *);
int /*<<< orphan*/ symlink(char *, char *);
int execute_lstat() {
  struct stat fileStat;
  close(open_rdonly("syscalls.txt"));
  symlink("syscalls.txt", "syscalls.symlink");
  lstat("syscalls.symlink", &fileStat);
  return 0;
}


x86 assembly (clang, -O0):
<execute_lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%edi
call   1050 <close@plt>
lea    0xe9e(%rip),%rdi
lea    0xea4(%rip),%rsi
call   1040 <symlink@plt>
lea    0xe98(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <lstat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_lstat>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
mov    %r14,%rdi
call   1030 <open_rdonly@plt>
mov    %eax,%edi
call   1050 <close@plt>
lea    0xeac(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <symlink@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <lstat@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
@.str.1 = [17 x i8] c"syscalls.symlink\00"
define i32 @execute_lstat() {
%1 = alloca %struct.stat
%2 = call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @close(i32 %2)
%4 = call i32 @symlink(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @lstat(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [13 x i8] c"syscalls.txt\00"
@.str.1 = [17 x i8] c"syscalls.symlink\00"
define i32 @execute_lstat() {
%1 = alloca %struct.stat
%2 = bitcast %struct.stat* %1 to i8*
%3 = tail call i32 @open_rdonly(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @close(i32 %3)
%5 = tail call i32 @symlink(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @lstat(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), %struct.stat* %1)
ret i32 0
}
void lpm_arch_begin_awake(void) {}


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

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

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

LLVM IR (-O2):
define void @lpm_arch_begin_awake() {
ret void
}
/* Variables and functions */
int close(int);
int ysocket_close(int socketfd) { return close(socketfd); }


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

x86 assembly (clang, -O2):
<ysocket_close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define i32 @ysocket_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ sendHeader(int /*<<< orphan*/, char);
void processEof() { sendHeader(0, '.'); }


x86 assembly (clang, -O0):
<processEof>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x2e,%esi
call   1030 <sendHeader@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<processEof>:
xor    %edi,%edi
mov    $0x2e,%esi
jmp    1030 <sendHeader@plt>

LLVM IR (-O0):
define void @processEof() {
%1 = call i32 @sendHeader(i32 0, i8 signext 46)
ret void
}

LLVM IR (-O2):
define void @processEof() {
%1 = tail call i32 @sendHeader(i32 0, i8 signext 46)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ SVCXPRT;

/* Variables and functions */
int /*<<< orphan*/ AUTH_TOOWEAK;
int /*<<< orphan*/ svcerr_auth(int /*<<< orphan*/ *, int /*<<< orphan*/);
void svcerr_weakauth(SVCXPRT *xprt) { svcerr_auth(xprt, AUTH_TOOWEAK); }


x86 assembly (clang, -O0):
<svcerr_weakauth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <svcerr_auth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<svcerr_weakauth>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <svcerr_auth@plt>

LLVM IR (-O0):
@AUTH_TOOWEAK = global i32 0
define void @svcerr_weakauth(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @AUTH_TOOWEAK
%5 = call i32 @svcerr_auth(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@AUTH_TOOWEAK = global i32 0
define void @svcerr_weakauth(i32* %0) {
%2 = load i32, i32* @AUTH_TOOWEAK
%3 = tail call i32 @svcerr_auth(i32* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void output_try_help(const char *name) {
  fprintf(stderr, "Try \'%s --help\' for more information.\n", name);
}


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

x86 assembly (clang, -O2):
<output_try_help>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Try '%s --help' for more information.\0A\00"
define void @output_try_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Try '%s --help' for more information.\0A\00"
define void @output_try_help(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int _plibc_syscall(int, int /*<<< orphan*/, int);
int kill(pid_t pid, int sig) { return _plibc_syscall(62, pid, sig); }


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

x86 assembly (clang, -O2):
<kill>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x3e,%edi
jmp    1030 <_plibc_syscall@plt>

LLVM IR (-O0):
define i32 @kill(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* %4
%7 = call i32 @_plibc_syscall(i32 62, i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @kill(i32 %0, i32 %1) {
%3 = tail call i32 @_plibc_syscall(i32 62, i32 %0, i32 %1)
ret i32 %3
}
int psh_builtin_count() { return 4; }


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

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

LLVM IR (-O0):
define i32 @psh_builtin_count() {
ret i32 4
}

LLVM IR (-O2):
define i32 @psh_builtin_count() {
ret i32 4
}
void input_error(num, str, lineno) int num;
char *str;
unsigned long lineno;
{ error("Error at input line %lu: %s", lineno, str); }


x86 assembly (clang, -O0):
<input_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_error>:
mov    %rsi,%rax
lea    0xee6(%rip),%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Error at input line %lu: %s\00"
define void @input_error(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = load i8*, i8** %5
%9 = call i32 (i8*, i64, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i64, i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Error at input line %lu: %s\00"
define void @input_error(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 (i8*, i64, i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, i64, i8*, ...)*)(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %2, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void byRef(int *x) { printf("byRef(ptr to %i)\n", *x); }


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

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

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

LLVM IR (-O2):
@.str = [18 x i8] c"byRef(ptr to %i)\0A\00"
define void @byRef(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
int max(int one, int two) { return one > two ? one : two; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @max(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* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void PDMR3UsbDetachDevice(void) {}


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

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

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

LLVM IR (-O2):
define void @PDMR3UsbDetachDevice() {
ret void
}
int task_source_prepare() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @task_source_prepare() {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ pidigits(int);
int main(int argc, char **argv) {
  pidigits(argc > 1 ? atoi(argv[1]) : 27);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1155 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x42>
mov    $0x1b,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <main+0x42>
mov    -0x14(%rbp),%edi
call   1030 <pidigits@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x1b,%edi
cmp    $0x2,%eax
jl     1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <pidigits@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atoi(i8* %11)
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %8
%15 = phi i32 [ %12, %8 ], [ 27, %13 ]
%16 = call i32 @pidigits(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 27, %2 ]
%10 = tail call i32 @pidigits(i32 %9)
ret i32 0
}
int fig_5(int figlen, unsigned char *fig) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fig_5(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
void xxx(int argc) {
  int x;
#pragma omp parallel master taskloop simd
  for (int i = 0; i < 10; ++i)
    argc = x;
}


x86 assembly (clang, -O0):
<xxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    112c <xxx+0x2c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <xxx+0xe>
pop    %rbp
ret

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

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

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