xunge/DecIR huggingface dataset:
double cadd(double a, double b) { return a + b; }


x86 assembly (clang, -O0):
<cadd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cadd>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @cadd(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 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @cadd(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int cli_history(struct cli_def *, char const *, char **, int);
int cli_int_history(struct cli_def *cli,
                    const char *command __attribute__((unused)),
                    char *argv[] __attribute__((unused)),
                    int argc __attribute__((unused))) {
  return cli_history(cli, command, argv, argc);
}


x86 assembly (clang, -O0):
<cli_int_history>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <cli_history@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_int_history>:
jmp    1030 <cli_history@plt>

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

LLVM IR (-O2):
%struct.cli_def = type { i32 }
define i32 @cli_int_history(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3) {
%5 = tail call i32 @cli_history(%struct.cli_def* %0, i8* %1, i8** %2, i32 %3)
ret i32 %5
}
void ata_force_cbl(struct ata_port *ap) {}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_force_cbl(%struct.ata_port* nocapture %0) {
ret void
}
int my_open(name, flags, mode)
char *name;
int flags, mode;
{ return open(name, flags, mode); }


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

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

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

LLVM IR (-O2):
define i32 @my_open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
int ascii_toupper(int c) {
  if ('a' <= c && c <= 'z')
    return c & ~32;
  return c;
}


x86 assembly (clang, -O0):
<ascii_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x61,%eax
cmp    -0x8(%rbp),%eax
jg     112d <ascii_toupper+0x2d>
cmpl   $0x7a,-0x8(%rbp)
jg     112d <ascii_toupper+0x2d>
mov    -0x8(%rbp),%eax
and    $0xffffffdf,%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <ascii_toupper+0x33>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_toupper>:
lea    -0x61(%rdi),%ecx
mov    %edi,%eax
and    $0xffffffdf,%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ascii_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 97, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = and i32 %10, -33
store i32 %11, i32* %2
br label %14
12: ; preds = %6, %1
%13 = load i32, i32* %3
store i32 %13, i32* %2
br label %14
14: ; preds = %12, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ascii_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = and i32 %0, -33
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void u16_to_le(uint8_t *dst, uint16_t u16) {
  dst[1] = (u16 >> 8) & 0xFF;
  dst[0] = u16 & 0xFF;
}


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

x86 assembly (clang, -O2):
<u16_to_le>:
mov    %esi,%eax
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
movzbl %al,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @u16_to_le(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 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %7, i32* %9
%10 = load i32, i32* %4
%11 = and i32 %10, 255
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @u16_to_le(i32* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %4, i32* %5
%6 = and i32 %1, 255
store i32 %6, i32* %0
ret void
}
int GetDataWidth(int w) { return (w + 63) & ~63; }


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

x86 assembly (clang, -O2):
<GetDataWidth>:
lea    0x3f(%rdi),%eax
and    $0xffffffc0,%eax
ret

LLVM IR (-O0):
define i32 @GetDataWidth(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 63
%5 = and i32 %4, -64
ret i32 %5
}

LLVM IR (-O2):
define i32 @GetDataWidth(i32 %0) {
%2 = add nsw i32 %0, 63
%3 = and i32 %2, -64
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
int main() {
  volatile unsigned char array[16345];
  array[0] = 1;
  usleep(2000000);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [16345 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [16345 x i8], [16345 x i8]* %2, i64 0, i64 0
store volatile i8 1, i8* %3
%4 = call i32 @usleep(i32 2000000)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i8
store volatile i8 1, i8* %1
%2 = tail call i32 @usleep(i32 2000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_est_date_ini(char *est_ini) {
  write("json-task.json", "\"estimated-start-date\":\"%s\", ", est_ini);
}


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

x86 assembly (clang, -O2):
<function_est_date_ini>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [30 x i8] c"\22estimated-start-date\22:\22%s\22, \00"
define void @function_est_date_ini(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [30 x i8] c"\22estimated-start-date\22:\22%s\22, \00"
define void @function_est_date_ini(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct gges_bnf_grammar {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *lookup_non_terminal(struct gges_bnf_grammar *, char *);
bool gges_grammar_has_non_terminal(struct gges_bnf_grammar *g, char *key) {
  return lookup_non_terminal(g, key) != NULL;
}


x86 assembly (clang, -O0):
<gges_grammar_has_non_terminal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <lookup_non_terminal@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gges_grammar_has_non_terminal>:
push   %rax
call   1030 <lookup_non_terminal@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gges_bnf_grammar = type { i32 }
define i32 @gges_grammar_has_non_terminal(%struct.gges_bnf_grammar* %0, i8* %1) {
%3 = alloca %struct.gges_bnf_grammar*
%4 = alloca i8*
store %struct.gges_bnf_grammar* %0, %struct.gges_bnf_grammar** %3
store i8* %1, i8** %4
%5 = load %struct.gges_bnf_grammar*, %struct.gges_bnf_grammar** %3
%6 = load i8*, i8** %4
%7 = call i32* @lookup_non_terminal(%struct.gges_bnf_grammar* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.gges_bnf_grammar = type { i32 }
define i32 @gges_grammar_has_non_terminal(%struct.gges_bnf_grammar* %0, i8* %1) {
%3 = tail call i32* @lookup_non_terminal(%struct.gges_bnf_grammar* %0, i8* %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
void XtUnmapWidget() {}


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

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

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

LLVM IR (-O2):
define void @XtUnmapWidget() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int test2func2(void) {
  printf("This is another function in the second object\n");
  return (2);
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"This is another function in the second object\0A\00"
define i32 @test2func2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@str = [46 x i8] c"This is another function in the second object\00"
define i32 @test2func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void showcommandshelp() {
  printf("Please see XDA-Developers wiki for the list of available commands\n");
  printf("http://wiki.xda-developers.com/\n\n");
}


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

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

LLVM IR (-O0):
@.str = [67 x i8] c"Please see XDA-Developers wiki for the list of available commands\0A\00"
@.str.1 = [34 x i8] c"http://wiki.xda-developers.com/\0A\0A\00"
define void @showcommandshelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [66 x i8] c"Please see XDA-Developers wiki for the list of available commands\00"
@str.2 = [33 x i8] c"http://wiki.xda-developers.com/\0A\00"
define void @showcommandshelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *prog) {
  printf("Usage: %s [OPTIONS] DIRECTORY\n\nOPTIONS are:\n  -h, --help .... "
         "usage\n  -q, --quiet ... do not print mountpoints\n",
         prog);
}


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

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

LLVM IR (-O0):
@.str = [112 x i8] c"Usage: %s [OPTIONS] DIRECTORY\0A\0AOPTIONS are:\0A -h, --help .... usage\0A -q, --quiet ... do not print mountpoints\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [112 x i8] c"Usage: %s [OPTIONS] DIRECTORY\0A\0AOPTIONS are:\0A -h, --help .... usage\0A -q, --quiet ... do not print mountpoints\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([112 x i8], [112 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int rand();
int randombounds(int a, int b) {
  if (b < a)
    return randombounds(b, a);
  if (b == a)
    return b;
  return a + rand() % (b - a + 1);
}


x86 assembly (clang, -O0):
<randombounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114d <randombounds+0x2d>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <randombounds@plt>
mov    %eax,-0x4(%rbp)
jmp    1185 <randombounds+0x65>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1164 <randombounds+0x44>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <randombounds+0x65>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    -0x10(%rbp),%eax
add    %edx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randombounds>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%ebp
mov    %edi,%ebx
mov    %ebp,%edi
sub    %ebx,%ebp
jl     1120 <randombounds+0x10>
je     113b <randombounds+0x2b>
xor    %eax,%eax
call   1030 <rand@plt>
add    $0x1,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randombounds(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = call i32 @randombounds(i32 %10, i32 %11)
store i32 %12, i32* %3
br label %28
13: ; preds = %2
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i32, i32* %5
store i32 %18, i32* %3
br label %28
19: ; preds = %13
%20 = load i32, i32* %4
%21 = call i32 (...) @rand()
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = sub nsw i32 %22, %23
%25 = add nsw i32 %24, 1
%26 = srem i32 %21, %25
%27 = add nsw i32 %20, %26
store i32 %27, i32* %3
br label %28
28: ; preds = %19, %17, %9
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @randombounds(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %4, %3 ]
%6 = icmp slt i32 %5, %4
br i1 %6, label %3, label %7
7: ; preds = %3
%8 = icmp eq i32 %5, %4
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = tail call i32 (...) @rand()
%11 = sub i32 1, %4
%12 = add i32 %11, %5
%13 = srem i32 %10, %12
%14 = add nsw i32 %13, %4
br label %15
15: ; preds = %7, %9
%16 = phi i32 [ %14, %9 ], [ %4, %7 ]
ret i32 %16
}
int mseq() {
  static int x = 0x55555555;
  register int x0, x28;
  x >>= 1;
  if (x & 0x00000001)
    x0 = 1;
  else
    x0 = -1;
  if (x & 0x10000000)
    x28 = 1;
  else
    x28 = -1;
  if (x0 + x28)
    x &= 0x7fffffff;
  else
    x |= 0x80000000;
  return (x0);
}


x86 assembly (clang, -O0):
<mseq>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
sar    $0x1,%eax
mov    %eax,0x2f0d(%rip)
mov    0x2f07(%rip),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1131 <mseq+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1138 <mseq+0x38>
movl   $0xffffffff,-0x4(%rbp)
mov    0x2ee2(%rip),%eax
and    $0x10000000,%eax
cmp    $0x0,%eax
je     1158 <mseq+0x58>
movl   $0x1,-0x8(%rbp)
jmp    115f <mseq+0x5f>
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x0,%eax
je     1184 <mseq+0x84>
mov    0x2eac(%rip),%eax
and    $0x7fffffff,%eax
mov    %eax,0x2ea1(%rip)
jmp    1195 <mseq+0x95>
mov    0x2e96(%rip),%eax
or     $0x80000000,%eax
mov    %eax,0x2e8b(%rip)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mseq>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
and    $0x2,%eax
cmp    $0x1,%eax
sbb    %eax,%eax
or     $0x1,%eax
mov    %ecx,%edx
and    $0x20000000,%edx
neg    %edx
sbb    %edx,%edx
or     $0x1,%edx
xor    %esi,%esi
cmp    %edx,%eax
sete   %sil
shld   $0x1f,%ecx,%esi
mov    %esi,0x2eec(%rip)
ret

LLVM IR (-O0):
@mseq.x = internal global i32 1431655765
define i32 @mseq() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @mseq.x
%4 = ashr i32 %3, 1
store i32 %4, i32* @mseq.x
%5 = load i32, i32* @mseq.x
%6 = and i32 %5, 1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 -1, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* @mseq.x
%12 = and i32 %11, 268435456
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 1, i32* %2
br label %16
15: ; preds = %10
store i32 -1, i32* %2
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = add nsw i32 %17, %18
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %16
%22 = load i32, i32* @mseq.x
%23 = and i32 %22, 2147483647
store i32 %23, i32* @mseq.x
br label %27
24: ; preds = %16
%25 = load i32, i32* @mseq.x
%26 = or i32 %25, -2147483648
store i32 %26, i32* @mseq.x
br label %27
27: ; preds = %24, %21
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@mseq.x = internal unnamed_addr global i32 1431655765
define i32 @mseq() {
%1 = load i32, i32* @mseq.x
%2 = lshr i32 %1, 1
%3 = and i32 %1, 2
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -1, i32 1
%6 = and i32 %1, 536870912
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i32 1, i32 -1
%9 = icmp eq i32 %5, %8
%10 = select i1 %9, i32 -2147483648, i32 0
%11 = or i32 %10, %2
store i32 %11, i32* @mseq.x
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ do_fts(char const *);
int main(int argc, const char **argv) {
  for (int i = 1; i < argc; ++i) {
    do_fts(argv[i]);
  }
  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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1158 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <do_fts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1142 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1030 <do_fts@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @do_fts(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
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 %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 1, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @do_fts(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
void test_before_each_dummy_ulWrxnsWbplaOTpA(void) { return; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @wakeupvpn() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void blocking_disable(int fd) {
  fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<blocking_disable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    0x2eb0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    %eax,%edx
mov    0x2e99(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blocking_disable>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ebc(%rip),%rax
mov    (%rax),%ebp
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eb3(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %ebp,%esi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @blocking_disable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* %2
%6 = load i32, i32* @F_GETFL
%7 = call i32 @fcntl(i32 %5, i32 %6, i32 0)
%8 = load i32, i32* @O_NONBLOCK
%9 = or i32 %7, %8
%10 = call i32 @fcntl(i32 %3, i32 %4, i32 %9)
ret void
}

LLVM IR (-O2):
@F_SETFL = global i32 0
@F_GETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @blocking_disable(i32 %0) {
%2 = load i32, i32* @F_SETFL
%3 = load i32, i32* @F_GETFL
%4 = tail call i32 @fcntl(i32 %0, i32 %3, i32 0)
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %4
%7 = tail call i32 @fcntl(i32 %0, i32 %2, i32 %6)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fflush(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundmpx_fflush(FILE *stream) {
  return fflush(stream);
}


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

x86 assembly (clang, -O2):
<softboundmpx_fflush>:
jmp    1030 <fflush@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_fflush(i32* %0) {
%2 = tail call i32 @fflush(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ put_integer(int, char **);
void finish_msg(char *start, char *end) {
  int size;
  size = end - start;
  start += 4;
  put_integer(size, &start);
}


x86 assembly (clang, -O0):
<finish_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x8(%rbp),%rsi
call   1030 <put_integer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<finish_msg>:
push   %rax
mov    %rsi,%rax
sub    %edi,%eax
add    $0x4,%rdi
mov    %rdi,(%rsp)
mov    %rsp,%rsi
mov    %eax,%edi
call   1030 <put_integer@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @finish_msg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i8*, i8** %3
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 4
store i8* %13, i8** %3
%14 = load i32, i32* %5
%15 = call i32 @put_integer(i32 %14, i8** %3)
ret void
}

LLVM IR (-O2):
define void @finish_msg(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = ptrtoint i8* %1 to i64
%5 = ptrtoint i8* %0 to i64
%6 = sub i64 %4, %5
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds i8, i8* %0, i64 4
store i8* %8, i8** %3
%9 = call i32 @put_integer(i32 %7, i8** %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, int const, char const *);
void keymap_parse_error(const int line, const char *msg) {
  fatal("Parse error in the keymap file line %d: %s", line, msg);
}


x86 assembly (clang, -O0):
<keymap_parse_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xed3(%rip),%rdi
call   1030 <fatal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keymap_parse_error>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <fatal@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Parse error in the keymap file line %d: %s\00"
define void @keymap_parse_error(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @fatal(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Parse error in the keymap file line %d: %s\00"
define void @keymap_parse_error(i32 %0, i8* %1) {
%3 = tail call i32 @fatal(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
void abcd5efghijklmnopqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcd5efghijklmnopqrstuvwxzy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ client_world_destroy();
void client_world_shutdown() { client_world_destroy(); }


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

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

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

LLVM IR (-O2):
define void @client_world_shutdown() {
%1 = tail call i32 (...) @client_world_destroy()
ret void
}
char *s_let(char *from, char *to) {
  register char *t = to;
  while ((*t++ = *from++) != 0)
    ;
  return (to);
}


x86 assembly (clang, -O0):
<s_let>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     1147 <s_let+0x47>
jmp    1114 <s_let+0x14>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_let>:
mov    %rsi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rdi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <s_let+0x10>
ret

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

LLVM IR (-O2):
define i8* @s_let(i8* nocapture %0, i8* returned writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %6, %3 ]
%5 = phi i8* [ %1, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %1
}
double _nearest_kernel(double x) {
  if (x < 0.5 && x >= -0.5)
    return 1.0;
  return 0;
}


x86 assembly (clang, -O0):
<_nearest_kernel>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1145 <_nearest_kernel+0x45>
movsd  -0x10(%rbp),%xmm0
movsd  0xedf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1145 <_nearest_kernel+0x45>
movsd  0xed5(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114d <_nearest_kernel+0x4d>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nearest_kernel>:
movsd  0xef8(%rip),%xmm1
cmplesd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm2
andpd  %xmm1,%xmm2
cmpltsd 0xeee(%rip),%xmm0
andpd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @_nearest_kernel(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp olt double %4, 5.000000e-01
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fcmp oge double %7, -5.000000e-01
br i1 %8, label %9, label %10
9: ; preds = %6
store double 1.000000e+00, double* %2
br label %11
10: ; preds = %6, %1
store double 0.000000e+00, double* %2
br label %11
11: ; preds = %10, %9
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @_nearest_kernel(double %0) {
%2 = fcmp olt double %0, 5.000000e-01
%3 = fcmp oge double %0, -5.000000e-01
%4 = and i1 %2, %3
%5 = select i1 %4, double 1.000000e+00, double 0.000000e+00
ret double %5
}
RX0RX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[x0]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0RX1>:
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    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114b <RX0RX1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <RX0RX1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0RX1>:
movslq %edx,%rax
movzwl (%r8,%rax,2),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,2),%dx
setbe  %al
ret

LLVM IR (-O0):
define i32 @RX0RX1(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** %12
%17 = load i32, i32* %10
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i16, i16* %16, i64 %18
%20 = load i16, i16* %19
%21 = zext i16 %20 to i32
%22 = load i16*, i16** %13
%23 = load i32, i32* %11
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i16, i16* %22, i64 %24
%26 = load i16, i16* %25
%27 = zext i16 %26 to i32
%28 = icmp sle i32 %21, %27
br i1 %28, label %29, label %30
29: ; preds = %6
store i32 1, i32* %7
br label %31
30: ; preds = %6
store i32 0, i32* %7
br label %31
31: ; preds = %30, %29
%32 = load i32, i32* %7
ret i32 %32
}

LLVM IR (-O2):
define i32 @RX0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i16, i16* %4, i64 %7
%9 = load i16, i16* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i16, i16* %5, i64 %10
%12 = load i16, i16* %11
%13 = icmp ule i16 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
struct fid_ep {
  int dummy;
};
struct fid_domain {
  int dummy;
};
struct fi_rx_attr {
  int dummy;
};

/* Variables and functions */
int gnix_srx_context(struct fid_domain *, struct fi_rx_attr *, struct fid_ep **,
                     void *);
int fi_srx_context(struct fid_domain *domain, struct fi_rx_attr *attr,
                   struct fid_ep **rx_ep, void *context) {
  return gnix_srx_context(domain, attr, rx_ep, context);
}


x86 assembly (clang, -O0):
<fi_srx_context>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <gnix_srx_context@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fi_srx_context>:
jmp    1030 <gnix_srx_context@plt>

LLVM IR (-O0):
%struct.fid_domain = type { i32 }
%struct.fi_rx_attr = type { i32 }
%struct.fid_ep = type { i32 }
define i32 @fi_srx_context(%struct.fid_domain* %0, %struct.fi_rx_attr* %1, %struct.fid_ep** %2, i8* %3) {
%5 = alloca %struct.fid_domain*
%6 = alloca %struct.fi_rx_attr*
%7 = alloca %struct.fid_ep**
%8 = alloca i8*
store %struct.fid_domain* %0, %struct.fid_domain** %5
store %struct.fi_rx_attr* %1, %struct.fi_rx_attr** %6
store %struct.fid_ep** %2, %struct.fid_ep*** %7
store i8* %3, i8** %8
%9 = load %struct.fid_domain*, %struct.fid_domain** %5
%10 = load %struct.fi_rx_attr*, %struct.fi_rx_attr** %6
%11 = load %struct.fid_ep**, %struct.fid_ep*** %7
%12 = load i8*, i8** %8
%13 = call i32 @gnix_srx_context(%struct.fid_domain* %9, %struct.fi_rx_attr* %10, %struct.fid_ep** %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.fid_domain = type { i32 }
%struct.fi_rx_attr = type { i32 }
%struct.fid_ep = type { i32 }
define i32 @fi_srx_context(%struct.fid_domain* %0, %struct.fi_rx_attr* %1, %struct.fid_ep** %2, i8* %3) {
%5 = tail call i32 @gnix_srx_context(%struct.fid_domain* %0, %struct.fi_rx_attr* %1, %struct.fid_ep** %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
int strlen(char *);
char *rna(char *dna) {
  int len = strlen(dna);
  return dna;
}


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

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

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

LLVM IR (-O2):
define i8* @rna(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i8* %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) int is_dp_other(uint32_t op) {
  return !((op & 0x0FB00000) ^ 0x01000000);
}


x86 assembly (clang, -O0):
<is_dp_other>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfb00000,%eax
xor    $0x1000000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dp_other>:
and    $0xfb00000,%edi
xor    %eax,%eax
cmp    $0x1000000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @is_dp_other(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 263192576
%5 = xor i32 %4, 16777216
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_dp_other(i32 %0) {
%2 = and i32 %0, 263192576
%3 = icmp eq i32 %2, 16777216
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void do_prefetch_abort(void) { puts("BAD\n"); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"BAD\0A\00"
define void @do_prefetch_abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ baz(int, int, int);
int /*<<< orphan*/ foobar(int, int);
int main() {
  foobar(0x0eadbeef, 0x0eedfeed);
  baz(1, 2, 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xeadbeef,%edi
mov    $0xeedfeed,%esi
call   1040 <foobar@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <baz@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xeadbeef,%edi
mov    $0xeedfeed,%esi
call   1040 <foobar@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <baz@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 246267631, i32 250478317)
%2 = tail call i32 @baz(i32 1, i32 2, i32 3)
ret i32 0
}
/* Variables and functions */
int maxProduct(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char const *argv[]) {
  int a[] = {2, 3, -2, 4};
  int res = maxProduct(a, 4);
  printf("res = %d\n", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x4,%esi
call   1040 <maxProduct@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x4,%esi
call   1040 <maxProduct@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [4 x i32] [i32 2, i32 3, i32 -2, i32 4]
@.str = [10 x i8] c"res = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i32]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [4 x i32]* %6 to i8*
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%10 = call i32 @maxProduct(i32* %9, i32 4)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [4 x i32] [i32 2, i32 3, i32 -2, i32 4]
@.str = [10 x i8] c"res = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @maxProduct(i32* %5, i32 4)
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Type definitions */
struct buff {
  int dummy;
};

/* Variables and functions */
int buff_copy_to(struct buff *, void const *, size_t);
int serialize_bytes(struct buff *dst, const void *src, size_t len) {
  return buff_copy_to(dst, src, len);
}


x86 assembly (clang, -O0):
<serialize_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <buff_copy_to@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serialize_bytes>:
jmp    1030 <buff_copy_to@plt>

LLVM IR (-O0):
%struct.buff = type { i32 }
define i32 @serialize_bytes(%struct.buff* %0, i8* %1, i64 %2) {
%4 = alloca %struct.buff*
%5 = alloca i8*
%6 = alloca i64
store %struct.buff* %0, %struct.buff** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load %struct.buff*, %struct.buff** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @buff_copy_to(%struct.buff* %7, i8* %8, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.buff = type { i32 }
define i32 @serialize_bytes(%struct.buff* %0, i8* %1, i64 %2) {
%4 = tail call i32 @buff_copy_to(%struct.buff* %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *slice_abnf_subset(const char *abnf, int start_pos, int end_pos) {
  int subset_len = end_pos - start_pos;
  int subset_bytes = (subset_len + 1) * sizeof(char);
  char *abnf_subset = malloc(subset_bytes);
  strncpy(abnf_subset, abnf + start_pos, subset_len);
  return abnf_subset;
}


x86 assembly (clang, -O0):
<slice_abnf_subset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slice_abnf_subset>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r15d
mov    %rdi,%r14
sub    %esi,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
movslq %r15d,%rsi
add    %r14,%rsi
mov    %rax,%rdi
mov    %ebx,%edx
call   1030 <strncpy@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @slice_abnf_subset(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %6
%11 = load i32, i32* %5
%12 = sub nsw i32 %10, %11
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = add nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = mul i64 %15, 1
%17 = trunc i64 %16 to i32
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = call i8* @malloc(i32 %18)
store i8* %19, i8** %9
%20 = load i8*, i8** %9
%21 = load i8*, i8** %4
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i32, i32* %7
%26 = call i32 @strncpy(i8* %20, i8* %24, i32 %25)
%27 = load i8*, i8** %9
ret i8* %27
}

LLVM IR (-O2):
define i8* @slice_abnf_subset(i8* %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = add nsw i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @strncpy(i8* %6, i8* %8, i32 %4)
ret i8* %6
}