xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sse4_1_test();
void __attribute__((no)) do_test(void) { sse4_1_test(); }


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

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

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

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @sse4_1_test()
ret void
}
int func2(int a, int b) { return b - a; }


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

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

LLVM IR (-O0):
define i32 @func2(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 = load i32, i32* %3
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @func2(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getTimeStr();
int /*<<< orphan*/ printf(char *, char *);
void printTime() {
  char *aux = getTimeStr();
  printf("\r"
         "\033[1m"
         "%s: "
         "\033[0m",
         aux);
  free(aux);
}


x86 assembly (clang, -O0):
<printTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getTimeStr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printTime>:
push   %rbx
xor    %eax,%eax
call   1050 <getTimeStr@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0D\1B[1m%s: \1B[0m\00"
define void @printTime() {
%1 = alloca i8*
%2 = call i8* (...) @getTimeStr()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0D\1B[1m%s: \1B[0m\00"
define void @printTime() {
%1 = tail call i8* (...) @getTimeStr()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret void
}
char *langRomTypeCasPatch() { return "Normal + Cassette Patch"; }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Normal + Cassette Patch\00"
define i8* @langRomTypeCasPatch() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [24 x i8] c"Normal + Cassette Patch\00"
define i8* @langRomTypeCasPatch() {
ret i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ gotoroom(char *);
int /*<<< orphan*/ warnx(char *);
void teleport(int argc, char *argv[]) {
  if (argc < 2) {
    warnx("Where do you want to teleport?");
    return;
  }
  if (argc > 2) {
    warnx("You cannot teleport to more than one place at once!");
    return;
  }
  gotoroom(argv[1]);
}


x86 assembly (clang, -O0):
<teleport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    114a <teleport+0x2a>
lea    0xec0(%rip),%rdi
call   1030 <warnx@plt>
jmp    1172 <teleport+0x52>
cmpl   $0x2,-0x4(%rbp)
jle    1165 <teleport+0x45>
lea    0xec4(%rip),%rdi
call   1030 <warnx@plt>
jmp    1172 <teleport+0x52>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <gotoroom@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<teleport>:
cmp    $0x1,%edi
jg     1131 <teleport+0x11>
lea    0xed4(%rip),%rdi
jmp    1030 <warnx@plt>
cmp    $0x2,%edi
jne    113f <teleport+0x1f>
mov    0x8(%rsi),%rdi
jmp    1040 <gotoroom@plt>
lea    0xed9(%rip),%rdi
jmp    1030 <warnx@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"Where do you want to teleport?\00"
@.str.1 = [52 x i8] c"You cannot teleport to more than one place at once!\00"
define void @teleport(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %19
9: ; preds = %2
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @warnx(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
br label %19
14: ; preds = %9
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @gotoroom(i8* %17)
br label %19
19: ; preds = %14, %12, %7
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"Where do you want to teleport?\00"
@.str.1 = [52 x i8] c"You cannot teleport to more than one place at once!\00"
define void @teleport(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %14
6: ; preds = %2
%7 = icmp eq i32 %0, 2
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @warnx(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0))
br label %14
10: ; preds = %6
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @gotoroom(i8* %12)
br label %14
14: ; preds = %10, %8, %4
ret void
}
/* Type definitions */
struct s_crypto {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cryptoRand(unsigned char *, int);
int cryptoSetKeys(struct s_crypto *, int const, unsigned char *, int,
                  unsigned char *, int);
int cryptoSetKeysRandom(struct s_crypto *ctxs, const int count) {
  unsigned char buf_a[256];
  unsigned char buf_b[256];
  cryptoRand(buf_a, 256);
  cryptoRand(buf_b, 256);
  return cryptoSetKeys(ctxs, count, buf_a, 256, buf_b, 256);
}


x86 assembly (clang, -O0):
<cryptoSetKeysRandom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <cryptoRand@plt>
lea    -0x210(%rbp),%rdi
mov    $0x100,%esi
call   1040 <cryptoRand@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x110(%rbp),%rdx
lea    -0x210(%rbp),%r8
mov    $0x100,%r9d
mov    %r9d,%ecx
call   1030 <cryptoSetKeys@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cryptoSetKeysRandom>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <cryptoRand@plt>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x100,%esi
call   1040 <cryptoRand@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    $0x100,%ecx
mov    %r15,%r8
mov    $0x100,%r9d
call   1030 <cryptoSetKeys@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.s_crypto = type { i32 }
define i32 @cryptoSetKeysRandom(%struct.s_crypto* %0, i32 %1) {
%3 = alloca %struct.s_crypto*
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
store %struct.s_crypto* %0, %struct.s_crypto** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = call i32 @cryptoRand(i8* %7, i32 256)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%10 = call i32 @cryptoRand(i8* %9, i32 256)
%11 = load %struct.s_crypto*, %struct.s_crypto** %3
%12 = load i32, i32* %4
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%15 = call i32 @cryptoSetKeys(%struct.s_crypto* %11, i32 %12, i8* %13, i32 256, i8* %14, i32 256)
ret i32 %15
}

LLVM IR (-O2):
%struct.s_crypto = type { i32 }
define i32 @cryptoSetKeysRandom(%struct.s_crypto* %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%7 = call i32 @cryptoRand(i8* %5, i32 256)
%8 = call i32 @cryptoRand(i8* %6, i32 256)
%9 = call i32 @cryptoSetKeys(%struct.s_crypto* %0, i32 %1, i8* %5, i32 256, i8* %6, i32 256)
ret i32 %9
}
void cbor_null_float2_callback(void *_ctx, float _val) {}


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

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

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

LLVM IR (-O2):
define void @cbor_null_float2_callback(i8* nocapture %0, float %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ my_hold(int *);
int *my_malloc(int);
void af3() {
  int *p = my_malloc(12);
  my_hold(p);
  free(p);
}


x86 assembly (clang, -O0):
<af3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc,%edi
call   1040 <my_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <my_hold@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<af3>:
push   %rbx
mov    $0xc,%edi
call   1040 <my_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <my_hold@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @af3() {
%1 = alloca i32*
%2 = call i32* @my_malloc(i32 12)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @my_hold(i32* %3)
%5 = load i32*, i32** %1
%6 = call i32 @free(i32* %5)
ret void
}

LLVM IR (-O2):
define void @af3() {
%1 = tail call i32* @my_malloc(i32 12)
%2 = tail call i32 @my_hold(i32* %1)
%3 = tail call i32 @free(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ direct();
void foo(void (*indirect)(void)) {
  indirect();
  direct();
}


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

x86 assembly (clang, -O2):
<foo>:
push   %rax
call   *%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <direct@plt>

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

LLVM IR (-O2):
define void @foo(void ()* nocapture %0) {
tail call void %0()
%2 = tail call i32 (...) @direct()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printer(char *b) { printf("%s", b); }


x86 assembly (clang, -O0):
<printer>:
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):
<printer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @printer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ int80(int, int /*<<< orphan*/, char *, int,
                         int /*<<< orphan*/, int /*<<< orphan*/);
void backspace() {
  char c = '\b';
  int80(1, 0, &c, 1, 0, 0);
}


x86 assembly (clang, -O0):
<backspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x8,-0x1(%rbp)
mov    $0x1,%ecx
xor    %r9d,%r9d
lea    -0x1(%rbp),%rdx
mov    %ecx,%edi
mov    %r9d,%esi
mov    %r9d,%r8d
call   1030 <int80@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backspace>:
push   %rax
movb   $0x8,0x7(%rsp)
lea    0x7(%rsp),%rdx
mov    $0x1,%edi
xor    %esi,%esi
mov    $0x1,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <int80@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @backspace() {
%1 = alloca i8
store i8 8, i8* %1
%2 = call i32 @int80(i32 1, i32 0, i8* %1, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @backspace() {
%1 = alloca i8
store i8 8, i8* %1
%2 = call i32 @int80(i32 1, i32 0, i8* %1, i32 1, i32 0, i32 0)
ret void
}
int cRosGentoolsSHA1(char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @cRosGentoolsSHA1(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Kon'nichiwa\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Kon'nichiwa\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Kon'nichiwa\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: lwm2mserver\r\n");
  fprintf(stderr, "Launch a LWM2M server on localhost port "
                  "5684"
                  ".\r\n\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xee6(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: lwm2mserver\0D\0A\00"
@.str.1 = [49 x i8] c"Launch a LWM2M server on localhost port 5684.\0D\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Usage: lwm2mserver\0D\0A\00"
@.str.1 = [49 x i8] c"Launch a LWM2M server on localhost port 5684.\0D\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void noTabixSupport(struct lineFile *lf, char *where) {}


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

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

LLVM IR (-O0):
%struct.lineFile = type opaque
define void @noTabixSupport(%struct.lineFile* %0, i8* %1) {
%3 = alloca %struct.lineFile*
%4 = alloca i8*
store %struct.lineFile* %0, %struct.lineFile** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.lineFile = type opaque
define void @noTabixSupport(%struct.lineFile* nocapture %0, i8* nocapture %1) {
ret void
}
unsigned char_one_of(char c, const char *of) {
  for (; *of != '\0'; of++) {
    if (c == *of) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<char_one_of>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1153 <char_one_of+0x53>
movsbl -0x5(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    113d <char_one_of+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    115a <char_one_of+0x5a>
jmp    1142 <char_one_of+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <char_one_of+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<char_one_of>:
mov    (%rsi),%cl
xor    %eax,%eax
test   %cl,%cl
je     1120 <char_one_of+0x20>
add    $0x1,%rsi
nopl   0x0(%rax)
cmp    %dil,%cl
je     1121 <char_one_of+0x21>
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <char_one_of+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @char_one_of(i8 signext %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = load i8, i8* %12
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %2, %5
%9 = phi i8 [ %6, %5 ], [ %3, %2 ]
%10 = phi i8* [ %12, %5 ], [ %1, %2 ]
%11 = icmp eq i8 %9, %0
%12 = getelementptr inbounds i8, i8* %10, i64 1
br i1 %11, label %13, label %5
13: ; preds = %8, %5, %2
%14 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %8 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ test_ascii();
int /*<<< orphan*/ test_convert();
int /*<<< orphan*/ test_iso1();
int /*<<< orphan*/ test_iso2();
int /*<<< orphan*/ test_utf8();
int main() {
  test_utf8();
  test_ascii();
  test_iso1();
  test_iso2();
  test_convert();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <test_utf8@plt>
mov    $0x0,%al
call   1050 <test_ascii@plt>
mov    $0x0,%al
call   1030 <test_iso1@plt>
mov    $0x0,%al
call   1070 <test_iso2@plt>
mov    $0x0,%al
call   1040 <test_convert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_utf8@plt>
xor    %eax,%eax
call   1050 <test_ascii@plt>
xor    %eax,%eax
call   1030 <test_iso1@plt>
xor    %eax,%eax
call   1070 <test_iso2@plt>
xor    %eax,%eax
call   1040 <test_convert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_utf8()
%3 = call i32 (...) @test_ascii()
%4 = call i32 (...) @test_iso1()
%5 = call i32 (...) @test_iso2()
%6 = call i32 (...) @test_convert()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_utf8()
%2 = tail call i32 (...) @test_ascii()
%3 = tail call i32 (...) @test_iso1()
%4 = tail call i32 (...) @test_iso2()
%5 = tail call i32 (...) @test_convert()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("entrez un nombre entier : ");
  scanf("%d", &n);
  printf("%d x %d = %d", n, n, n * n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%ecx
imul   %edx,%ecx
lea    0xecb(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"entrez un nombre entier : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"%d x %d = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = mul nsw i32 %7, %8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %6, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"entrez un nombre entier : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [13 x i8] c"%d x %d = %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 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 = mul nsw i32 %5, %5
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %5, i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ network_init();
int /*<<< orphan*/ sys_init();
int /*<<< orphan*/ tel_init();
int /*<<< orphan*/ term_init();
void init(void) {
  term_init();
  network_init();
  tel_init();
  sys_init();
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1060 <term_init@plt>
mov    $0x0,%al
call   1040 <network_init@plt>
mov    $0x0,%al
call   1050 <tel_init@plt>
mov    $0x0,%al
call   1030 <sys_init@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1060 <term_init@plt>
xor    %eax,%eax
call   1040 <network_init@plt>
xor    %eax,%eax
call   1050 <tel_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <sys_init@plt>

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @term_init()
%2 = call i32 (...) @network_init()
%3 = call i32 (...) @tel_init()
%4 = call i32 (...) @sys_init()
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @term_init()
%2 = tail call i32 (...) @network_init()
%3 = tail call i32 (...) @tel_init()
%4 = tail call i32 (...) @sys_init()
ret void
}
int test_imm_3Aint16_mem(short *val) {
  return ((*val) & (-0x3A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_3Aint16_mem>:
movzwl (%rdi),%eax
test   $0xffc6,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_3Aint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -58
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *metaphone(char const *);
float smith_waterman_gotoh_similarity(char *, char *);
float metaphone_similarity(const char *str1, const char *str2) {
  char *s1 = metaphone(str1);
  char *s2 = metaphone(str2);
  float res = smith_waterman_gotoh_similarity(s1, s2);
  free(s1);
  free(s2);
  return (res);
}


x86 assembly (clang, -O0):
<metaphone_similarity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <metaphone@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <metaphone@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <smith_waterman_gotoh_similarity@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movss  -0x24(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metaphone_similarity>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
call   1050 <metaphone@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1050 <metaphone@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %rax,%rsi
call   1040 <smith_waterman_gotoh_similarity@plt>
movss  %xmm0,0xc(%rsp)
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define float @metaphone_similarity(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i8* @metaphone(i8* %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %4
%11 = call i8* @metaphone(i8* %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call float @smith_waterman_gotoh_similarity(i8* %12, i8* %13)
store float %14, float* %7
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %6
%18 = call i32 @free(i8* %17)
%19 = load float, float* %7
ret float %19
}

LLVM IR (-O2):
define float @metaphone_similarity(i8* %0, i8* %1) {
%3 = tail call i8* @metaphone(i8* %0)
%4 = tail call i8* @metaphone(i8* %1)
%5 = tail call float @smith_waterman_gotoh_similarity(i8* %3, i8* %4)
%6 = tail call i32 @free(i8* %3)
%7 = tail call i32 @free(i8* %4)
ret float %5
}
void BIO_pop(void) {}


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

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

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

LLVM IR (-O2):
define void @BIO_pop() {
ret void
}
unsigned int init_project_version(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @init_project_version() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ query;

/* Variables and functions */
int RS400_sendbytes(unsigned char *, int);
int RS400_watchmode() {
  unsigned char query[] = {0x0a};
  return RS400_sendbytes(query, sizeof(query));
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <RS400_sendbytes@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
movb   $0xa,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <RS400_sendbytes@plt>
pop    %rcx
ret

LLVM IR (-O0):
@__const.RS400_watchmode.query = [1 x i8] c"\0A"
define i32 @RS400_watchmode() {
%1 = alloca [1 x i8]
%2 = bitcast [1 x i8]* %1 to i8*
%3 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%4 = call i32 @RS400_sendbytes(i8* %3, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @RS400_watchmode() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
store i8 10, i8* %2
%3 = call i32 @RS400_sendbytes(i8* %2, i32 1)
ret i32 %3
}
/* Type definitions */
struct oplist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ checkrep(struct oplist *);
int /*<<< orphan*/ cleanrep(struct oplist *);
int /*<<< orphan*/ matchloop(struct oplist *);
int /*<<< orphan*/ matchrep(struct oplist *);
struct oplist *readops(int);
struct oplist *parse(int fd) {
  struct oplist *ops = readops(fd);
  matchrep(ops);
  cleanrep(ops);
  checkrep(ops);
  matchloop(ops);
  return ops;
}


x86 assembly (clang, -O0):
<parse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <readops@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <matchrep@plt>
mov    -0x10(%rbp),%rdi
call   1050 <cleanrep@plt>
mov    -0x10(%rbp),%rdi
call   1070 <checkrep@plt>
mov    -0x10(%rbp),%rdi
call   1060 <matchloop@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse>:
push   %rbx
call   1040 <readops@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <matchrep@plt>
mov    %rbx,%rdi
call   1050 <cleanrep@plt>
mov    %rbx,%rdi
call   1070 <checkrep@plt>
mov    %rbx,%rdi
call   1060 <matchloop@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.oplist = type { i32 }
define %struct.oplist* @parse(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.oplist*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.oplist* @readops(i32 %4)
store %struct.oplist* %5, %struct.oplist** %3
%6 = load %struct.oplist*, %struct.oplist** %3
%7 = call i32 @matchrep(%struct.oplist* %6)
%8 = load %struct.oplist*, %struct.oplist** %3
%9 = call i32 @cleanrep(%struct.oplist* %8)
%10 = load %struct.oplist*, %struct.oplist** %3
%11 = call i32 @checkrep(%struct.oplist* %10)
%12 = load %struct.oplist*, %struct.oplist** %3
%13 = call i32 @matchloop(%struct.oplist* %12)
%14 = load %struct.oplist*, %struct.oplist** %3
ret %struct.oplist* %14
}

LLVM IR (-O2):
%struct.oplist = type { i32 }
define %struct.oplist* @parse(i32 %0) {
%2 = tail call %struct.oplist* @readops(i32 %0)
%3 = tail call i32 @matchrep(%struct.oplist* %2)
%4 = tail call i32 @cleanrep(%struct.oplist* %2)
%5 = tail call i32 @checkrep(%struct.oplist* %2)
%6 = tail call i32 @matchloop(%struct.oplist* %2)
ret %struct.oplist* %2
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s;
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @corta_string(i8* undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dapxsumors(int, double, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  double v = stdlib_strided_dapxsumors(N, 5.0, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x40(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
movl   $0x4,-0x44(%rbp)
movl   $0x2,-0x48(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%edx
movsd  0xe93(%rip),%xmm0
call   1040 <stdlib_strided_dapxsumors@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm0
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movsd  0xea5(%rip),%xmm0
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dapxsumors@plt>
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [8 x double]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dapxsumors(i32 %6, double 5.000000e+00, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [8 x double]
%2 = bitcast [8 x double]* %1 to i8*
%3 = getelementptr inbounds [8 x double], [8 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dapxsumors(i32 4, double 5.000000e+00, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ geteuid();
__attribute__((__weak__, __always___)) uid_t softboundcets_geteuid() {
  return geteuid();
}


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

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

LLVM IR (-O0):
define weak i32 @softboundcets_geteuid() {
%1 = call i32 (...) @geteuid()
ret i32 %1
}

LLVM IR (-O2):
define weak i32 @softboundcets_geteuid() {
%1 = tail call i32 (...) @geteuid()
ret i32 %1
}
float SLOW_OperatorSub(float a, float b) { return a - b; }


x86 assembly (clang, -O0):
<SLOW_OperatorSub>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<SLOW_OperatorSub>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @SLOW_OperatorSub(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @SLOW_OperatorSub(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
__attribute__((always_)) void invalidate_kernel_vmap_range(void *vaddr,
                                                           int size) {}


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

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

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

LLVM IR (-O2):
define void @invalidate_kernel_vmap_range(i8* nocapture %0, i32 %1) {
ret void
}
void __attribute__((visibility("hidden"))) foo() {}


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

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

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

LLVM IR (-O2):
define hidden void @foo() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int main(int argc, char *argv[]) {
  while (1) {
    foo();
  }
  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   1030 <foo@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <foo@plt>
jmp    1120 <main+0x10>

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
br label %6
6: ; preds = %2, %6
%7 = call i32 (...) @foo()
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 (...) @foo()
br label %3
}
/* Variables and functions */
bool includes(char c, char *s) {
  while (*s && c != *s) {
    s++;
  }
  return c == *s;
}


x86 assembly (clang, -O0):
<includes>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1136 <includes+0x36>
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1146 <includes+0x46>
jmp    1157 <includes+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <includes+0xe>
movsbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<includes>:
movzbl (%rsi),%ecx
test   %cl,%cl
je     1110 <includes+0x10>
add    $0x1,%rsi
cmp    %dil,%cl
jne    1100 <includes>
xor    %eax,%eax
cmp    %dil,%cl
sete   %al
ret

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

LLVM IR (-O2):
define i32 @includes(i8 signext %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
%11 = zext i1 %7 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ dump_stuff(void *, unsigned int);
int /*<<< orphan*/ printf(char *, char *);
void dump_stuff_msg_sepline(const void *msg, void *x, unsigned int size) {
  printf("%s :\n", (char *)msg);
  dump_stuff(x, size);
}


x86 assembly (clang, -O0):
<dump_stuff_msg_sepline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <dump_stuff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_stuff_msg_sepline>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <dump_stuff@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s :\0A\00"
define void @dump_stuff_msg_sepline(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @dump_stuff(i8* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s :\0A\00"
define void @dump_stuff_msg_sepline(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32 @dump_stuff(i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void bar(int *p) {
  *p = 0;
  *p = 0;
  abort();
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<bar>:
push   %rax
movl   $0x0,(%rdi)
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @bar(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
store i32 0, i32* %4
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @bar(i32* nocapture writeonly %0) {
store i32 0, i32* %0
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void decodeThirdByte(uint8_t *src, uint32_t *p32_dest) {
  uint8_t *p8_dest = (uint8_t *)p32_dest;
  *(p8_dest + 2) = *(src + 2);
}


x86 assembly (clang, -O0):
<decodeThirdByte>:
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    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeThirdByte>:
mov    0x8(%rdi),%eax
mov    %eax,0x8(%rsi)
ret

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

LLVM IR (-O2):
define void @decodeThirdByte(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %4, i32* %5
ret void
}
int rename(char *old, char *new) {}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @rename(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int get16(unsigned char **);
int /*<<< orphan*/ printf(char *, ...);
void readHeaderChecksum(unsigned char **head) {
  printf("*******NOT IMPLEMENTED CHECKSUM********\n");
  printf("Header checksum: %#04x", get16(head));
}


x86 assembly (clang, -O0):
<readHeaderChecksum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <get16@plt>
mov    %eax,%esi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readHeaderChecksum>:
push   %rbx
mov    %rdi,%rbx
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1050 <get16@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"*******NOT IMPLEMENTED CHECKSUM********\0A\00"
@.str.1 = [23 x i8] c"Header checksum: %x\00"
define void @readHeaderChecksum(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = call i32 @get16(i8** %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Header checksum: %x\00"
@str = [40 x i8] c"*******NOT IMPLEMENTED CHECKSUM********\00"
define void @readHeaderChecksum(i8** %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @get16(i8** %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dostuff(int *);
void varDecl1(int X) {
  switch (X) {
    int A;
  case 1:
    dostuff(&A);
    break;
  case 2:
    dostuff(&A);
    break;
  }
}


x86 assembly (clang, -O0):
<varDecl1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     1140 <varDecl1+0x30>
jmp    112f <varDecl1+0x1f>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     114e <varDecl1+0x3e>
jmp    1157 <varDecl1+0x47>
lea    -0x8(%rbp),%rdi
call   1030 <dostuff@plt>
jmp    1157 <varDecl1+0x47>
lea    -0x8(%rbp),%rdi
call   1030 <dostuff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<varDecl1>:
add    $0xffffffff,%edi
cmp    $0x1,%edi
ja     1127 <varDecl1+0x17>
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <dostuff@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @varDecl1(i32 %0) {
%2 = alloca i32
%3 = add i32 %0, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @dostuff(i32* %2)
br label %7
7: ; preds = %1, %5
ret void
}