xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void write_main(FILE *out, int number_of_files) {
  fprintf(out,
          "#define NUMFILES %d\n\n"
          "int main(void) {\n"
          "    int i, j;\n"
          "    FILE *fd;\n"
          "    for (i = 0; i < NUMFILES; ++i) {\n"
          "        printf(\"Extracting %%s...\", filenames[i]);\n"
          "        fd = fopen(filenames[i], \"w\");\n"
          "        for (j = 0; j < filelength[i]; j++) {\n"
          "           fputc(files[i][j], fd);\n"
          "        }\n"
          "        fclose(fd);\n"
          "    printf(\"\\n\");\n"
          "    }\n"
          "}\n",
          number_of_files);
}


x86 assembly (clang, -O0):
<write_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_main>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [331 x i8] c"#define NUMFILES %d\0A\0Aint main(void) {\0A int i, j;\0A FILE *fd;\0A for (i = 0; i < NUMFILES; ++i) {\0A printf(\22Extracting %%s...\22, filenames[i]);\0A fd = fopen(filenames[i], \22w\22);\0A for (j = 0; j < filelength[i]; j++) {\0A fputc(files[i][j], fd);\0A }\0A fclose(fd);\0A printf(\22\\n\22);\0A }\0A}\0A\00"
define void @write_main(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [331 x i8] c"#define NUMFILES %d\0A\0Aint main(void) {\0A int i, j;\0A FILE *fd;\0A for (i = 0; i < NUMFILES; ++i) {\0A printf(\22Extracting %%s...\22, filenames[i]);\0A fd = fopen(filenames[i], \22w\22);\0A for (j = 0; j < filelength[i]; j++) {\0A fputc(files[i][j], fd);\0A }\0A fclose(fd);\0A printf(\22\\n\22);\0A }\0A}\0A\00"
define void @write_main(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([331 x i8], [331 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fnext_char(int *, int /*<<< orphan*/ *);
scalar_t__ isspace(int);
void fskip_layout(int *c, FILE *f) {
  while (isspace(*c))
    fnext_char(c, f);
}


x86 assembly (clang, -O0):
<fskip_layout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1040 <isspace@plt>
cmp    $0x0,%rax
je     1157 <fskip_layout+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <fnext_char@plt>
jmp    1130 <fskip_layout+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fskip_layout>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%edi
nopl   0x0(%rax)
call   1040 <isspace@plt>
test   %rax,%rax
je     1149 <fskip_layout+0x29>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <fnext_char@plt>
mov    (%rbx),%edi
jmp    1130 <fskip_layout+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @fskip_layout(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %10, %2
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i64 @isspace(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32*, i32** %3
%12 = load i32*, i32** %4
%13 = call i32 @fnext_char(i32* %11, i32* %12)
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @fskip_layout(i32* %0, i32* %1) {
%3 = load i32, i32* %0
%4 = tail call i64 @isspace(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = tail call i32 @fnext_char(i32* %0, i32* %1)
%8 = load i32, i32* %0
%9 = tail call i64 @isspace(i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6, %2
ret void
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int tcpsocket_read(int socketfd, char *data, int len) {
  return (int)read(socketfd, data, len);
}


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

x86 assembly (clang, -O2):
<tcpsocket_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @tcpsocket_read(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
void RTLogRelLogger(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLogRelLogger() {
ret void
}
unsigned short port_word_in(unsigned short port) {
  unsigned short ret;
  __asm__("in %%dx, %%ax" : "=a"(ret) : "d"(port));
  return ret;
}


x86 assembly (clang, -O0):
<port_word_in>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%ax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<port_word_in>:
mov    %edi,%edx
in     (%dx),%ax
ret

LLVM IR (-O0):
define zeroext i16 @port_word_in(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i16 asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @port_word_in(i16 zeroext %0) {
%2 = tail call i16 asm "in %dx, %ax", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i16 %2
}
/* Variables and functions */
int /*<<< orphan*/ ledloop();
int /*<<< orphan*/ printf(char *);
void tlbExcept(void) {
  printf("TLB exception\n");
  ledloop();
}


x86 assembly (clang, -O0):
<tlbExcept>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ledloop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tlbExcept>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ledloop@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"TLB exception\0A\00"
define void @tlbExcept() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @ledloop()
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"TLB exception\00"
define void @tlbExcept() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @ledloop()
ret void
}
/* Variables and functions */
char inb(int);
unsigned char getScancode() {
  char c = 0;
  do {
    if (inb(0x60) != c) {
      c = inb(0x60);
      if (c > 0)
        return c;
    }
  } while (1);
}


x86 assembly (clang, -O0):
<getScancode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x2(%rbp)
mov    $0x60,%edi
call   1030 <inb@plt>
movsbl %al,%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
je     115f <getScancode+0x4f>
mov    $0x60,%edi
call   1030 <inb@plt>
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    115a <getScancode+0x4a>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1173 <getScancode+0x63>
jmp    115f <getScancode+0x4f>
jmp    1164 <getScancode+0x54>
mov    $0x1,%al
test   $0x1,%al
jne    111c <getScancode+0xc>
jmp    1173 <getScancode+0x63>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getScancode>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x60,%edi
call   1030 <inb@plt>
cmp    %bl,%al
je     1120 <getScancode+0x10>
mov    $0x60,%edi
call   1030 <inb@plt>
mov    %eax,%ebx
test   %al,%al
jle    1120 <getScancode+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define zeroext i8 @getScancode() {
br label %1
1: ; preds = %6, %0
%2 = phi i8 [ %7, %6 ], [ 0, %0 ]
br label %3
3: ; preds = %1, %3
%4 = tail call signext i8 @inb(i32 96)
%5 = icmp eq i8 %4, %2
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call signext i8 @inb(i32 96)
%8 = icmp sgt i8 %7, 0
br i1 %8, label %9, label %1
9: ; preds = %6
ret i8 %7
}
/* Type definitions */
struct libkeccak_state {
  int dummy;
};

/* Variables and functions */
size_t libkeccak_state_marshal(struct libkeccak_state const *,
                               int /*<<< orphan*/ *);
__attribute__((
    __deprecated__("Use libkeccak_state_marshal(state, NULL) instead of "
                   "libkeccak_state_marshal_size(state)"))) size_t
libkeccak_state_marshal_size(const struct libkeccak_state *restrict state) {
  return libkeccak_state_marshal(state, NULL);
}


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

x86 assembly (clang, -O2):
<libkeccak_state_marshal_size>:
xor    %esi,%esi
jmp    1030 <libkeccak_state_marshal@plt>

LLVM IR (-O0):
%struct.libkeccak_state = type { i32 }
define i64 @libkeccak_state_marshal_size(%struct.libkeccak_state* noalias %0) {
%2 = alloca %struct.libkeccak_state*
store %struct.libkeccak_state* %0, %struct.libkeccak_state** %2
%3 = load %struct.libkeccak_state*, %struct.libkeccak_state** %2
%4 = call i64 @libkeccak_state_marshal(%struct.libkeccak_state* %3, i32* null)
ret i64 %4
}

LLVM IR (-O2):
%struct.libkeccak_state = type { i32 }
define i64 @libkeccak_state_marshal_size(%struct.libkeccak_state* noalias %0) {
%2 = tail call i64 @libkeccak_state_marshal(%struct.libkeccak_state* %0, i32* null)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ tblPC1;

/* Variables and functions */
int /*<<< orphan*/ McbMapTrueBits(unsigned char *, int, unsigned char const *,
                                  unsigned char *);
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void McbCreateKeyPlus(const unsigned char Key[8], unsigned char KeyPlus[7]) {
  static unsigned char tblPC1[] = {
      56, 48, 40, 32, 24, 16, 8,  0,  57, 49, 41, 33, 25, 17,
      9,  1,  58, 50, 42, 34, 26, 18, 10, 2,  59, 51, 43, 35,
      62, 54, 46, 38, 30, 22, 14, 6,  61, 53, 45, 37, 29, 21,
      13, 5,  60, 52, 44, 36, 28, 20, 12, 4,  27, 19, 11, 3};
  memset(KeyPlus, 0, 7);
  McbMapTrueBits(tblPC1, sizeof(tblPC1), Key, KeyPlus);
}


x86 assembly (clang, -O0):
<McbCreateKeyPlus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0x2ef1(%rip),%rdi
mov    $0x38,%esi
call   1040 <McbMapTrueBits@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McbCreateKeyPlus>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x7,%edx
call   1030 <memset@plt>
lea    0x2f00(%rip),%rdi
mov    $0x38,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <McbMapTrueBits@plt>

LLVM IR (-O0):
@McbCreateKeyPlus.tblPC1 = internal global [56 x i8] c"80( \18\10\08\0091)!\19\11\09\01:2*\22\1A\12\0A\02;3+#>6.&\1E\16\0E\06=5-%\1D\15\0D\05<4,$\1C\14\0C\04\1B\13\0B\03"
define void @McbCreateKeyPlus(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @memset(i8* %5, i32 0, i32 7)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @McbMapTrueBits(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @McbCreateKeyPlus.tblPC1, i64 0, i64 0), i32 56, i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@McbCreateKeyPlus.tblPC1 = internal global [56 x i8] c"80( \18\10\08\0091)!\19\11\09\01:2*\22\1A\12\0A\02;3+#>6.&\1E\16\0E\06=5-%\1D\15\0D\05<4,$\1C\14\0C\04\1B\13\0B\03"
define void @McbCreateKeyPlus(i8* %0, i8* %1) {
%3 = tail call i32 @memset(i8* %1, i32 0, i32 7)
%4 = tail call i32 @McbMapTrueBits(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @McbCreateKeyPlus.tblPC1, i64 0, i64 0), i32 56, i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int chdir(char const *);
int sys_chdir(const char *path) {
  int rc = chdir(path);
  return rc;
}


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

x86 assembly (clang, -O2):
<sys_chdir>:
jmp    1030 <chdir@plt>

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

LLVM IR (-O2):
define i32 @sys_chdir(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
ret i32 %2
}
/* Variables and functions */
void bzero(void *b, size_t length) {
  char *p;
  for (p = (char *)b; length--;)
    *p++ = '\0';
}


x86 assembly (clang, -O0):
<bzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     1144 <bzero+0x44>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x0,(%rax)
jmp    1114 <bzero+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero>:
test   %rsi,%rsi
je     1124 <bzero+0x14>
push   %rax
mov    %rsi,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @bzero(i8* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %2
br label %5
5: ; preds = %4, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint64_t;

/* Variables and functions */
int randLIB_get_64bit();
uint8_t randLIB_get_8bit(void) {
  uint64_t r = randLIB_get_64bit();
  return (uint8_t)(r >> 56);
}


x86 assembly (clang, -O0):
<randLIB_get_8bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <randLIB_get_64bit@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @randLIB_get_8bit() {
%1 = alloca i32
%2 = call i32 (...) @randLIB_get_64bit()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = ashr i32 %3, 56
ret i32 %4
}

LLVM IR (-O2):
define i32 @randLIB_get_8bit() {
%1 = tail call i32 (...) @randLIB_get_64bit()
ret i32 poison
}
int eap_peer_register_methods(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @eap_peer_register_methods() {
ret i32 0
}
/* Type definitions */
struct stack_st_OPENSSL_BLOCK {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_insert(int /*<<< orphan*/ *, void const *, int);
int sk_OPENSSL_BLOCK_insert(struct stack_st_OPENSSL_BLOCK *sk, void *ptr,
                            int idx) {
  return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx);
}


x86 assembly (clang, -O0):
<sk_OPENSSL_BLOCK_insert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <OPENSSL_sk_insert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sk_OPENSSL_BLOCK_insert>:
jmp    1030 <OPENSSL_sk_insert@plt>

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

LLVM IR (-O2):
%struct.stack_st_OPENSSL_BLOCK = type { i32 }
define i32 @sk_OPENSSL_BLOCK_insert(%struct.stack_st_OPENSSL_BLOCK* %0, i8* %1, i32 %2) {
%4 = getelementptr %struct.stack_st_OPENSSL_BLOCK, %struct.stack_st_OPENSSL_BLOCK* %0, i64 0, i32 0
%5 = tail call i32 @OPENSSL_sk_insert(i32* %4, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int dynamic_fn(int i) {
  printf("I'm dynamic %d\n", i);
  return i * 2;
}


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

x86 assembly (clang, -O2):
<dynamic_fn>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"I'm dynamic %d\0A\00"
define i32 @dynamic_fn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = mul nsw i32 %5, 2
ret i32 %6
}

LLVM IR (-O2):
@.str = [16 x i8] c"I'm dynamic %d\0A\00"
define i32 @dynamic_fn(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = shl nsw i32 %0, 1
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t lo_dword(uint64_t val) { return val & 0xFFFFFFFF; }


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

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

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

LLVM IR (-O2):
define i32 @lo_dword(i32 returned %0) {
ret i32 %0
}
int CalcHashkey(int x, int y, int z) {
  int key;
  key = x + (y << 5) + (z << 10);
  key &= ((4096) - 1);
  return key;
}


x86 assembly (clang, -O0):
<CalcHashkey>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0xa,%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xfff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CalcHashkey>:
shl    $0x5,%esi
lea    (%rsi,%rdi,1),%eax
shl    $0xa,%edx
add    %edx,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @CalcHashkey(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = shl i32 %9, 5
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = shl i32 %12, 10
%14 = add nsw i32 %11, %13
store i32 %14, i32* %7
%15 = load i32, i32* %7
%16 = and i32 %15, 4095
store i32 %16, i32* %7
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @CalcHashkey(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %1, 5
%5 = add nsw i32 %4, %0
%6 = shl i32 %2, 10
%7 = add nsw i32 %5, %6
%8 = and i32 %7, 4095
ret i32 %8
}
void eglInitialize(void) { return; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigpending(int /*<<< orphan*/ *);
void test(void) {
  sigset_t set;
  int result;
  (void)sigemptyset(&set);
  result = sigpending(&set);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
call   1040 <sigpending@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
mov    %rbx,%rdi
call   1040 <sigpending@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigpending(i32* %1)
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = call i32 @sigpending(i32* %1)
ret void
}
char get_byte(void) {
  while (!((*(volatile unsigned long *)0x40013800) & 0x20))
    ;
  return (char)*(volatile unsigned long *)0x40013804;
}


x86 assembly (clang, -O0):
<get_byte>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <get_byte+0x9>
mov    $0x40013800,%eax
mov    (%rax),%rax
and    $0x20,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112b <get_byte+0x2b>
jmp    1130 <get_byte+0x30>
jmp    1109 <get_byte+0x9>
mov    $0x40013804,%eax
mov    (%rax),%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_byte>:
testq  $0x20,0x40013800
je     1100 <get_byte>
mov    0x40013804,%rax
40
ret

LLVM IR (-O0):
define signext i8 @get_byte() {
br label %1
1: ; preds = %6, %0
%2 = load volatile i64, i64* inttoptr (i64 1073821696 to i64*)
%3 = and i64 %2, 32
%4 = icmp ne i64 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %1
br label %1
7: ; preds = %1
%8 = load volatile i64, i64* inttoptr (i64 1073821700 to i64*)
%9 = trunc i64 %8 to i8
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @get_byte() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i64, i64* inttoptr (i64 1073821696 to i64*)
%3 = and i64 %2, 32
%4 = icmp eq i64 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i64, i64* inttoptr (i64 1073821700 to i64*)
%7 = trunc i64 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ emsBegin(int *const);
void ems_begin_(int *const status) {

  emsBegin(status);
  return;
}


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

x86 assembly (clang, -O2):
<ems_begin_>:
jmp    1030 <emsBegin@plt>

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

LLVM IR (-O2):
define void @ems_begin_(i32* %0) {
%2 = tail call i32 @emsBegin(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ sched_yield();
int process(void *arg) {
  int i;
  for (i = 0; i < 500; i++)
    if (sched_yield())
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<process>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1f4,-0xc(%rbp)
jge    116b <process+0x4b>
mov    $0x0,%al
call   1040 <sched_yield@plt>
cmp    $0x0,%rax
je     1158 <process+0x38>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    115d <process+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <process+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process>:
push   %rbx
mov    $0x1f4,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <sched_yield@plt>
test   %rax,%rax
jne    1145 <process+0x25>
add    $0xffffffff,%ebx
jne    1130 <process+0x10>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @process(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 500
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = call i64 (...) @sched_yield()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 (...) @abort()
unreachable
12: ; preds = %7
br label %13
13: ; preds = %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
define i32 @process(i8* nocapture readnone %0) {
br label %5
2: ; preds = %5
%3 = add nuw nsw i32 %6, 1
%4 = icmp eq i32 %3, 500
br i1 %4, label %11, label %5
5: ; preds = %1, %2
%6 = phi i32 [ 0, %1 ], [ %3, %2 ]
%7 = tail call i64 (...) @sched_yield()
%8 = icmp eq i64 %7, 0
br i1 %8, label %2, label %9
9: ; preds = %5
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %2
ret i32 0
}
struct request_proto *get_req_pro(struct P4 *p4) {
  return (struct request_proto *)p4;
}


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

x86 assembly (clang, -O2):
<get_req_pro>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.request_proto = type opaque
%struct.P4 = type opaque
define %struct.request_proto* @get_req_pro(%struct.P4* %0) {
%2 = alloca %struct.P4*
store %struct.P4* %0, %struct.P4** %2
%3 = load %struct.P4*, %struct.P4** %2
%4 = bitcast %struct.P4* %3 to %struct.request_proto*
ret %struct.request_proto* %4
}

LLVM IR (-O2):
%struct.request_proto = type opaque
%struct.P4 = type opaque
define %struct.request_proto* @get_req_pro(%struct.P4* readnone %0) {
%2 = bitcast %struct.P4* %0 to %struct.request_proto*
ret %struct.request_proto* %2
}
g(int i) { return !i; }


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

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned int g2(unsigned int a) {
  return (a & 0xff000000) >> 24 | (a & 0x00ffffff) << 8;
}


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xffffff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
mov    %edi,%eax
rol    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @g2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16777215
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @g2(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 8)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ heron_setmem(void *, size_t);
void *malloc(size_t);
void *heron_malloc(size_t num) {
  void *p = malloc(num);
  heron_setmem(p, num);
  return p;
}


x86 assembly (clang, -O0):
<heron_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <heron_setmem@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heron_malloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <heron_setmem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @heron_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @heron_setmem(i8* %6, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @heron_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @heron_setmem(i8* %2, i64 %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ islower(char);
char toupper(char);
void uppercase(char *ch) { *ch = (islower(*ch) ? toupper(*ch) : (*ch)); }


x86 assembly (clang, -O0):
<uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     1159 <uppercase+0x39>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <uppercase+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uppercase>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <islower@plt>
mov    %rax,%rcx
mov    (%rbx),%al
test   %rcx,%rcx
je     113e <uppercase+0x1e>
movsbl %al,%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @uppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = call i64 @islower(i8 signext %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = call signext i8 @toupper(i8 signext %9)
%11 = sext i8 %10 to i32
br label %16
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
br label %16
16: ; preds = %12, %7
%17 = phi i32 [ %11, %7 ], [ %15, %12 ]
%18 = trunc i32 %17 to i8
%19 = load i8*, i8** %2
store i8 %18, i8* %19
ret void
}

LLVM IR (-O2):
define void @uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = tail call i64 @islower(i8 signext %2)
%4 = icmp eq i64 %3, 0
%5 = load i8, i8* %0
br i1 %4, label %8, label %6
6: ; preds = %1
%7 = tail call signext i8 @toupper(i8 signext %5)
br label %8
8: ; preds = %1, %6
%9 = phi i8 [ %7, %6 ], [ %5, %1 ]
store i8 %9, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ _plibc_syscall(int, int, void const *, size_t);
ssize_t write(int fd, const void *buf, size_t count) {
  return _plibc_syscall(1, fd, buf, count);
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%edi
call   1030 <_plibc_syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <_plibc_syscall@plt>

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @_plibc_syscall(i32 1, i32 %0, i8* %1, i64 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int main() {
  putchar('\a');
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i8 signext 7)
ret i32 0
}
int mdc(int x, int y) {
  if (y == 0)
    return x;
  return mdc(y, x % y);
}


x86 assembly (clang, -O0):
<mdc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1133 <mdc+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1147 <mdc+0x37>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <mdc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mdc>:
mov    %edi,%eax
test   %esi,%esi
je     111d <mdc+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <mdc+0x10>
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mdc(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 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %4
store i32 %9, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = srem i32 %12, %13
%15 = call i32 @mdc(i32 %11, i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %10, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @mdc(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
int nls_op_add(int a, int b) { return a + b; }


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

x86 assembly (clang, -O2):
<nls_op_add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @nls_op_add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int scanf(char *, char *);
int main() {
  char v[101];
  return scanf("%s", v), printf("%s%s\n", v, v), 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"%s%s\0A\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %2)
ret i32 0
}
char *deccb_shortdesc(void) {
  return "decrypt encrypted data sections from an export file";
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"decrypt encrypted data sections from an export file\00"
define i8* @deccb_shortdesc() {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [52 x i8] c"decrypt encrypted data sections from an export file\00"
define i8* @deccb_shortdesc() {
ret i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0)
}
int db_load(const char *sDbHost, const char *sDbUser, const char *sDbPass,
            const char *sDbName, int iDbPort) {
  return 1;
}


x86 assembly (clang, -O0):
<db_load>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @db_load(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i32 %4) {
ret i32 1
}
/* Variables and functions */
void Reserved_Handler18(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Reserved_Handler18>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Reserved_Handler18+0x9>
jmp    1109 <Reserved_Handler18+0x9>

x86 assembly (clang, -O2):
<Reserved_Handler18>:
jmp    1100 <Reserved_Handler18>

LLVM IR (-O0):
define void @Reserved_Handler18() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Reserved_Handler18() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long double flerpl(long double v0, long double v1, long double t) {
  printf("Call function "
         "flerpl"
         ": ");
  return (1 - t) * v0 + t * v1;
}


x86 assembly (clang, -O0):
<flerpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x30(%rbp)
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
fldt   -0x30(%rbp)
fld1
fsub   %st(1),%st
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
fmulp  %st,%st(3)
fmulp  %st,%st(1)
faddp  %st,%st(1)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flerpl>:
sub    $0x28,%rsp
fldt   0x30(%rsp)
fstpt  0x1c(%rsp)
fldt   0x40(%rsp)
fstpt  0x10(%rsp)
fldt   0x50(%rsp)
fstpt  0x4(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
fld1
fldt   0x4(%rsp)
fsubr  %st,%st(1)
fldt   0x1c(%rsp)
fmulp  %st,%st(2)
fldt   0x10(%rsp)
fmulp  %st,%st(1)
faddp  %st,%st(1)
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Call function flerpl: \00"
define x86_fp80 @flerpl(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
store x86_fp80 %2, x86_fp80* %6
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%8 = load x86_fp80, x86_fp80* %6
%9 = fsub x86_fp80 0xK3FFF8000000000000000, %8
%10 = load x86_fp80, x86_fp80* %4
%11 = load x86_fp80, x86_fp80* %6
%12 = load x86_fp80, x86_fp80* %5
%13 = fmul x86_fp80 %11, %12
%14 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %9, x86_fp80 %10, x86_fp80 %13)
ret x86_fp80 %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"Call function flerpl: \00"
define x86_fp80 @flerpl(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = fsub x86_fp80 0xK3FFF8000000000000000, %2
%6 = fmul x86_fp80 %1, %2
%7 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %5, x86_fp80 %0, x86_fp80 %6)
ret x86_fp80 %7
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nerror(char *);
double *dvector(long nl, long nh) {
  double *v;
  v = (double *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(double)));
  if (!v)
    nerror("allocation failure in dvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
sub    -0x8(%rbp),%rdi
add    $0x1,%rdi
add    $0x1,%rdi
shl    $0x3,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1164 <dvector+0x44>
lea    0xea1(%rip),%rdi
call   1040 <nerror@plt>
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
sub    -0x8(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x8,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
sub    %rdi,%rsi
lea    0x10(,%rsi,8),%rdi
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114b <dvector+0x2b>
lea    0xeba(%rip),%rdi
call   1040 <nerror@plt>
shl    $0x3,%r14
sub    %r14,%rbx
add    $0x8,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca double*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %9, 1
%11 = mul i64 %10, 8
%12 = call i64 @malloc(i64 %11)
%13 = inttoptr i64 %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 @nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i64, i64* %3
%21 = sub i64 0, %20
%22 = getelementptr inbounds double, double* %19, i64 %21
%23 = getelementptr inbounds double, double* %22, i64 1
ret double* %23
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in dvector()\00"
define double* @dvector(i64 %0, i64 %1) {
%3 = sub nsw i64 %1, %0
%4 = shl i64 %3, 3
%5 = add i64 %4, 16
%6 = tail call i64 @malloc(i64 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 @nerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = inttoptr i64 %6 to double*
%12 = sub i64 0, %0
%13 = getelementptr inbounds double, double* %11, i64 %12
%14 = getelementptr inbounds double, double* %13, i64 1
ret double* %14
}
/* Variables and functions */
int bswap16(int);
int bswap32(int);
int bswap64(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("        bswap16 (0x1234)             -> %#x \n", bswap16(0x1234));
  printf("        bswap32 (0x12345678)         -> %#x \n", bswap32(0x12345678));
  printf("        bswap64 (0x1234567890abcdef) -> %#llx \n",
         bswap64(0x1234567890abcdefLL));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1234,%edi
call   1060 <bswap16@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x12345678,%edi
call   1040 <bswap32@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x90abcdef,%edi
call   1050 <bswap64@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1234,%edi
call   1060 <bswap16@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x12345678,%edi
call   1040 <bswap32@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x90abcdef,%edi
call   1050 <bswap64@plt>
lea    0xeda(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c" bswap16 (0x1234) -> %#x \0A\00"
@.str.1 = [46 x i8] c" bswap32 (0x12345678) -> %#x \0A\00"
@.str.2 = [48 x i8] c" bswap64 (0x1234567890abcdef) -> %#llx \0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @bswap16(i32 4660)
%3 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 @bswap32(i32 305419896)
%5 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @bswap64(i32 -1867788817)
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c" bswap16 (0x1234) -> %#x \0A\00"
@.str.1 = [46 x i8] c" bswap32 (0x12345678) -> %#x \0A\00"
@.str.2 = [48 x i8] c" bswap64 (0x1234567890abcdef) -> %#llx \0A\00"
define i32 @main() {
%1 = tail call i32 @bswap16(i32 4660)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @bswap32(i32 305419896)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @bswap64(i32 -1867788817)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}