xunge/DecIR huggingface dataset:
/* Variables and functions */
void *MAP_FAILED;
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ PROT_READ;
void *mmap(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int, int /*<<< orphan*/);
void *memleak_mmap2() {
  void *data = mmap(NULL, 10, PROT_READ, MAP_PRIVATE, 1, 0);
  if (data != MAP_FAILED)
    return data;
  return NULL;
}


x86 assembly (clang, -O0):
<memleak_mmap2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ed9(%rip),%rax
mov    (%rax),%edx
mov    0x2eb0(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0xa,%esi
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%rax
je     1166 <memleak_mmap2+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116e <memleak_mmap2+0x5e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memleak_mmap2>:
push   %rbx
mov    0x2ee0(%rip),%rax
mov    (%rax),%edx
mov    0x2eb7(%rip),%rax
mov    (%rax),%ecx
xor    %ebx,%ebx
xor    %edi,%edi
mov    $0xa,%esi
mov    $0x1,%r8d
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    0x2e8f(%rip),%rcx
cmp    (%rcx),%rax
cmove  %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
define i8* @memleak_mmap2() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i32, i32* @PROT_READ
%4 = load i32, i32* @MAP_PRIVATE
%5 = call i8* @mmap(i32* null, i32 10, i32 %3, i32 %4, i32 1, i32 0)
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = load i8*, i8** @MAP_FAILED
%8 = icmp ne i8* %6, %7
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = load i8*, i8** %2
store i8* %10, i8** %1
br label %12
11: ; preds = %0
store i8* null, i8** %1
br label %12
12: ; preds = %11, %9
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@MAP_PRIVATE = global i32 0
@MAP_FAILED = global i8* null
define i8* @memleak_mmap2() {
%1 = load i32, i32* @PROT_READ
%2 = load i32, i32* @MAP_PRIVATE
%3 = tail call i8* @mmap(i32* null, i32 10, i32 %1, i32 %2, i32 1, i32 0)
%4 = load i8*, i8** @MAP_FAILED
%5 = icmp eq i8* %3, %4
%6 = select i1 %5, i8* null, i8* %3
ret i8* %6
}
/* Variables and functions */
int Cmd_Argc();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Con_Printf(char *, ...);
void Cmd_Echo_f(void) {
  int i;
  for (i = 1; i < Cmd_Argc(); i++)
    Con_Printf("%s ", Cmd_Argv(i));
  Con_Printf("\n");
}


x86 assembly (clang, -O0):
<Cmd_Echo_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cmp    %ecx,%eax
jge    117f <Cmd_Echo_f+0x4f>
mov    -0x4(%rbp),%edi
call   1050 <Cmd_Argv@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <Con_Printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <Cmd_Echo_f+0xf>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <Con_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_Echo_f>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jl     1171 <Cmd_Echo_f+0x41>
mov    $0x1,%ebx
lea    0xeb4(%rip),%r14
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <Cmd_Argv@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <Con_Printf@plt>
add    $0x1,%ebx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    %eax,%ebx
jl     1150 <Cmd_Echo_f+0x20>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <Con_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = call i32 (...) @Cmd_Argc()
%5 = icmp slt i32 %3, %4
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = load i32, i32* %1
%8 = call i32 @Cmd_Argv(i32 %7)
%9 = call i32 (i8*, ...) @Con_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 1
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = call i32 (i8*, ...) @Con_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @Cmd_Echo_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp sgt i32 %1, 1
br i1 %2, label %3, label %10
3: ; preds = %0, %3
%4 = phi i32 [ %7, %3 ], [ 1, %0 ]
%5 = tail call i32 @Cmd_Argv(i32 %4)
%6 = tail call i32 (i8*, ...) @Con_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = add nuw nsw i32 %4, 1
%8 = tail call i32 (...) @Cmd_Argc()
%9 = icmp slt i32 %7, %8
br i1 %9, label %3, label %10
10: ; preds = %3, %0
%11 = tail call i32 (i8*, ...) @Con_Printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t parent(size_t i) { return (i - 1) >> 1; }


x86 assembly (clang, -O0):
<parent>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
sub    $0x1,%rax
shr    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parent>:
lea    -0x1(%rdi),%rax
shr    %rax
ret

LLVM IR (-O0):
define i64 @parent(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub i64 %3, 1
%5 = lshr i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @parent(i64 %0) {
%2 = add i64 %0, -1
%3 = lshr i64 %2, 1
ret i64 %3
}
const char *db_create_jes_table_sql(void) {
  static const char *query =
      "CREATE TABLE jes ("
      "    id         INTEGER         NOT NULL AUTO_INCREMENT,"
      "    user       INTEGER         NOT NULL,"
      "    period     INTEGER         NOT NULL,"
      "    year       INTEGER         NOT NULL,"
      "    source     VARCHAR(10)     NOT NULL,"
      "    entity     INTEGER         NOT NULL,"
      "    memo       VARCHAR(100)    NOT NULL,"
      "    posted     TIMESTAMP       NOT NULL DEFAULT CURRENT_TIMESTAMP,"
      "  CONSTRAINT jes_pk"
      "    PRIMARY KEY (id),"
      "  CONSTRAINT jes_user_fk"
      "    FOREIGN KEY (user)"
      "    REFERENCES users(id),"
      "  CONSTRAINT jes_entity_fk"
      "    FOREIGN KEY (entity)"
      "    REFERENCES entities(id),"
      "  CONSTRAINT jes_source_fk"
      "    FOREIGN KEY (source)"
      "    REFERENCES jesrcs(name)"
      ");";
  return query;
}


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

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

LLVM IR (-O0):
@db_create_jes_table_sql.query = internal global i8* getelementptr inbounds ([648 x i8], [648 x i8]* @.str, i32 0, i32 0)
@.str = [648 x i8] c"CREATE TABLE jes ( id INTEGER NOT NULL AUTO_INCREMENT, user INTEGER NOT NULL, period INTEGER NOT NULL, year INTEGER NOT NULL, source VARCHAR(10) NOT NULL, entity INTEGER NOT NULL, memo VARCHAR(100) NOT NULL, posted TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT jes_pk PRIMARY KEY (id), CONSTRAINT jes_user_fk FOREIGN KEY (user) REFERENCES users(id), CONSTRAINT jes_entity_fk FOREIGN KEY (entity) REFERENCES entities(id), CONSTRAINT jes_source_fk FOREIGN KEY (source) REFERENCES jesrcs(name));\00"
define i8* @db_create_jes_table_sql() {
%1 = load i8*, i8** @db_create_jes_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [648 x i8] c"CREATE TABLE jes ( id INTEGER NOT NULL AUTO_INCREMENT, user INTEGER NOT NULL, period INTEGER NOT NULL, year INTEGER NOT NULL, source VARCHAR(10) NOT NULL, entity INTEGER NOT NULL, memo VARCHAR(100) NOT NULL, posted TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT jes_pk PRIMARY KEY (id), CONSTRAINT jes_user_fk FOREIGN KEY (user) REFERENCES users(id), CONSTRAINT jes_entity_fk FOREIGN KEY (entity) REFERENCES entities(id), CONSTRAINT jes_source_fk FOREIGN KEY (source) REFERENCES jesrcs(name));\00"
define i8* @db_create_jes_table_sql() {
ret i8* getelementptr inbounds ([648 x i8], [648 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_volume_func_init_sse() {
  printf("NOT IMPLEMENTED:"
         "pa_volume_func_init_sse"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"NOT IMPLEMENTED:pa_volume_func_init_sse\0A\00"
define i32 @pa_volume_func_init_sse() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_volume_func_init_sse\00"
define i32 @pa_volume_func_init_sse() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_REALTIME;
int clock_nanosleep(int /*<<< orphan*/, int /*<<< orphan*/,
                    struct timespec const *, struct timespec *);
int nanosleep(const struct timespec *req, struct timespec *rem) {
  return clock_nanosleep(CLOCK_REALTIME, 0, req, rem);
}


x86 assembly (clang, -O0):
<nanosleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <clock_nanosleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nanosleep>:
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
jmp    1030 <clock_nanosleep@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @CLOCK_REALTIME
%6 = load %struct.timespec*, %struct.timespec** %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @clock_nanosleep(i32 %5, i32 0, %struct.timespec* %6, %struct.timespec* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_REALTIME = global i32 0
define i32 @nanosleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = load i32, i32* @CLOCK_REALTIME
%4 = tail call i32 @clock_nanosleep(i32 %3, i32 0, %struct.timespec* %0, %struct.timespec* %1)
ret i32 %4
}
int f4(int (*p)[], int (*q)[3]) { return p >= q; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
xor    %eax,%eax
cmp    %rdi,%rsi
setbe  %al
ret

LLVM IR (-O0):
define i32 @f4([0 x i32]* %0, [3 x i32]* %1) {
%3 = alloca [0 x i32]*
%4 = alloca [3 x i32]*
store [0 x i32]* %0, [0 x i32]** %3
store [3 x i32]* %1, [3 x i32]** %4
%5 = load [0 x i32]*, [0 x i32]** %3
%6 = load [3 x i32]*, [3 x i32]** %4
%7 = bitcast [3 x i32]* %6 to [0 x i32]*
%8 = icmp uge [0 x i32]* %5, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @f4([0 x i32]* readnone %0, [3 x i32]* readnone %1) {
%3 = bitcast [3 x i32]* %1 to [0 x i32]*
%4 = icmp ule [0 x i32]* %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int strtod(char const *, char **);
int is_numeric(const char *s) {
  char *p;
  if (s == NULL || *s == '\0')
    return 0;
  int n = strtod(s, &p);
  (void)n;
  return *p == '\0';
}


x86 assembly (clang, -O0):
<is_numeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1137 <is_numeric+0x27>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1143 <is_numeric+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_numeric+0x58>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <strtod@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_numeric>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1131 <is_numeric+0x21>
cmpb   $0x0,(%rdi)
je     1131 <is_numeric+0x21>
mov    %rsp,%rsi
call   1030 <strtod@plt>
mov    (%rsp),%rcx
xor    %eax,%eax
cmpb   $0x0,(%rcx)
sete   %al
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @is_numeric(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = icmp eq i8* %0, null
br i1 %4, label %14, label %5
5: ; preds = %1
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %5
%9 = call i32 @strtod(i8* %0, i8** %2)
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %1, %5, %8
%15 = phi i32 [ %13, %8 ], [ 0, %5 ], [ 0, %1 ]
ret i32 %15
}
int test_imm_C2uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0xC2 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C2uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0xc2,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C2uint64_lowword_reg>:
test   $0xc2,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C2uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 194
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void devlib_quit() {}


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

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

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

LLVM IR (-O2):
define void @devlib_quit() {
ret void
}
/* Variables and functions */
int sprintf(char *, char *, int);
int intToString(int i, char *arr) {
  int t_len = sprintf(arr, "%d", i);
  arr[t_len] = '\0';
  return t_len;
}


x86 assembly (clang, -O0):
<intToString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToString>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%edx
lea    0xee3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @intToString(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32, i32* %3
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %5
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
store i8 0, i8* %12
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @intToString(i32 %0, i8* nocapture writeonly %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
store i8 0, i8* %5
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void overwriteSYSCALL() {
  uint32_t *address = (uint32_t *)0xC00;
  int nopSledLength = 1;
  while (nopSledLength > 0) {
    *address = 0x15000002;
    address += 1;
    --nopSledLength;
  }
  *address = 0x24000000;
}


x86 assembly (clang, -O0):
<overwriteSYSCALL>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc00,%eax
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1142 <overwriteSYSCALL+0x42>
mov    -0x8(%rbp),%rax
movl   $0x15000002,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <overwriteSYSCALL+0x14>
mov    -0x8(%rbp),%rax
movl   $0x24000000,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<overwriteSYSCALL>:
movl   $0x15000002,0xc00
movl   $0x24000000,0xc04
ret

LLVM IR (-O0):
define void @overwriteSYSCALL() {
%1 = alloca i32*
%2 = alloca i32
store i32* inttoptr (i64 3072 to i32*), i32** %1
store i32 1, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32*, i32** %1
store i32 352321538, i32* %7
%8 = load i32*, i32** %1
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32* %9, i32** %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32*, i32** %1
store i32 603979776, i32* %13
ret void
}

LLVM IR (-O2):
define void @overwriteSYSCALL() {
store i32 352321538, i32* inttoptr (i64 3072 to i32*)
store i32 603979776, i32* inttoptr (i64 3076 to i32*)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
main() {
  time_t x;
  strftime("", 1, "", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%ecx
lea    0xede(%rip),%rdx
mov    $0x1,%esi
mov    %rdx,%rdi
call   1030 <strftime@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @strftime(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @main() {
%1 = tail call i32 @strftime(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 undef)
ret i32 0
}
void irq_8259_eoi(int irq) {}


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

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

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

LLVM IR (-O2):
define void @irq_8259_eoi(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fail_die_malloc_die(size_t, char const *, int);
void *malloc(size_t);
void *fail_die_malloc(size_t size, const char *file, int line) {
  void *p = malloc(size);
  if (!p && size)
    fail_die_malloc_die(size, file, line);
  return p;
}


x86 assembly (clang, -O0):
<fail_die_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1166 <fail_die_malloc+0x46>
cmpq   $0x0,-0x8(%rbp)
je     1166 <fail_die_malloc+0x46>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <fail_die_malloc_die@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fail_die_malloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%rbp
test   %rbx,%rbx
je     1150 <fail_die_malloc+0x30>
test   %rbp,%rbp
jne    1150 <fail_die_malloc+0x30>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1040 <fail_die_malloc_die@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @fail_die_malloc(i64 %0, i8* %1, i32 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i64, i64* %4
%9 = call i8* @malloc(i64 %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %20, label %12
12: ; preds = %3
%13 = load i64, i64* %4
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load i64, i64* %4
%17 = load i8*, i8** %5
%18 = load i32, i32* %6
%19 = call i32 @fail_die_malloc_die(i64 %16, i8* %17, i32 %18)
br label %20
20: ; preds = %15, %12, %3
%21 = load i8*, i8** %7
ret i8* %21
}

LLVM IR (-O2):
define noalias i8* @fail_die_malloc(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @malloc(i64 %0)
%5 = icmp eq i8* %4, null
%6 = icmp ne i64 %0, 0
%7 = and i1 %6, %5
br i1 %7, label %8, label %10
8: ; preds = %3
%9 = tail call i32 @fail_die_malloc_die(i64 %0, i8* %1, i32 %2)
br label %10
10: ; preds = %8, %3
ret i8* %4
}
/* Variables and functions */
char *setlocale(int, int /*<<< orphan*/ *);
char *getlocale(int lc) { return setlocale(lc, NULL); }


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

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

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

LLVM IR (-O2):
define i8* @getlocale(i32 %0) {
%2 = tail call i8* @setlocale(i32 %0, i32* null)
ret i8* %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_clmulepi64_si128(int /*<<< orphan*/ const,
                                        int /*<<< orphan*/ const, int);
int /*<<< orphan*/ _mm_set_epi64(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i hash_size(const uint64_t k_pprime, const uint64_t len) {
  const __m128i x = _mm_set_epi64((__m64)k_pprime, (__m64)len);
  return _mm_clmulepi64_si128(x, x, 0x01);
}


x86 assembly (clang, -O0):
<hash_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
call   1040 <_mm_set_epi64@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
call   1030 <_mm_clmulepi64_si128@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_size>:
push   %rax
call   1040 <_mm_set_epi64@plt>
mov    %eax,%edi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <_mm_clmulepi64_si128@plt>

LLVM IR (-O0):
define i32 @hash_size(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = trunc i64 %6 to i32
%8 = load i64, i64* %4
%9 = trunc i64 %8 to i32
%10 = call i32 @_mm_set_epi64(i32 %7, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i32, i32* %5
%13 = call i32 @_mm_clmulepi64_si128(i32 %11, i32 %12, i32 1)
ret i32 %13
}

LLVM IR (-O2):
define i32 @hash_size(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = trunc i64 %1 to i32
%5 = tail call i32 @_mm_set_epi64(i32 %3, i32 %4)
%6 = tail call i32 @_mm_clmulepi64_si128(i32 %5, i32 %5, i32 1)
ret i32 %6
}
int invalid_type(int type) { return type != 4 && type != 5; }


x86 assembly (clang, -O0):
<invalid_type>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <invalid_type+0x20>
cmpl   $0x5,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<invalid_type>:
and    $0xfffffffe,%edi
xor    %eax,%eax
cmp    $0x4,%edi
setne  %al
ret

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

LLVM IR (-O2):
define i32 @invalid_type(i32 %0) {
%2 = and i32 %0, -2
%3 = icmp ne i32 %2, 4
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void our_exit(int status, void *unused) { exit(status); }


x86 assembly (clang, -O0):
<our_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<our_exit>:
push   %rax
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @our_exit(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char *_dl_sysdep_open_object(const char *name, size_t namelen, int *fd) {
  assert(*fd == -1);
  return NULL;
}


x86 assembly (clang, -O0):
<_dl_sysdep_open_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0xffffffff,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dl_sysdep_open_object>:
push   %rax
xor    %edi,%edi
cmpl   $0xffffffff,(%rdx)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @_dl_sysdep_open_object(i8* %0, i64 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, -1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @_dl_sysdep_open_object(i8* nocapture readnone %0, i64 %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, -1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i8* null
}
void _string_write_char(char c, void **param) {
  char **pnt = (char **)param;
  **pnt = c;
  (*pnt)++;
}


x86 assembly (clang, -O0):
<_string_write_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x1(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string_write_char>:
mov    (%rsi),%rax
mov    %dil,(%rax)
addq   $0x1,(%rsi)
ret

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

LLVM IR (-O2):
define void @_string_write_char(i8 signext %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
store i8 %0, i8* %3
%4 = load i8*, i8** %1
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_diagnostor();
int /*<<< orphan*/ test_panic();
int main(void) {
  test_diagnostor();
  test_panic();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_diagnostor@plt>
xor    %eax,%eax
call   1040 <test_panic@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_diagnostor()
%2 = tail call i32 (...) @test_panic()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void strcat_overflow_0(char *y) {
  char x[4] = "12";
  if (strlen(y) == 4)
    strcat(x, y);
}


x86 assembly (clang, -O0):
<strcat_overflow_0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
jne    1154 <strcat_overflow_0+0x34>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_overflow_0>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x3231,0xc(%rsp)
call   1030 <strlen@plt>
cmp    $0x4,%eax
jne    1147 <strcat_overflow_0+0x27>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.strcat_overflow_0.x = [4 x i8] c"12\00\00"
define void @strcat_overflow_0(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = bitcast [4 x i8]* %3 to i8*
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = icmp eq i32 %6, 4
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i32 @strcat(i8* %9, i8* %10)
br label %12
12: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @strcat_overflow_0(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 12849, i32* %2
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strcat(i8* %3, i8* %0)
br label %8
8: ; preds = %6, %1
ret void
}
void console_non_blocking_mode(void) {}


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

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

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

LLVM IR (-O2):
define void @console_non_blocking_mode() {
ret void
}
int test_06(int a, int b, int c, int d) { return 0 - a - (b == c); }


x86 assembly (clang, -O0):
<test_06>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_06>:
xor    %eax,%eax
cmp    %edx,%esi
sete   %al
add    %edi,%eax
neg    %eax
ret

LLVM IR (-O0):
define i32 @test_06(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = sub nsw i32 0, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp eq i32 %11, %12
%14 = zext i1 %13 to i32
%15 = sub nsw i32 %10, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @test_06(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %1, %2
%6 = sext i1 %5 to i32
%7 = sub i32 %6, %0
ret i32 %7
}
char *get_cpu_name(void) { return "SAMA7G5"; }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"SAMA7G5\00"
define i8* @get_cpu_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [8 x i8] c"SAMA7G5\00"
define i8* @get_cpu_name() {
ret i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BN_BLINDING;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int BN_BLINDING_convert_ex(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx) {
  return BN_BLINDING_convert_ex(n, NULL, b, ctx);
}


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

x86 assembly (clang, -O2):
<BN_BLINDING_convert>:
mov    %rdx,%rcx
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <BN_BLINDING_convert_ex@plt>

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

LLVM IR (-O2):
define i32 @BN_BLINDING_convert(i32* %0, i32* %1, i32* %2) {
%4 = tail call i32 @BN_BLINDING_convert_ex(i32* %0, i32* null, i32* %1, i32* %2)
ret i32 %4
}
void reverse_chars(char *s, int start, int end) {
  if (start < end) {
    char c = s[start];
    s[start] = s[end];
    s[end] = c;
    reverse_chars(s, start + 1, end - 1);
  }
}


x86 assembly (clang, -O0):
<reverse_chars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1175 <reverse_chars+0x65>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
call   1030 <reverse_chars@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_chars>:
cmp    %edx,%esi
jge    1131 <reverse_chars+0x31>
movslq %edx,%rax
movslq %esi,%rcx
add    $0xffffffffffffffff,%rax
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse_chars+0x10>
ret

LLVM IR (-O0):
define void @reverse_chars(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %36
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
store i8 %16, i8* %7
%17 = load i8*, i8** %4
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = load i8*, i8** %4
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 %21, i8* %25
%26 = load i8, i8* %7
%27 = load i8*, i8** %4
%28 = load i32, i32* %6
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
store i8 %26, i8* %30
%31 = load i8*, i8** %4
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
%34 = load i32, i32* %6
%35 = sub nsw i32 %34, 1
br label %36
36: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @reverse_chars(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %2 to i64
%7 = sext i32 %1 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %15, %8 ]
%10 = phi i64 [ %6, %5 ], [ %16, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %9
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %10
%14 = load i8, i8* %13
store i8 %14, i8* %11
store i8 %12, i8* %13
%15 = add nsw i64 %9, 1
%16 = add nsw i64 %10, -1
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
void X509_ATTRIBUTE_count(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_ATTRIBUTE_count() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_an_allocation(void *fr) { free(fr); }


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

x86 assembly (clang, -O2):
<free_an_allocation>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_an_allocation(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int test_imm_55uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x55 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_55uint64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x55,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_55uint64_lowword_reg>:
test   $0x55,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_55uint64_lowword_reg(i64 %0) {
%2 = and i64 %0, 85
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ putchar(int);
int main(int argc, const char *argv[]) {
  int c;
  while ((c = getchar()) != EOF) {
    putchar(c);
  }
  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)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea1(%rip),%rcx
cmp    (%rcx),%eax
je     115c <main+0x3c>
mov    -0x14(%rbp),%edi
call   1030 <putchar@plt>
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2eb9(%rip),%rbx
cmp    (%rbx),%eax
je     1152 <main+0x32>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%eax
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i32 0
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
br label %7
7: ; preds = %11, %2
%8 = call i32 (...) @getchar()
store i32 %8, i32* %6
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %6
%13 = call i32 @putchar(i32 %12)
br label %7
14: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putchar(i32 %7)
%9 = tail call i32 (...) @getchar()
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_get_autoload_info_by_name() {
  printf("NOT IMPLEMENTED:"
         "pa_context_get_autoload_info_by_name"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [54 x i8] c"NOT IMPLEMENTED:pa_context_get_autoload_info_by_name\0A\00"
define i32 @pa_context_get_autoload_info_by_name() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [53 x i8] c"NOT IMPLEMENTED:pa_context_get_autoload_info_by_name\00"
define i32 @pa_context_get_autoload_info_by_name() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void Eioccc(void) { error("Obfuscated preprocessor control line"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"Obfuscated preprocessor control line\00"
define void @Eioccc() {
%1 = call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Obfuscated preprocessor control line\00"
define void @Eioccc() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}
void next_Seqstr(_loc, _Base_Seqstr, _loc_0, _Base_Seqstr_0) int *_loc,
    *_Base_Seqstr, _loc_0, _Base_Seqstr_0;
{ Seqstr_NEXT_FNC_OBJ(_loc, _Base_Seqstr, _loc_0, _Base_Seqstr_0); }


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

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

LLVM IR (-O0):
define void @next_Seqstr(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32*, i32** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Seqstr_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %9, i32* %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @next_Seqstr(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Seqstr_NEXT_FNC_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %0, i32* %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPER_I_16();
int /*<<< orphan*/ m68ki_set_ccr(int /*<<< orphan*/);
void m68k_op_move_16_toc_i(void) { m68ki_set_ccr(OPER_I_16()); }


x86 assembly (clang, -O0):
<m68k_op_move_16_toc_i>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <OPER_I_16@plt>
mov    %eax,%edi
call   1030 <m68ki_set_ccr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_move_16_toc_i>:
push   %rax
xor    %eax,%eax
call   1040 <OPER_I_16@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <m68ki_set_ccr@plt>

LLVM IR (-O0):
define void @m68k_op_move_16_toc_i() {
%1 = call i32 (...) @OPER_I_16()
%2 = call i32 @m68ki_set_ccr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @m68k_op_move_16_toc_i() {
%1 = tail call i32 (...) @OPER_I_16()
%2 = tail call i32 @m68ki_set_ccr(i32 %1)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
int recv(int, char *, size_t, int);
ssize_t socket_receive(int sock, char *buf, size_t size, int flags) {
  ssize_t receiveSize;
  if ((receiveSize = recv(sock, buf, size, flags)) < 0) {
    perror("socket_recv() -> recv()");
    return -1;
  }
  return receiveSize;
}


x86 assembly (clang, -O0):
<socket_receive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <recv@plt>
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
jge    116d <socket_receive+0x4d>
lea    0xea4(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <socket_receive+0x53>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_receive>:
push   %rax
call   1030 <recv@plt>
test   %eax,%eax
js     112c <socket_receive+0xc>
pop    %rcx
ret
lea    0xecd(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"socket_recv() -> recv()\00"
define i32 @socket_receive(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i32 %3, i32* %9
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i32, i32* %9
%15 = call i32 @recv(i32 %11, i8* %12, i64 %13, i32 %14)
store i32 %15, i32* %10
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %4
%18 = call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %5
br label %21
19: ; preds = %4
%20 = load i32, i32* %10
store i32 %20, i32* %5
br label %21
21: ; preds = %19, %17
%22 = load i32, i32* %5
ret i32 %22
}

LLVM IR (-O2):
@.str = [24 x i8] c"socket_recv() -> recv()\00"
define i32 @socket_receive(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 %3)
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %4, %7
%10 = phi i32 [ -1, %7 ], [ %5, %4 ]
ret i32 %10
}