xunge/DecIR huggingface dataset:
/* Type definitions */
struct rosprite_file_context {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct rosprite_file_context *);
void rosprite_destroy_file_context(struct rosprite_file_context *ctx) {
  free(ctx);
}


x86 assembly (clang, -O0):
<rosprite_destroy_file_context>:
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):
<rosprite_destroy_file_context>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.rosprite_file_context = type { i32 }
define void @rosprite_destroy_file_context(%struct.rosprite_file_context* %0) {
%2 = alloca %struct.rosprite_file_context*
store %struct.rosprite_file_context* %0, %struct.rosprite_file_context** %2
%3 = load %struct.rosprite_file_context*, %struct.rosprite_file_context** %2
%4 = call i32 @free(%struct.rosprite_file_context* %3)
ret void
}

LLVM IR (-O2):
%struct.rosprite_file_context = type { i32 }
define void @rosprite_destroy_file_context(%struct.rosprite_file_context* nocapture %0) {
%2 = tail call i32 @free(%struct.rosprite_file_context* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_report(char *, int, int);
int /*<<< orphan*/ erl_init(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ erl_mk_pid(char *, int, int, int);
int /*<<< orphan*/ send_term(int /*<<< orphan*/);
void t_erl_mk_pid(void) {
  erl_init(NULL, 0);
  send_term(erl_mk_pid("kalle@localhost", 3, 2, 1));
  do_report("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/"
            "erl_interface/test/erl_eterm_SUITE_data/eterm_test.c",
            511, 1);
}


x86 assembly (clang, -O0):
<t_erl_mk_pid>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaa(%rip),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1050 <erl_mk_pid@plt>
mov    %eax,%edi
call   1040 <send_term@plt>
lea    0xe98(%rip),%rdi
mov    $0x1ff,%esi
mov    $0x1,%edx
call   1030 <do_report@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_erl_mk_pid>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   1060 <erl_init@plt>
lea    0xeaf(%rip),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
call   1050 <erl_mk_pid@plt>
mov    %eax,%edi
call   1040 <send_term@plt>
lea    0xe9d(%rip),%rdi
mov    $0x1ff,%esi
mov    $0x1,%edx
pop    %rax
jmp    1030 <do_report@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_pid() {
%1 = call i32 @erl_init(i32* null, i32 0)
%2 = call i32 @erl_mk_pid(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 2, i32 1)
%3 = call i32 @send_term(i32 %2)
%4 = call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 511, i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"kalle@localhost\00"
@.str.1 = [182 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RaimoNiskanen/otp/refs/heads/basho/lib/erl_interface/test/erl_eterm_SUITE_data/eterm_test.c\00"
define void @t_erl_mk_pid() {
%1 = tail call i32 @erl_init(i32* null, i32 0)
%2 = tail call i32 @erl_mk_pid(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 3, i32 2, i32 1)
%3 = tail call i32 @send_term(i32 %2)
%4 = tail call i32 @do_report(i8* getelementptr inbounds ([182 x i8], [182 x i8]* @.str.1, i64 0, i64 0), i32 511, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, float *);
float inputfloat(char *c) {
  float num;
  printf("Inserisci %s\n", c);
  scanf("%f", &num);
  return num;
}


x86 assembly (clang, -O0):
<inputfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputfloat>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"Inserisci %s\0A\00"
@.str.1 = [3 x i8] c"%f\00"
define float @inputfloat(i8* %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%6 = load float, float* %2
ret float %6
}
void sec_log_buf_update(void) {}


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

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

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

LLVM IR (-O2):
define void @sec_log_buf_update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send_speaker();
void inqSpeaker() { send_speaker(); }


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

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

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

LLVM IR (-O2):
define void @inqSpeaker() {
%1 = tail call i32 (...) @send_speaker()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_byte(int);
void push_r64(uint8_t reg) {
  if (reg > 7)
    write_byte(0x40 | 0x01);
  write_byte(0x50 | (reg & 7));
}


x86 assembly (clang, -O0):
<push_r64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x7,-0x4(%rbp)
jle    112f <push_r64+0x1f>
mov    $0x41,%edi
call   1030 <write_byte@plt>
mov    -0x4(%rbp),%edi
and    $0x7,%edi
or     $0x50,%edi
call   1030 <write_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<push_r64>:
push   %rbx
mov    %edi,%ebx
cmp    $0x8,%edi
jl     1122 <push_r64+0x12>
mov    $0x41,%edi
call   1030 <write_byte@plt>
and    $0x7,%ebx
or     $0x50,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <write_byte@plt>

LLVM IR (-O0):
define void @push_r64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 7
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @write_byte(i32 65)
br label %7
7: ; preds = %5, %1
%8 = load i32, i32* %2
%9 = and i32 %8, 7
%10 = or i32 80, %9
%11 = call i32 @write_byte(i32 %10)
ret void
}

LLVM IR (-O2):
define void @push_r64(i32 %0) {
%2 = icmp sgt i32 %0, 7
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @write_byte(i32 65)
br label %5
5: ; preds = %3, %1
%6 = and i32 %0, 7
%7 = or i32 %6, 80
%8 = tail call i32 @write_byte(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ trap_R_RegisterShaderNoMip(char *);
void UI_SetupMenu_Cache(void) {
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_0");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/back_1");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame2_l");
  trap_R_RegisterShaderNoMip("menu/"
                             "art_blueish"
                             "/frame1_r");
}


x86 assembly (clang, -O0):
<UI_SetupMenu_Cache>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef1(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xefd(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0b(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_SetupMenu_Cache>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xef4(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf00(%rip),%rdi
call   1030 <trap_R_RegisterShaderNoMip@plt>
lea    0xf0e(%rip),%rdi
pop    %rax
jmp    1030 <trap_R_RegisterShaderNoMip@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.1 = [24 x i8] c"menu/art_blueish/back_1\00"
@.str.2 = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.3 = [26 x i8] c"menu/art_blueish/frame1_r\00"
define void @UI_SetupMenu_Cache() {
%1 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"menu/art_blueish/back_0\00"
@.str.1 = [24 x i8] c"menu/art_blueish/back_1\00"
@.str.2 = [26 x i8] c"menu/art_blueish/frame2_l\00"
@.str.3 = [26 x i8] c"menu/art_blueish/frame1_r\00"
define void @UI_SetupMenu_Cache() {
%1 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @trap_R_RegisterShaderNoMip(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int mmio_read(char *, int);
int /*<<< orphan*/ printf(char *);
uint64_t query_i2c_ready(char resource_file[]) {
  uint64_t offset = 0x0000000000000130;
  int rv;
  uint64_t read_data;
  read_data = mmio_read(resource_file, offset);
  if ((read_data & 0x8000000000000000) == 0x8000000000000000) {
    printf("I2C controller is ready\n");
    return 0;
  } else
    return 1;
}


x86 assembly (clang, -O0):
<query_i2c_ready>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x130,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <mmio_read@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
movabs $0x8000000000000000,%rcx
cmp    %rcx,%rax
jne    117e <query_i2c_ready+0x5e>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1185 <query_i2c_ready+0x65>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<query_i2c_ready>:
push   %rax
mov    $0x130,%esi
call   1040 <mmio_read@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
js     1138 <query_i2c_ready+0x18>
pop    %rcx
ret
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"I2C controller is ready\0A\00"
define i32 @query_i2c_ready(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i32 304, i32* %4
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @mmio_read(i8* %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = sext i32 %10 to i64
%12 = and i64 %11, -9223372036854775808
%13 = icmp eq i64 %12, -9223372036854775808
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %17
16: ; preds = %1
store i32 1, i32* %2
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@str = [24 x i8] c"I2C controller is ready\00"
define i32 @query_i2c_ready(i8* %0) {
%2 = tail call i32 @mmio_read(i8* %0, i32 304)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ 1, %1 ]
ret i32 %7
}
void transpose2(double out[2][2][2], const double in[2][2][2]) {}


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

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

LLVM IR (-O0):
define void @transpose2([2 x [2 x double]]* %0, [2 x [2 x double]]* %1) {
%3 = alloca [2 x [2 x double]]*
%4 = alloca [2 x [2 x double]]*
store [2 x [2 x double]]* %0, [2 x [2 x double]]** %3
store [2 x [2 x double]]* %1, [2 x [2 x double]]** %4
ret void
}

LLVM IR (-O2):
define void @transpose2([2 x [2 x double]]* nocapture %0, [2 x [2 x double]]* nocapture %1) {
ret void
}
void gtk_widget_unref() {}


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

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

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

LLVM IR (-O2):
define void @gtk_widget_unref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int /*<<< orphan*/ sieve(int);
int main(void) {
  printf("n = ");
  int n;
  if (scanf(" %d", &n) != 1) {
    printf("Bad input!\n");
    return 1;
  }
  sieve(n);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     117c <main+0x4c>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1184 <main+0x54>
mov    -0x8(%rbp),%edi
call   1040 <sieve@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    1170 <main+0x30>
mov    0x4(%rsp),%edi
call   1050 <sieve@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"n = \00"
@.str.1 = [4 x i8] c" %d\00"
@.str.2 = [12 x i8] c"Bad input!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = icmp ne i32 %4, 1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %11
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @sieve(i32 %9)
br label %11
11: ; preds = %8, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@.str = [5 x i8] c"n = \00"
@.str.1 = [4 x i8] c" %d\00"
@str = [11 x i8] c"Bad input!\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = bitcast i32* %1 to i8*
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i32 %4, 1
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %11
8: ; preds = %0
%9 = load i32, i32* %1
%10 = call i32 @sieve(i32 %9)
br label %11
11: ; preds = %8, %6
%12 = phi i32 [ 1, %6 ], [ 0, %8 ]
ret i32 %12
}
void unw_get_fpreg() {}


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

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

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

LLVM IR (-O2):
define void @unw_get_fpreg() {
ret void
}
void __asan_report_store8() {}


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

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

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

LLVM IR (-O2):
define void @__asan_report_store8() {
ret void
}
float test() { return 2.0f; }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @test() {
ret float 2.000000e+00
}

LLVM IR (-O2):
define float @test() {
ret float 2.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int open(char const *, int);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ printf(char *, int);
int ps_test_open(const char *name, int oflag, ...) {
  int dskr;
  dskr = open(name, oflag);
  if (dskr == -1) {
    perror(name);
    exit(1);
  }
  if (0 == 0)
    printf("dskr = %d\n", dskr);
  return dskr;
}


x86 assembly (clang, -O0):
<ps_test_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    117b <ps_test_open+0x3b>
mov    -0x8(%rbp),%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ps_test_open>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <open@plt>
cmp    $0xffffffff,%eax
je     1169 <ps_test_open+0x29>
mov    %eax,%ebp
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
call   1050 <perror@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"dskr = %d\0A\00"
define i32 @ps_test_open(i8* %0, i32 %1, ...) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = call i32 @perror(i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i32, i32* %5
%17 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %5
ret i32 %18
}

LLVM IR (-O2):
@.str = [11 x i8] c"dskr = %d\0A\00"
define i32 @ps_test_open(i8* nocapture %0, i32 %1, ...) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @perror(i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %3
}
void literal_string_Good() {
  int a[1];
  char *s = "hello";
  for (int i = 0; i < 5; i++) {
    if (s[i] > 'o') {
      a[s[i]] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<literal_string_Good>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    115d <literal_string_Good+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x6f,%eax
jle    114a <literal_string_Good+0x4a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
movl   $0x0,-0x4(%rbp,%rax,4)
jmp    114f <literal_string_Good+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1116 <literal_string_Good+0x16>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define void @literal_string_Good() {
%1 = alloca [1 x i32]
%2 = alloca i8*
%3 = alloca i32
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %24, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 5
br i1 %6, label %7, label %27
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sgt i32 %13, 111
br i1 %14, label %15, label %23
15: ; preds = %7
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i64
%22 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 %21
store i32 0, i32* %22
br label %23
23: ; preds = %15, %7
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
br label %4
27: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @literal_string_Good() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_SubtractQuaternion_init(void) {
  _hmt_register_covercase("HMM_SubtractQuaternion", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_SubtractQuaternion_init>:
lea    0xee9(%rip),%rdi
lea    0xef9(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"HMM_SubtractQuaternion\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_SubtractQuaternion_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"HMM_SubtractQuaternion\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_SubtractQuaternion_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGTRAP;
int /*<<< orphan*/ raise(int /*<<< orphan*/);
void bprobe_break_point(void) { raise(SIGTRAP); }


x86 assembly (clang, -O0):
<bprobe_break_point>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bprobe_break_point>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <raise@plt>

LLVM IR (-O0):
@SIGTRAP = global i32 0
define void @bprobe_break_point() {
%1 = load i32, i32* @SIGTRAP
%2 = call i32 @raise(i32 %1)
ret void
}

LLVM IR (-O2):
@SIGTRAP = global i32 0
define void @bprobe_break_point() {
%1 = load i32, i32* @SIGTRAP
%2 = tail call i32 @raise(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ *fdopen(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ puts(char *);
int main(int argc, char *argv[]) {
  FILE *stdout = fdopen(STDOUT_FILENO, "w");
  puts("Hello world.");
  fputc(36, stdout);
  putchar(37);
  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    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xe9a(%rip),%rsi
call   1060 <fdopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
mov    -0x18(%rbp),%rsi
mov    $0x24,%edi
call   1050 <fputc@plt>
mov    $0x25,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1060 <fdopen@plt>
mov    %rax,%rbx
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
mov    $0x24,%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
mov    $0x25,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"w\00"
@.str.1 = [13 x i8] c"Hello world.\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 = load i32, i32* @STDOUT_FILENO
%8 = call i32* @fdopen(i32 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %8, i32** %6
%9 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32*, i32** %6
%11 = call i32 @fputc(i32 36, i32* %10)
%12 = call i32 @putchar(i32 37)
ret i32 0
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
@.str = [2 x i8] c"w\00"
@.str.1 = [13 x i8] c"Hello world.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @STDOUT_FILENO
%4 = tail call i32* @fdopen(i32 %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @fputc(i32 36, i32* %4)
%7 = tail call i32 @putchar(i32 37)
ret i32 0
}
int function_2(int x, int y) { return x - y; }


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

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

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

LLVM IR (-O2):
define i32 @function_2(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
scalar_t__ sqrt(float);
float n_sqrt(float x) {
  if (x < 0.0f)
    x = (float)0.0f;
  return (float)sqrt(x);
}


x86 assembly (clang, -O0):
<n_sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1132 <n_sqrt+0x22>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
cvtsi2ss %rax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<n_sqrt>:
push   %rax
xorps  %xmm1,%xmm1
maxss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @n_sqrt(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
store float 0.000000e+00, float* %2
br label %6
6: ; preds = %5, %1
%7 = load float, float* %2
%8 = call i64 @sqrt(float %7)
%9 = sitofp i64 %8 to float
ret float %9
}

LLVM IR (-O2):
define float @n_sqrt(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float 0.000000e+00, float %0
%4 = tail call i64 @sqrt(float %3)
%5 = sitofp i64 %4 to float
ret float %5
}
/* Type definitions */
typedef int /*<<< orphan*/ PKCS7_SIGN_ENVELOPE;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ PKCS7_SIGN_ENVELOPE_it;
int i2d_PKCS7_SIGN_ENVELOPE(PKCS7_SIGN_ENVELOPE *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &PKCS7_SIGN_ENVELOPE_it);
}


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

x86 assembly (clang, -O2):
<i2d_PKCS7_SIGN_ENVELOPE>:
mov    0x2ed1(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@PKCS7_SIGN_ENVELOPE_it = global i32 0
define i32 @i2d_PKCS7_SIGN_ENVELOPE(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @PKCS7_SIGN_ENVELOPE_it)
ret i32 %7
}

LLVM IR (-O2):
@PKCS7_SIGN_ENVELOPE_it = global i32 0
define i32 @i2d_PKCS7_SIGN_ENVELOPE(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @PKCS7_SIGN_ENVELOPE_it)
ret i32 %3
}
void foo437(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo437(i32 %0) {
ret void
}
/* Type definitions */
struct nlmsghdr {
  int dummy;
};

/* Variables and functions */
void *NLMSG_DATA(struct nlmsghdr *);
void *nlmsg_data(struct nlmsghdr *p) { return NLMSG_DATA(p); }


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

x86 assembly (clang, -O2):
<nlmsg_data>:
jmp    1030 <NLMSG_DATA@plt>

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define i8* @nlmsg_data(%struct.nlmsghdr* %0) {
%2 = alloca %struct.nlmsghdr*
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %2
%3 = load %struct.nlmsghdr*, %struct.nlmsghdr** %2
%4 = call i8* @NLMSG_DATA(%struct.nlmsghdr* %3)
ret i8* %4
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define i8* @nlmsg_data(%struct.nlmsghdr* %0) {
%2 = tail call i8* @NLMSG_DATA(%struct.nlmsghdr* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _FlushBuffer();
void LCD_X_FlushBuffer(void) { _FlushBuffer(); }


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

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

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

LLVM IR (-O2):
define void @LCD_X_FlushBuffer() {
%1 = tail call i32 (...) @_FlushBuffer()
ret void
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void AESAuthLengthSet(uint32_t ui32Base, uint32_t ui32Length) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000005C))) = ui32Length;
}


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

x86 assembly (clang, -O2):
<AESAuthLengthSet>:
mov    %rsi,0x5c(%rdi)
ret

LLVM IR (-O0):
define void @AESAuthLengthSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 92
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @AESAuthLengthSet(i64 %0, i64 %1) {
%3 = add i64 %0, 92
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int getDecimalInteger();
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int val;
  val = getDecimalInteger();
  printf("val = %d\n", val);
}


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"val = %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getDecimalInteger()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_vfs;

/* Variables and functions */
void (*wrap_DlSym(sqlite3_vfs *pVfs, void *pH, const char *z))(void) {
  return 0;
}


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

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

LLVM IR (-O0):
define void ()* @wrap_DlSym(i32* %0, i8* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
ret void ()* null
}

LLVM IR (-O2):
define noalias void ()* @wrap_DlSym(i32* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret void ()* null
}
unsigned char font_reverse_c(unsigned char ic) {
  unsigned char oc = 0;
  int bitc = 8;
  while (bitc--) {
    oc <<= 1;
    unsigned char bit = ic & 1;
    if (bit)
      oc |= 1;
    ic >>= 1;
  }
  return oc;
}


x86 assembly (clang, -O0):
<font_reverse_c>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movl   $0x8,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1160 <font_reverse_c+0x60>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
mov    %al,-0x9(%rbp)
cmpb   $0x0,-0x9(%rbp)
je     1151 <font_reverse_c+0x51>
movzbl -0x2(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    1115 <font_reverse_c+0x15>
movzbl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<font_reverse_c>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @font_reverse_c(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
store i32 8, i32* %4
br label %6
6: ; preds = %26, %1
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %31
10: ; preds = %6
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = and i32 %16, 1
%18 = trunc i32 %17 to i8
store i8 %18, i8* %5
%19 = load i8, i8* %5
%20 = icmp ne i8 %19, 0
br i1 %20, label %21, label %26
21: ; preds = %10
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = or i32 %23, 1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %3
br label %26
26: ; preds = %21, %10
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = ashr i32 %28, 1
%30 = trunc i32 %29 to i8
store i8 %30, i8* %2
br label %6
31: ; preds = %6
%32 = load i8, i8* %3
ret i8 %32
}

LLVM IR (-O2):
define zeroext i8 @font_reverse_c(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
/* Variables and functions */
int zmDebugReinitialise(char const *);
int zmDbgReinit(const char *target) { return (zmDebugReinitialise(target)); }


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

x86 assembly (clang, -O2):
<zmDbgReinit>:
jmp    1030 <zmDebugReinitialise@plt>

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

LLVM IR (-O2):
define i32 @zmDbgReinit(i8* %0) {
%2 = tail call i32 @zmDebugReinitialise(i8* %0)
ret i32 %2
}
/* Variables and functions */
void *CRYPTO_zalloc(size_t, char const *, int);
void *CRYPTO_secure_zalloc(size_t num, const char *file, int line) {
  return CRYPTO_zalloc(num, file, line);
}


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

x86 assembly (clang, -O2):
<CRYPTO_secure_zalloc>:
jmp    1030 <CRYPTO_zalloc@plt>

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

LLVM IR (-O2):
define i8* @CRYPTO_secure_zalloc(i64 %0, i8* %1, i32 %2) {
%4 = tail call i8* @CRYPTO_zalloc(i64 %0, i8* %1, i32 %2)
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void uninitvar_putc(void) {
  int c;
  FILE *stream;
  (void)putc(c, stream);
}


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

x86 assembly (clang, -O2):
<uninitvar_putc>:
jmp    1030 <putc@plt>

LLVM IR (-O0):
define void @uninitvar_putc() {
%1 = alloca i32
%2 = alloca i32*
%3 = load i32, i32* %1
%4 = load i32*, i32** %2
%5 = call i32 @putc(i32 %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_putc() {
%1 = tail call i32 @putc(i32 undef, i32* undef)
ret void
}
/* Type definitions */
struct stack_st_OPENSSL_CSTRING {
  int dummy;
};
typedef int /*<<< orphan*/ OPENSSL_STACK;

/* Variables and functions */
int OPENSSL_sk_num(int /*<<< orphan*/ const *);
int sk_OPENSSL_CSTRING_num(const struct stack_st_OPENSSL_CSTRING *sk) {
  return OPENSSL_sk_num((const OPENSSL_STACK *)sk);
}


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

x86 assembly (clang, -O2):
<sk_OPENSSL_CSTRING_num>:
jmp    1030 <OPENSSL_sk_num@plt>

LLVM IR (-O0):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_num(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = alloca %struct.stack_st_OPENSSL_CSTRING*
store %struct.stack_st_OPENSSL_CSTRING* %0, %struct.stack_st_OPENSSL_CSTRING** %2
%3 = load %struct.stack_st_OPENSSL_CSTRING*, %struct.stack_st_OPENSSL_CSTRING** %2
%4 = bitcast %struct.stack_st_OPENSSL_CSTRING* %3 to i32*
%5 = call i32 @OPENSSL_sk_num(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.stack_st_OPENSSL_CSTRING = type { i32 }
define i32 @sk_OPENSSL_CSTRING_num(%struct.stack_st_OPENSSL_CSTRING* %0) {
%2 = getelementptr %struct.stack_st_OPENSSL_CSTRING, %struct.stack_st_OPENSSL_CSTRING* %0, i64 0, i32 0
%3 = tail call i32 @OPENSSL_sk_num(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
main() {
  char f;
  printf("H\r\n");
  scanf("%c", &f);
  printf("Hello World  ---> %c  \r\n", f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"H\0D\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [25 x i8] c"Hello World ---> %c \0D\0A\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [25 x i8] c"Hello World ---> %c \0D\0A\00"
@str = [3 x i8] c"H\0D\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
scalar_t__ Getline(char *, int);
int /*<<< orphan*/ Reverse(char *);
int /*<<< orphan*/ printf(char *, char *);
main() {
  char s[1000];
  while (Getline(s, 1000) > 0) {
    Reverse(s);
    printf("%s\n", s);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <Getline@plt>
cmp    $0x0,%rax
jle    1181 <main+0x51>
lea    -0x3f0(%rbp),%rdi
call   1050 <Reverse@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe89(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <Getline@plt>
test   %rax,%rax
jle    1185 <main+0x55>
mov    %rsp,%rbx
lea    0xeaa(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <Reverse@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <Getline@plt>
test   %rax,%rax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %7, %0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = call i64 @Getline(i8* %4, i32 1000)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %3
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = call i32 @Reverse(i8* %8)
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @Getline(i8* %2, i32 1000)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %0, %5
%6 = call i32 @Reverse(i8* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = call i64 @Getline(i8* %2, i32 1000)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello YOURNAME, My name is MYNAME\n");
  printf("Hello %s, My name is %s\n", "Dork", "Joseph");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
lea    0xede(%rip),%rsi
lea    0xedc(%rip),%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Hello YOURNAME, My name is MYNAME\0A\00"
@.str.1 = [25 x i8] c"Hello %s, My name is %s\0A\00"
@.str.2 = [5 x i8] c"Dork\00"
@.str.3 = [7 x i8] c"Joseph\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 ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Hello %s, My name is %s\0A\00"
@.str.2 = [5 x i8] c"Dork\00"
@.str.3 = [7 x i8] c"Joseph\00"
@str = [34 x i8] c"Hello YOURNAME, My name is MYNAME\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 ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void Default_PWM2_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

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