xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0x25() {
  Assert_real((isxdigit(37) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              190, ("isxdigit should be 0 for %"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0x25>:
push   %rbp
mov    %rsp,%rbp
mov    $0x25,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0xbe,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0x25>:
push   %rax
mov    $0x25,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0xbe,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for %\00"
define void @t_isxdigit_0x25() {
%1 = call i64 @isxdigit(i32 37)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [27 x i8] c"isxdigit should be 0 for %\00"
define void @t_isxdigit_0x25() {
%1 = tail call i64 @isxdigit(i32 37)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 190, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char const *,
                           char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void PrintError(int error, const char *func, int32_t line) {
  fprintf(stderr,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/"
          "linux/netlink_socket.c"
          ":%d %s: %s\n",
          line, func, strerror(error));
}


x86 assembly (clang, -O0):
<PrintError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x28(%rbp),%edi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    %rax,%r8
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintError>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
mov    0x2eb0(%rip),%rax
mov    (%rax),%ebp
call   1040 <strerror@plt>
lea    0xec2(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %r14,%rcx
mov    %rax,%r8
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/linux/netlink_socket.c:%d %s: %s\0A\00"
define void @PrintError(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* @stderr
%8 = load i32, i32* %6
%9 = load i8*, i8** %5
%10 = load i32, i32* %4
%11 = call i8* @strerror(i32 %10)
%12 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %9, i8* %11)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/google/makani/refs/heads/master/avionics/linux/netlink_socket.c:%d %s: %s\0A\00"
define void @PrintError(i32 %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i8* @strerror(i32 %0)
%6 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0), i32 %2, i8* %1, i8* %5)
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t transform_int_proportional(uint16_t input, uint16_t in_x,
                                    uint16_t out_y) {
  if (in_x == 0) {
    return 0;
  }
  return (uint16_t)(((uint32_t)out_y * input) / in_x);
}


x86 assembly (clang, -O0):
<transform_int_proportional>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1123 <transform_int_proportional+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1131 <transform_int_proportional+0x31>
mov    -0x10(%rbp),%eax
imul   -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<transform_int_proportional>:
test   %esi,%esi
je     110d <transform_int_proportional+0xd>
imul   %edi,%edx
mov    %edx,%eax
cltd
idiv   %esi
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @transform_int_proportional(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
store i32 0, i32* %4
br label %17
11: ; preds = %3
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %6
%16 = sdiv i32 %14, %15
store i32 %16, i32* %4
br label %17
17: ; preds = %11, %10
%18 = load i32, i32* %4
ret i32 %18
}

LLVM IR (-O2):
define i32 @transform_int_proportional(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = mul nsw i32 %2, %0
%7 = sdiv i32 %6, %1
br label %8
8: ; preds = %3, %5
%9 = phi i32 [ %7, %5 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ cli_claim(char *);
int /*<<< orphan*/ cli_dispose();
int /*<<< orphan*/ cli_infokey();
int /*<<< orphan*/ cli_init();
int /*<<< orphan*/ cli_loadkey(char *);
int main(int argc, char **argv) {
  cli_init();
  cli_claim("Mirai");
  cli_loadkey("1.key");
  cli_infokey();
  cli_dispose();
  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   1070 <cli_init@plt>
lea    0xe8c(%rip),%rdi
call   1060 <cli_claim@plt>
lea    0xe86(%rip),%rdi
call   1030 <cli_loadkey@plt>
mov    $0x0,%al
call   1040 <cli_infokey@plt>
mov    $0x0,%al
call   1050 <cli_dispose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <cli_init@plt>
lea    0xea1(%rip),%rdi
call   1060 <cli_claim@plt>
lea    0xe9b(%rip),%rdi
call   1030 <cli_loadkey@plt>
xor    %eax,%eax
call   1040 <cli_infokey@plt>
xor    %eax,%eax
call   1050 <cli_dispose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Mirai\00"
@.str.1 = [6 x i8] c"1.key\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 (...) @cli_init()
%7 = call i32 @cli_claim(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @cli_loadkey(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @cli_infokey()
%10 = call i32 (...) @cli_dispose()
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"Mirai\00"
@.str.1 = [6 x i8] c"1.key\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cli_init()
%4 = tail call i32 @cli_claim(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @cli_loadkey(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @cli_infokey()
%7 = tail call i32 (...) @cli_dispose()
ret i32 0
}
int c001(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c001() {
ret i32 0
}
void WideTimer0A_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @WideTimer0A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char const *argv[]) {
  int n;
  printf("Please enter three integers:\n");
  scanf("%*d %*d %d", &n);
  printf("The last integer was %d\n", n);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Please enter three integers:\0A\00"
@.str.1 = [11 x i8] c"%*d %*d %d\00"
@.str.2 = [25 x i8] c"The last integer was %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"%*d %*d %d\00"
@.str.2 = [25 x i8] c"The last integer was %d\0A\00"
@str = [29 x i8] c"Please enter three integers:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ strtoll(char *, int /*<<< orphan*/ *, int);
char *substring(char const *, int, int);
int64_t extract_bytes(const char *hexstr, int start, int len) {
  char *substr = substring(hexstr, start, len);
  int64_t val = strtoll(substr, NULL, 16);
  free(substr);
  return val;
}


x86 assembly (clang, -O0):
<extract_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <substring@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1050 <strtoll@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_bytes>:
push   %rbp
push   %rbx
push   %rax
call   1040 <substring@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1050 <strtoll@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @extract_bytes(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i8* @substring(i8* %9, i32 %10, i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %7
%14 = call i32 @strtoll(i8* %13, i32* null, i32 16)
store i32 %14, i32* %8
%15 = load i8*, i8** %7
%16 = call i32 @free(i8* %15)
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
define i32 @extract_bytes(i8* %0, i32 %1, i32 %2) {
%4 = tail call i8* @substring(i8* %0, i32 %1, i32 %2)
%5 = tail call i32 @strtoll(i8* nocapture %4, i32* null, i32 16)
%6 = tail call i32 @free(i8* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void html_after() { printf("</ul>\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"</ul>\0A\00"
define void @html_after() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"</ul>\00"
define void @html_after() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sqlRemakeTable(struct sqlConnection *, char *, char *);
void snp125ExceptionsTableCreate(struct sqlConnection *conn) {
  char *createString = "NOSQLINJ "
                       "CREATE TABLE snp125Exceptions (\n"
                       "    chrom varchar(15) not null,\n"
                       "    chromStart int(10) unsigned not null,\n"
                       "    chromEnd int(10) unsigned not null,\n"
                       "    name varchar(15) not null,\n"
                       "    exception varchar(64) not null \n"
                       ")\n";
  sqlRemakeTable(conn, "snp125Exceptions", createString);
}


x86 assembly (clang, -O0):
<snp125ExceptionsTableCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xfab(%rip),%rsi
call   1030 <sqlRemakeTable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snp125ExceptionsTableCreate>:
lea    0xfca(%rip),%rsi
lea    0xee2(%rip),%rdx
jmp    1030 <sqlRemakeTable@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [225 x i8] c"NOSQLINJ CREATE TABLE snp125Exceptions (\0A chrom varchar(15) not null,\0A chromStart int(10) unsigned not null,\0A chromEnd int(10) unsigned not null,\0A name varchar(15) not null,\0A exception varchar(64) not null \0A)\0A\00"
@.str.1 = [17 x i8] c"snp125Exceptions\00"
define void @snp125ExceptionsTableCreate(%struct.sqlConnection* %0) {
%2 = alloca %struct.sqlConnection*
%3 = alloca i8*
store %struct.sqlConnection* %0, %struct.sqlConnection** %2
store i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load %struct.sqlConnection*, %struct.sqlConnection** %2
%5 = load i8*, i8** %3
%6 = call i32 @sqlRemakeTable(%struct.sqlConnection* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [225 x i8] c"NOSQLINJ CREATE TABLE snp125Exceptions (\0A chrom varchar(15) not null,\0A chromStart int(10) unsigned not null,\0A chromEnd int(10) unsigned not null,\0A name varchar(15) not null,\0A exception varchar(64) not null \0A)\0A\00"
@.str.1 = [17 x i8] c"snp125Exceptions\00"
define void @snp125ExceptionsTableCreate(%struct.sqlConnection* %0) {
%2 = tail call i32 @sqlRemakeTable(%struct.sqlConnection* %0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0))
ret void
}
long factorial(long n) {
  if (n <= 1) {
    return 1;
  } else {
    return (n * factorial(n - 1));
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x1,-0x10(%rbp)
jg     1134 <factorial+0x24>
movq   $0x1,-0x8(%rbp)
jmp    1158 <factorial+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
cmp    $0x2,%rdi
jl     1121 <factorial+0x21>
mov    $0x1,%eax
imul   %rdi,%rax
lea    -0x1(%rdi),%rcx
cmp    $0x2,%rdi
mov    %rcx,%rdi
ja     1110 <factorial+0x10>
ret

LLVM IR (-O0):
define i64 @factorial(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %3
%4 = load i64, i64* %3
%5 = icmp sle i64 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %13
7: ; preds = %1
%8 = load i64, i64* %3
%9 = load i64, i64* %3
%10 = sub nsw i64 %9, 1
%11 = call i64 @factorial(i64 %10)
%12 = mul nsw i64 %8, %11
store i64 %12, i64* %2
br label %13
13: ; preds = %7, %6
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
define i64 @factorial(i64 %0) {
%2 = icmp slt i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ %0, %1 ]
%5 = phi i64 [ %7, %3 ], [ 1, %1 ]
%6 = add nsw i64 %4, -1
%7 = mul nsw i64 %4, %5
%8 = icmp ult i64 %4, 3
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 1, %1 ], [ %7, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
int access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int);
short checkPid(unsigned int ckpid) {
  static char buf[128];
  sprintf(buf, "/proc/%d/stat", ckpid);
  if (-1 != access(buf, F_OK)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkPid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edx
lea    0x2f0b(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1040 <sprintf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%esi
lea    0x2eef(%rip),%rdi
call   1030 <access@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
je     1170 <checkPid+0x50>
movw   $0x1,-0x2(%rbp)
jmp    1176 <checkPid+0x56>
movw   $0x0,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkPid>:
push   %rbx
mov    %edi,%edx
lea    0x2f16(%rip),%rbx
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1030 <access@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@checkPid.buf = internal global [128 x i8] zeroinitializer
@.str = [14 x i8] c"/proc/%d/stat\00"
@F_OK = global i32 0
define signext i16 @checkPid(i32 %0) {
%2 = alloca i16
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @checkPid.buf, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @F_OK
%7 = call i32 @access(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @checkPid.buf, i64 0, i64 0), i32 %6)
%8 = icmp ne i32 -1, %7
br i1 %8, label %9, label %10
9: ; preds = %1
store i16 1, i16* %2
br label %11
10: ; preds = %1
store i16 0, i16* %2
br label %11
11: ; preds = %10, %9
%12 = load i16, i16* %2
ret i16 %12
}

LLVM IR (-O2):
@checkPid.buf = internal global [128 x i8] zeroinitializer
@.str = [14 x i8] c"/proc/%d/stat\00"
@F_OK = global i32 0
define signext i16 @checkPid(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @checkPid.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = load i32, i32* @F_OK
%4 = tail call i32 @access(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @checkPid.buf, i64 0, i64 0), i32 %3)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i16
ret i16 %6
}
/* Type definitions */
struct confElement {
  int dummy;
};
struct DCirList {
  int dummy;
};

/* Variables and functions */
scalar_t__ addNode(struct DCirList *, struct DCirList **);
struct confElement *addElement(struct confElement *elNew,
                               struct confElement **elAfter) {
  return (struct confElement *)addNode((struct DCirList *)elNew,
                                       (struct DCirList **)elAfter);
}


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

x86 assembly (clang, -O2):
<addElement>:
jmp    1030 <addNode@plt>

LLVM IR (-O0):
%struct.confElement = type { i32 }
%struct.DCirList = type { i32 }
define %struct.confElement* @addElement(%struct.confElement* %0, %struct.confElement** %1) {
%3 = alloca %struct.confElement*
%4 = alloca %struct.confElement**
store %struct.confElement* %0, %struct.confElement** %3
store %struct.confElement** %1, %struct.confElement*** %4
%5 = load %struct.confElement*, %struct.confElement** %3
%6 = bitcast %struct.confElement* %5 to %struct.DCirList*
%7 = load %struct.confElement**, %struct.confElement*** %4
%8 = bitcast %struct.confElement** %7 to %struct.DCirList**
%9 = call i64 @addNode(%struct.DCirList* %6, %struct.DCirList** %8)
%10 = inttoptr i64 %9 to %struct.confElement*
ret %struct.confElement* %10
}

LLVM IR (-O2):
%struct.confElement = type { i32 }
%struct.DCirList = type { i32 }
define %struct.confElement* @addElement(%struct.confElement* %0, %struct.confElement** %1) {
%3 = bitcast %struct.confElement* %0 to %struct.DCirList*
%4 = bitcast %struct.confElement** %1 to %struct.DCirList**
%5 = tail call i64 @addNode(%struct.DCirList* %3, %struct.DCirList** %4)
%6 = inttoptr i64 %5 to %struct.confElement*
ret %struct.confElement* %6
}
void destroy_matrix(char **mat) {
  int i;
  for (i = 0; mat[i]; i++)
    free(mat[i]);
  free(mat);
}


x86 assembly (clang, -O0):
<destroy_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1155 <destroy_matrix+0x45>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <destroy_matrix+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <destroy_matrix+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <destroy_matrix+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @destroy_matrix(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
/* Variables and functions */
char getchar();
char AttendTouche(char key) {
  char c;
  while ((c = getchar()) != key)
    ;
  return (c);
}


x86 assembly (clang, -O0):
<AttendTouche>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x2(%rbp)
movsbl %al,%eax
movsbl -0x1(%rbp),%ecx
cmp    %ecx,%eax
je     113c <AttendTouche+0x2c>
jmp    111e <AttendTouche+0xe>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AttendTouche>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    %bl,%al
jne    1120 <AttendTouche+0x10>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @AttendTouche(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call signext i8 (...) @getchar()
%4 = icmp eq i8 %3, %0
br i1 %4, label %5, label %2
5: ; preds = %2
ret i8 %0
}
/* Variables and functions */
int BBM_SCAN_STATUS(void *);
int mtv_lock_check(void *hDevice) {
  int res;
  res = BBM_SCAN_STATUS(hDevice);
  return res;
}


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

x86 assembly (clang, -O2):
<mtv_lock_check>:
jmp    1030 <BBM_SCAN_STATUS@plt>

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

LLVM IR (-O2):
define i32 @mtv_lock_check(i8* %0) {
%2 = tail call i32 @BBM_SCAN_STATUS(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HiveX_motor_setDirection(int, int);
void turnLeft() {
  HiveX_motor_setDirection(0, 0);
  HiveX_motor_setDirection(1, 1);
}


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

x86 assembly (clang, -O2):
<turnLeft>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1030 <HiveX_motor_setDirection@plt>
mov    $0x1,%edi
mov    $0x1,%esi
pop    %rax
jmp    1030 <HiveX_motor_setDirection@plt>

LLVM IR (-O0):
define void @turnLeft() {
%1 = call i32 @HiveX_motor_setDirection(i32 0, i32 0)
%2 = call i32 @HiveX_motor_setDirection(i32 1, i32 1)
ret void
}

LLVM IR (-O2):
define void @turnLeft() {
%1 = tail call i32 @HiveX_motor_setDirection(i32 0, i32 0)
%2 = tail call i32 @HiveX_motor_setDirection(i32 1, i32 1)
ret void
}
int Checkyear(int year) {
  if (year > 0) {
    if (year < 100) {
      if (year > 50) {
        return 191;
      } else {
        return 201;
      }
    } else if (year > 2100) {
      return 0;
    }
  } else {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<Checkyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1160 <Checkyear+0x60>
cmpl   $0x64,-0x8(%rbp)
jge    113d <Checkyear+0x3d>
cmpl   $0x32,-0x8(%rbp)
jle    1131 <Checkyear+0x31>
movl   $0xbf,-0x4(%rbp)
jmp    1173 <Checkyear+0x73>
movl   $0xc9,-0x4(%rbp)
jmp    1173 <Checkyear+0x73>
cmpl   $0x834,-0x8(%rbp)
jle    1156 <Checkyear+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1173 <Checkyear+0x73>
jmp    115b <Checkyear+0x5b>
jmp    116c <Checkyear+0x6c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <Checkyear+0x73>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Checkyear>:
test   %edi,%edi
jle    111a <Checkyear+0x1a>
cmp    $0x63,%edi
ja     1120 <Checkyear+0x20>
cmp    $0x33,%edi
mov    $0xbf,%ecx
mov    $0xc9,%eax
cmovae %ecx,%eax
ret
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
cmp    $0x835,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @Checkyear(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 100
br i1 %8, label %9, label %14
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 50
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 191, i32* %2
br label %22
13: ; preds = %9
store i32 201, i32* %2
br label %22
14: ; preds = %6
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 2100
br i1 %16, label %17, label %18
17: ; preds = %14
store i32 0, i32* %2
br label %22
18: ; preds = %14
br label %19
19: ; preds = %18
br label %21
20: ; preds = %1
store i32 -1, i32* %2
br label %22
21: ; preds = %19
store i32 1, i32* %2
br label %22
22: ; preds = %21, %20, %17, %13, %12
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
define i32 @Checkyear(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = icmp ult i32 %0, 100
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = icmp ugt i32 %0, 50
%7 = select i1 %6, i32 191, i32 201
br label %11
8: ; preds = %3
%9 = icmp ult i32 %0, 2101
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %1, %8, %5
%12 = phi i32 [ %7, %5 ], [ %10, %8 ], [ -1, %1 ]
ret i32 %12
}
int suc(int x) { return (x + 1); }


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

x86 assembly (clang, -O2):
<suc>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @suc(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ init_locker(void (*)());
int main(int argc, char **argv) {
  void (*lock_session)(void);
  if (init_locker(&lock_session) != 0) {
    return -1;
  }
  lock_session();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <init_locker@plt>
cmp    $0x0,%rax
je     1145 <main+0x35>
movl   $0xffffffff,-0x4(%rbp)
jmp    114f <main+0x3f>
call   *-0x18(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <init_locker@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
je     1128 <main+0x18>
pop    %rcx
ret
call   *(%rsp)
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca void ()*
%4 = bitcast void ()** %3 to i8*
%5 = bitcast void ()** %3 to void (...)*
%6 = call i64 @init_locker(void (...)* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load void ()*, void ()** %3
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ 0, %8 ], [ -1, %2 ]
ret i32 %11
}
/* Variables and functions */
char *str_format(char *, long);
char *str_from_long(long value) { return str_format("%ld", value); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define i8* @str_from_long(i64 %0) {
%2 = tail call i8* @str_format(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* %2
}
int main(int argc, char **argv) {
  int x;
  double r = argc;
  if (0 >= r) {
    x = 7;
  } else {
    x = 42;
  }
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1136 <main+0x36>
movl   $0x7,-0x14(%rbp)
jmp    113d <main+0x3d>
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
test   %edi,%edi
mov    $0x7,%ecx
mov    $0x2a,%eax
cmovle %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
store double %9, double* %7
%10 = load double, double* %7
%11 = fcmp oge double 0.000000e+00, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 7, i32* %6
br label %14
13: ; preds = %2
store i32 42, i32* %6
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 1
%4 = select i1 %3, i32 7, i32 42
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_error();
int /*<<< orphan*/ isEmpty();
void __VERIFIER_atomic_assert(int r) {
  {
    if (!(!(!r || !isEmpty()))) {
    ERROR:
      __VERIFIER_error();
      (void)0;
    }
  };
}


x86 assembly (clang, -O0):
<__VERIFIER_atomic_assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1145 <__VERIFIER_atomic_assert+0x25>
mov    $0x0,%al
call   1030 <isEmpty@plt>
cmp    $0x0,%eax
jne    1151 <__VERIFIER_atomic_assert+0x31>
jmp    114a <__VERIFIER_atomic_assert+0x2a>
mov    $0x0,%al
call   1040 <__VERIFIER_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_atomic_assert>:
test   %edi,%edi
je     1136 <__VERIFIER_atomic_assert+0x16>
push   %rax
xor    %eax,%eax
call   1030 <isEmpty@plt>
test   %eax,%eax
lea    0x8(%rsp),%rsp
je     1136 <__VERIFIER_atomic_assert+0x16>
ret
xor    %eax,%eax
jmp    1040 <__VERIFIER_error@plt>

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

LLVM IR (-O2):
define void @__VERIFIER_atomic_assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (...) @isEmpty()
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1, %3
%7 = tail call i32 (...) @__VERIFIER_error()
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t swap_btol16(uint16_t data) {
  uint16_t swapped_data;
  swapped_data = (data >> 8) & 0x00FF;
  swapped_data |= (data << 8) & 0xFF00;
  return swapped_data;
}


x86 assembly (clang, -O0):
<swap_btol16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_btol16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @swap_btol16(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 8
%6 = and i32 %5, 255
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = shl i32 %7, 8
%9 = and i32 %8, 65280
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @swap_btol16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
double ls_costN_nm3_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_costN_nm3_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_costN_nm3_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_costN_nm3_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_costN_nm3_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ dimms_read(int);
void sdram_assert_command(void) { dimms_read(0x400); }


x86 assembly (clang, -O0):
<sdram_assert_command>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400,%edi
call   1030 <dimms_read@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdram_assert_command>:
mov    $0x400,%edi
jmp    1030 <dimms_read@plt>

LLVM IR (-O0):
define void @sdram_assert_command() {
%1 = call i32 @dimms_read(i32 1024)
ret void
}

LLVM IR (-O2):
define void @sdram_assert_command() {
%1 = tail call i32 @dimms_read(i32 1024)
ret void
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn20() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn20");
  return result;
}


x86 assembly (clang, -O0):
<fn20>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn20>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"fn20\00"
define i8* @fn20() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"fn20\00"
define i8* @fn20() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int squarer(int num) { return num * num; }


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

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

LLVM IR (-O0):
define i32 @squarer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @squarer(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void gtk_im_context_get_surrounding() {}


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

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

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

LLVM IR (-O2):
define void @gtk_im_context_get_surrounding() {
ret void
}
/* Variables and functions */
double log(double);
double _quaternion_scalar_log(double s) { return log(s); }


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

x86 assembly (clang, -O2):
<_quaternion_scalar_log>:
jmp    1030 <log@plt>

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

LLVM IR (-O2):
define double @_quaternion_scalar_log(double %0) {
%2 = tail call double @log(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello world from Ricardo Borunda!\n");
  printf("I learned that 2+2=%d\n", 2 + 2);
  printf("The grade I am working for is:%c\n", 'A');
  printf("The temperature outside is barely %f degrees\n", 32.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
mov    $0x41,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Hello world from Ricardo Borunda!\0A\00"
@.str.1 = [23 x i8] c"I learned that 2+2=%d\0A\00"
@.str.2 = [34 x i8] c"The grade I am working for is:%c\0A\00"
@.str.3 = [46 x i8] c"The temperature outside is barely %f degrees\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 65)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), double 3.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"I learned that 2+2=%d\0A\00"
@.str.2 = [34 x i8] c"The grade I am working for is:%c\0A\00"
@.str.3 = [46 x i8] c"The temperature outside is barely %f degrees\0A\00"
@str = [34 x i8] c"Hello world from Ricardo Borunda!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i32 65)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), double 3.200000e+01)
ret i32 0
}
void foo541() {}


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

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

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

LLVM IR (-O2):
define void @foo541() {
ret void
}
long long bit41() { return 0x0000020000000000LL; }


x86 assembly (clang, -O0):
<bit41>:
push   %rbp
mov    %rsp,%rbp
movabs $0x20000000000,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit41>:
movabs $0x20000000000,%rax
ret

LLVM IR (-O0):
define i64 @bit41() {
ret i64 2199023255552
}

LLVM IR (-O2):
define i64 @bit41() {
ret i64 2199023255552
}
/* Variables and functions */
float stof(char *);
char *strstr(char *, char *);
float parseRate(char *str) {
  char *szRate = strstr(str, ",") + 1;
  *strstr(szRate, ",") = 0;
  return stof(szRate);
}


x86 assembly (clang, -O0):
<parseRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strstr@plt>
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb1(%rip),%rsi
call   1040 <strstr@plt>
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <stof@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseRate>:
push   %rbx
mov    $0x2c,%esi
call   1040 <strchr@plt>
lea    0x1(%rax),%rbx
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1040 <strchr@plt>
movb   $0x0,(%rax)
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <stof@plt>

LLVM IR (-O0):
@.str = [2 x i8] c",\00"
define float @parseRate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @strstr(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* %8
%9 = load i8*, i8** %3
%10 = call float @stof(i8* %9)
ret float %10
}

LLVM IR (-O2):
define float @parseRate(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 44)
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = tail call i8* @strchr(i8* %3, i32 44)
store i8 0, i8* %4
%5 = tail call float @stof(i8* %3)
ret float %5
}