xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void banner() {
  printf("----------------------------------------------\n");
  printf("     --==[ GenerateHash v1.0 ]==--\n");
  printf(" written by rick2600 and Peter Van Eeckhoutte\n");
  printf("      http://www.corelan.be:8800\n");
  printf("----------------------------------------------\n");
}


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

x86 assembly (clang, -O2):
<banner>:
push   %rbx
lea    0xf5a(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xed9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
lea    0xf12(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"----------------------------------------------\0A\00"
@.str.1 = [36 x i8] c" --==[ GenerateHash v1.0 ]==--\0A\00"
@.str.2 = [47 x i8] c" written by rick2600 and Peter Van Eeckhoutte\0A\00"
@.str.3 = [34 x i8] c" http://www.corelan.be:8800\0A\00"
define void @banner() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.4 = [35 x i8] c" --==[ GenerateHash v1.0 ]==--\00"
@str.5 = [46 x i8] c" written by rick2600 and Peter Van Eeckhoutte\00"
@str.6 = [33 x i8] c" http://www.corelan.be:8800\00"
@str.7 = [47 x i8] c"----------------------------------------------\00"
define void @banner() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.7, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.6, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.7, i64 0, i64 0))
ret void
}
int test_imm_A6int32_mem(int *val) {
  return ((*val) & (0xA6 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_A6int32_mem>:
testb  $0xa6,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_A6int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 166
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int ugid2int(const unsigned int id) {
  if ((unsigned int)-1U == id)
    return -1;
  else
    return id;
}


x86 assembly (clang, -O0):
<ugid2int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    -0x8(%rbp),%eax
jne    1121 <ugid2int+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1127 <ugid2int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ugid2int(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 -1, %4
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* %3
store i32 %8, i32* %2
br label %9
9: ; preds = %7, %6
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @ugid2int(i32 %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void emit(char *name, int value) {
  printf("    static final int %s = %d;\n", name, value);
}


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

x86 assembly (clang, -O2):
<emit>:
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c" static final int %s = %d;\0A\00"
define void @emit(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c" static final int %s = %d;\0A\00"
define void @emit(i8* %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret void
}
/* Variables and functions */
long rotate_grid_index(long const, long **, long const *, long const *);
long grg_rotate_grid_index(const long grid_index, long rotation[3][3],
                           const long D_diag[3], const long PS[3]) {
  return rotate_grid_index(grid_index, rotation, D_diag, PS);
}


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

x86 assembly (clang, -O2):
<grg_rotate_grid_index>:
jmp    1030 <rotate_grid_index@plt>

LLVM IR (-O0):
define i64 @grg_rotate_grid_index(i64 %0, [3 x i64]* %1, i64* %2, i64* %3) {
%5 = alloca i64
%6 = alloca [3 x i64]*
%7 = alloca i64*
%8 = alloca i64*
store i64 %0, i64* %5
store [3 x i64]* %1, [3 x i64]** %6
store i64* %2, i64** %7
store i64* %3, i64** %8
%9 = load i64, i64* %5
%10 = load [3 x i64]*, [3 x i64]** %6
%11 = bitcast [3 x i64]* %10 to i64**
%12 = load i64*, i64** %7
%13 = load i64*, i64** %8
%14 = call i64 @rotate_grid_index(i64 %9, i64** %11, i64* %12, i64* %13)
ret i64 %14
}

LLVM IR (-O2):
define i64 @grg_rotate_grid_index(i64 %0, [3 x i64]* %1, i64* %2, i64* %3) {
%5 = bitcast [3 x i64]* %1 to i64**
%6 = tail call i64 @rotate_grid_index(i64 %0, i64** %5, i64* %2, i64* %3)
ret i64 %6
}
/* Type definitions */
struct comp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ BrzSequenceOptimised_reqdown(struct comp *, int);
void BrzSequence_reqdown(struct comp *comp, int port) {
  BrzSequenceOptimised_reqdown(comp, port);
}


x86 assembly (clang, -O0):
<BrzSequence_reqdown>:
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   1030 <BrzSequenceOptimised_reqdown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzSequence_reqdown>:
jmp    1030 <BrzSequenceOptimised_reqdown@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
define void @BrzSequence_reqdown(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%5 = load %struct.comp*, %struct.comp** %3
%6 = load i32, i32* %4
%7 = call i32 @BrzSequenceOptimised_reqdown(%struct.comp* %5, i32 %6)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
define void @BrzSequence_reqdown(%struct.comp* %0, i32 %1) {
%3 = tail call i32 @BrzSequenceOptimised_reqdown(%struct.comp* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Cvar_Set(char const *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void Cvar_SetIntegerValue(const char *var_name, int value) {
  char val[32];
  sprintf(val, "%i", value);
  Cvar_Set(var_name, val);
}


x86 assembly (clang, -O0):
<Cvar_SetIntegerValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <Cvar_Set@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cvar_SetIntegerValue>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
lea    0xecd(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Cvar_Set@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @Cvar_SetIntegerValue(i8* %0, i32 %1) {
%3 = alloca [32 x i8]
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @Cvar_Set(i8* %0, i8* %4)
ret void
}
int test_imm_B3uint8_reg(unsigned char val) {
  return ((val) & (-0xB3 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B3uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff4d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_B3uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 77
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
float log(float);
float expdev(int *idum) {
  float dum, ran1();
  do
    dum = ran1(idum);
  while (dum == 0.0);
  return -log(dum);
}


x86 assembly (clang, -O0):
<expdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <ran1@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    115d <expdev+0x3d>
jp     115d <expdev+0x3d>
jmp    112c <expdev+0xc>
movss  -0xc(%rbp),%xmm0
call   1040 <log@plt>
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdev>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <ran1@plt>
ucomiss 0xecf(%rip),%xmm0
jne    1145 <expdev+0x25>
jnp    1130 <expdev+0x10>
call   1040 <log@plt>
xorps  0xeaf(%rip),%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @expdev(i32* %0) {
%2 = alloca i32*
%3 = alloca float
store i32* %0, i32** %2
br label %4
4: ; preds = %7, %1
%5 = load i32*, i32** %2
%6 = call float (i32*, ...) bitcast (float (...)* @ran1 to float (i32*, ...)*)(i32* %5)
store float %6, float* %3
br label %7
7: ; preds = %4
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp oeq double %9, 0.000000e+00
br i1 %10, label %4, label %11
11: ; preds = %7
%12 = load float, float* %3
%13 = call float @log(float %12)
%14 = fneg float %13
ret float %14
}

LLVM IR (-O2):
define float @expdev(i32* %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call float (i32*, ...) bitcast (float (...)* @ran1 to float (i32*, ...)*)(i32* %0)
%4 = fcmp oeq float %3, 0.000000e+00
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call float @log(float %3)
%7 = fneg float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ pcre_compile2(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ pcre_exec(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ pcre_fullinfo(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/, int /*<<< orphan*/ *);
void stub(void) {
  pcre_compile2(NULL, 0, NULL, NULL, NULL, NULL);
  pcre_exec(NULL, NULL, NULL, 0, 0, 0, NULL, 0);
  pcre_fullinfo(NULL, NULL, 0, NULL);
}


x86 assembly (clang, -O0):
<stub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%r9d
xor    %esi,%esi
mov    %r9,%rdi
mov    %r9,%rdx
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <pcre_compile2@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %r9d,%r9d
mov    %rdx,%rdi
mov    %rdx,%rsi
mov    %r9d,%ecx
mov    %r9d,%r8d
movq   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1040 <pcre_exec@plt>
xor    %eax,%eax
mov    %eax,%ecx
xor    %edx,%edx
mov    %rcx,%rdi
mov    %rcx,%rsi
call   1050 <pcre_fullinfo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <pcre_compile2@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
call   1040 <pcre_exec@plt>
add    $0x10,%rsp
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rax
jmp    1050 <pcre_fullinfo@plt>

LLVM IR (-O0):
define void @stub() {
%1 = call i32 @pcre_compile2(i32* null, i32 0, i32* null, i32* null, i32* null, i32* null)
%2 = call i32 @pcre_exec(i32* null, i32* null, i32* null, i32 0, i32 0, i32 0, i32* null, i32 0)
%3 = call i32 @pcre_fullinfo(i32* null, i32* null, i32 0, i32* null)
ret void
}

LLVM IR (-O2):
define void @stub() {
%1 = tail call i32 @pcre_compile2(i32* null, i32 0, i32* null, i32* null, i32* null, i32* null)
%2 = tail call i32 @pcre_exec(i32* null, i32* null, i32* null, i32 0, i32 0, i32 0, i32* null, i32 0)
%3 = tail call i32 @pcre_fullinfo(i32* null, i32* null, i32 0, i32* null)
ret void
}
int hb_energy_init_dummy(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hb_energy_init_dummy() {
ret i32 0
}
/* Type definitions */
struct SocketBuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffWrite(int *, int, struct SocketBuffer *);
void writeInt(int value, struct SocketBuffer *buff) {
  buffWrite(&value, sizeof(int), buff);
}


x86 assembly (clang, -O0):
<writeInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x4(%rbp),%rdi
mov    $0x4,%esi
call   1030 <buffWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeInt>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <buffWrite@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.SocketBuffer = type { i32 }
define void @writeInt(i32 %0, %struct.SocketBuffer* %1) {
%3 = alloca i32
%4 = alloca %struct.SocketBuffer*
store i32 %0, i32* %3
store %struct.SocketBuffer* %1, %struct.SocketBuffer** %4
%5 = load %struct.SocketBuffer*, %struct.SocketBuffer** %4
%6 = call i32 @buffWrite(i32* %3, i32 4, %struct.SocketBuffer* %5)
ret void
}

LLVM IR (-O2):
%struct.SocketBuffer = type { i32 }
define void @writeInt(i32 %0, %struct.SocketBuffer* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @buffWrite(i32* %3, i32 4, %struct.SocketBuffer* %1)
ret void
}
/* Type definitions */
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void exitAction(void *stateData, struct event *event) {
  const char *stateName = (const char *)stateData;
  printf("Exiting %s\n", stateName);
}


x86 assembly (clang, -O0):
<exitAction>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.event = type { i32 }
@.str = [12 x i8] c"Exiting %s\0A\00"
define void @exitAction(i8* %0, %struct.event* %1) {
%3 = alloca i8*
%4 = alloca %struct.event*
%5 = alloca i8*
store i8* %0, i8** %3
store %struct.event* %1, %struct.event** %4
%6 = load i8*, i8** %3
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
%struct.event = type { i32 }
@.str = [12 x i8] c"Exiting %s\0A\00"
define void @exitAction(i8* %0, %struct.event* nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int example_func(void) { return 5678; }


x86 assembly (clang, -O0):
<example_func>:
push   %rbp
mov    %rsp,%rbp
mov    $0x162e,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @example_func() {
ret i32 5678
}

LLVM IR (-O2):
define i32 @example_func() {
ret i32 5678
}
int main_visibility_checkweak(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @main_visibility_checkweak() {
ret i32 1
}

LLVM IR (-O2):
define i32 @main_visibility_checkweak() {
ret i32 1
}
int fahrenheitToCelcius(int fahr) {
  int y =
      (int)(((float)(fahr - 32) * 100 / ((float)(212 - 32))) >= 0
                ? (long)(((float)(fahr - 32) * 100 / ((float)(212 - 32))) + 0.5)
                : (long)(((float)(fahr - 32) * 100 / ((float)(212 - 32))) -
                         0.5));
  return y;
}


x86 assembly (clang, -O0):
<fahrenheitToCelcius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2ss %eax,%xmm0
movss  0xeeb(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xedb(%rip),%xmm1
divss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     1175 <fahrenheitToCelcius+0x75>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2ss %eax,%xmm0
movss  0xebd(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xead(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
jmp    11b0 <fahrenheitToCelcius+0xb0>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2ss %eax,%xmm0
movss  0xe7d(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0xe6d(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe65(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fahrenheitToCelcius>:
add    $0xffffffe0,%edi
cvtsi2ss %edi,%xmm0
mulss  0xef1(%rip),%xmm0
divss  0xeed(%rip),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm1,%xmm0
setb   %al
cvtss2sd %xmm0,%xmm0
lea    0xedb(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @fahrenheitToCelcius(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 32
%6 = sitofp i32 %5 to float
%7 = fmul float %6, 1.000000e+02
%8 = fdiv float %7, 1.800000e+02
%9 = fcmp oge float %8, 0.000000e+00
br i1 %9, label %10, label %19
10: ; preds = %1
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 32
%13 = sitofp i32 %12 to float
%14 = fmul float %13, 1.000000e+02
%15 = fdiv float %14, 1.800000e+02
%16 = fpext float %15 to double
%17 = fadd double %16, 5.000000e-01
%18 = fptosi double %17 to i64
br label %28
19: ; preds = %1
%20 = load i32, i32* %2
%21 = sub nsw i32 %20, 32
%22 = sitofp i32 %21 to float
%23 = fmul float %22, 1.000000e+02
%24 = fdiv float %23, 1.800000e+02
%25 = fpext float %24 to double
%26 = fsub double %25, 5.000000e-01
%27 = fptosi double %26 to i64
br label %28
28: ; preds = %19, %10
%29 = phi i64 [ %18, %10 ], [ %27, %19 ]
%30 = trunc i64 %29 to i32
store i32 %30, i32* %3
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @fahrenheitToCelcius(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to float
%4 = fmul float %3, 1.000000e+02
%5 = fdiv float %4, 1.800000e+02
%6 = fcmp ult float %5, 0.000000e+00
%7 = fpext float %5 to double
%8 = select i1 %6, double -5.000000e-01, double 5.000000e-01
%9 = fadd double %8, %7
%10 = fptosi double %9 to i64
%11 = trunc i64 %10 to i32
ret i32 %11
}
int hash_plugin_hash_length(void) { return 20; }


x86 assembly (clang, -O0):
<hash_plugin_hash_length>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hash_plugin_hash_length() {
ret i32 20
}

LLVM IR (-O2):
define i32 @hash_plugin_hash_length() {
ret i32 20
}
/* Variables and functions */
int /*<<< orphan*/ ab_thread_exit(void *);
void ab_thread_entry(void *(*entry)(void *), void *arg) {
  ab_thread_exit(entry(arg));
}


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

x86 assembly (clang, -O2):
<ab_thread_entry>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
call   *%rax
mov    %rax,%rdi
pop    %rax
jmp    1030 <ab_thread_exit@plt>

LLVM IR (-O0):
define void @ab_thread_entry(i8* (i8*)* %0, i8* %1) {
%3 = alloca i8* (i8*)*
%4 = alloca i8*
store i8* (i8*)* %0, i8* (i8*)** %3
store i8* %1, i8** %4
%5 = load i8* (i8*)*, i8* (i8*)** %3
%6 = load i8*, i8** %4
%7 = call i8* %5(i8* %6)
%8 = call i32 @ab_thread_exit(i8* %7)
ret void
}

LLVM IR (-O2):
define void @ab_thread_entry(i8* (i8*)* nocapture %0, i8* %1) {
%3 = tail call i8* %0(i8* %1)
%4 = tail call i32 @ab_thread_exit(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ func(int, int /*<<< orphan*/ *, char *);
int main(int argc, char **argv) { func(10, NULL, "String"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xa,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    0xed1(%rip),%rdx
call   1030 <func@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"String\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @func(i32 10, i32* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"String\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @func(i32 10, i32* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void __attribute__((always_, format(printf, 2, 3)))
log_null(struct log_ctx *ctx, const char *format, ...) {}


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

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

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

LLVM IR (-O2):
%struct.log_ctx = type opaque
define void @log_null(%struct.log_ctx* nocapture %0, i8* nocapture %1, ...) {
ret void
}
/* Variables and functions */
char *mem_alloc(scalar_t__);
int /*<<< orphan*/ str_cpy(char *, char const *);
scalar_t__ str_len(char const *);
extern char *str_dup(const char *src) {
  char *res = mem_alloc(str_len(src) + 1);
  str_cpy(res, src);
  return res;
}


x86 assembly (clang, -O0):
<str_dup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <str_len@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1030 <mem_alloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <str_cpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_dup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1050 <str_len@plt>
lea    0x1(%rax),%rdi
call   1030 <mem_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <str_cpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @str_dup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @str_len(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @mem_alloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @str_cpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @str_dup(i8* %0) {
%2 = tail call i64 @str_len(i8* %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @mem_alloc(i64 %3)
%5 = tail call i32 @str_cpy(i8* %4, i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_Ofilm(int, int);
void RamAccFixMod_OFILM(unsigned char UcAccMod_OFILM) {
  switch (UcAccMod_OFILM) {
  case 0x00:
    RegWriteA_Ofilm(0x018C, 0x00);
    break;
  case 0x01:
    RegWriteA_Ofilm(0x018C, 0x31);
    break;
  }
}


x86 assembly (clang, -O0):
<RamAccFixMod_OFILM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1143 <RamAccFixMod_OFILM+0x33>
jmp    1132 <RamAccFixMod_OFILM+0x22>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1154 <RamAccFixMod_OFILM+0x44>
jmp    1163 <RamAccFixMod_OFILM+0x53>
mov    $0x18c,%edi
xor    %esi,%esi
call   1030 <RegWriteA_Ofilm@plt>
jmp    1163 <RamAccFixMod_OFILM+0x53>
mov    $0x18c,%edi
mov    $0x31,%esi
call   1030 <RegWriteA_Ofilm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RamAccFixMod_OFILM>:
test   %edi,%edi
je     1129 <RamAccFixMod_OFILM+0x19>
cmp    $0x1,%dil
jne    1135 <RamAccFixMod_OFILM+0x25>
mov    $0x31,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA_Ofilm@plt>
xor    %esi,%esi
mov    $0x18c,%edi
jmp    1030 <RegWriteA_Ofilm@plt>
ret

LLVM IR (-O0):
define void @RamAccFixMod_OFILM(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %7
]
5: ; preds = %1
%6 = call i32 @RegWriteA_Ofilm(i32 396, i32 0)
br label %9
7: ; preds = %1
%8 = call i32 @RegWriteA_Ofilm(i32 396, i32 49)
br label %9
9: ; preds = %1, %7, %5
ret void
}

LLVM IR (-O2):
define void @RamAccFixMod_OFILM(i8 zeroext %0) {
switch i8 %0, label %6 [
i8 0, label %3
i8 1, label %2
]
2: ; preds = %1
br label %3
3: ; preds = %1, %2
%4 = phi i32 [ 49, %2 ], [ 0, %1 ]
%5 = tail call i32 @RegWriteA_Ofilm(i32 396, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
float double_add_func(double *r1, double *r2) { return (*r1 + *r2); }


x86 assembly (clang, -O0):
<double_add_func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_add_func>:
movsd  (%rdi),%xmm0
addsd  (%rsi),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @double_add_func(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = fptrunc double %9 to float
ret float %10
}

LLVM IR (-O2):
define float @double_add_func(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fadd double %3, %4
%6 = fptrunc double %5 to float
ret float %6
}
void copia(void) {
  int i;
  extern char linea[], linea_max[];
  i = 0;
  while (*(linea + i) != '\0') {
    *(linea_max + i) = *(linea + i);
    i++;
  }
}


x86 assembly (clang, -O0):
<copia>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movslq -0x4(%rbp),%rcx
mov    0x2eda(%rip),%rax
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114d <copia+0x4d>
movslq -0x4(%rbp),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax,%rcx,1),%dl
movslq -0x4(%rbp),%rcx
mov    0x2e9c(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <copia+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<copia>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1130 <copia+0x30>
xor    %edx,%edx
mov    0x2ec2(%rip),%rsi
cs nopw 0x0(%rax,%rax,1)
mov    %cl,(%rsi,%rdx,1)
movzbl 0x1(%rax,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1120 <copia+0x20>
ret

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

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @copia() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0, %3
%4 = phi i64 [ %7, %3 ], [ 0, %0 ]
%5 = phi i8 [ %9, %3 ], [ %1, %0 ]
%6 = getelementptr inbounds [0 x i8], [0 x i8]* @linea_max, i64 0, i64 %4
store i8 %5, i8* %6
%7 = add nuw nsw i64 %4, 1
%8 = getelementptr inbounds [0 x i8], [0 x i8]* @linea, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %0
ret void
}
/* Variables and functions */
int add_opt_common(char **, char const *, int);
int fuse_opt_add_opt_escaped(char **opts, const char *opt) {
  return add_opt_common(opts, opt, 1);
}


x86 assembly (clang, -O0):
<fuse_opt_add_opt_escaped>:
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    $0x1,%edx
call   1030 <add_opt_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuse_opt_add_opt_escaped>:
mov    $0x1,%edx
jmp    1030 <add_opt_common@plt>

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

LLVM IR (-O2):
define i32 @fuse_opt_add_opt_escaped(i8** %0, i8* %1) {
%3 = tail call i32 @add_opt_common(i8** %0, i8* %1, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcome() { printf("Simple Calculator\n\n"); }


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Simple Calculator\0A\0A\00"
define void @welcome() {
%1 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [19 x i8] c"Simple Calculator\0A\00"
define void @welcome() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int time(int /*<<< orphan*/ *);
void on_press() { printf("button pressed, %d\n", time(NULL)); }


x86 assembly (clang, -O0):
<on_press>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<on_press>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"button pressed, %d\0A\00"
define void @on_press() {
%1 = call i32 @time(i32* null)
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"button pressed, %d\0A\00"
define void @on_press() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
verify_code() {}


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

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

LLVM IR (-O0):
define i32 @verify_code() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @verify_code() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int ytcpsocket_pull(int socketfd, char *data, int len) {
  int readlen = (int)read(socketfd, data, len);
  return readlen;
}


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

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

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

LLVM IR (-O2):
define i32 @ytcpsocket_pull(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i64 @read(i32 %0, i8* %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
void main() {
  int x;
  srand((unsigned)time(NULL));
  for (x = 0; x <= 100; x++)
    printf("%i\t", rand() % 10 + 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jg     1197 <main+0x57>
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1,%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115f <main+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x65,%ebp
lea    0xea3(%rip),%rbx
nopl   (%rax)
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebp
jne    1160 <main+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\09\00"
define void @main() {
%1 = alloca i32
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
%4 = call i32 @srand(i32 %3)
store i32 0, i32* %1
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %1
%7 = icmp sle i32 %6, 100
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = call i32 (...) @rand()
%10 = srem i32 %9, 10
%11 = add nsw i32 %10, 1
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %13
13: ; preds = %8
%14 = load i32, i32* %1
%15 = add nsw i32 %14, 1
store i32 %15, i32* %1
br label %5
16: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\09\00"
define void @main() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %10, %4 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 10
%8 = add nsw i32 %7, 1
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = add nuw nsw i32 %5, 1
%11 = icmp eq i32 %10, 101
br i1 %11, label %12, label %4
12: ; preds = %4
ret void
}
/* Variables and functions */
scalar_t__ cset82(unsigned char const *, int const, int /*<<< orphan*/, int,
                  int, int *, int *, char *);
int x1__90(const unsigned char *data, const int data_len, int *p_err_no,
           int *p_err_posn, char err_msg[50]) {
  return data_len >= 1 && data_len <= 90 &&
         cset82(data, data_len, 0, 1, 90, p_err_no, p_err_posn, err_msg);
}


x86 assembly (clang, -O0):
<x1__90>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jl     1181 <x1__90+0x71>
xor    %eax,%eax
cmpl   $0x5a,-0xc(%rbp)
mov    %al,-0x29(%rbp)
jg     1181 <x1__90+0x71>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%r9
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x5a,%r8d
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <cset82@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x1__90>:
mov    %rcx,%r10
lea    -0x1(%rsi),%ecx
xor    %eax,%eax
cmp    $0x59,%ecx
ja     114d <x1__90+0x3d>
push   %rax
mov    %r8,%r11
mov    %rdx,%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x5a,%r8d
push   %r11
push   %r10
call   1030 <cset82@plt>
add    $0x10,%rsp
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @x1__90(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i8* %4, i8** %10
%11 = load i32, i32* %7
%12 = icmp sge i32 %11, 1
br i1 %12, label %13, label %24
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp sle i32 %14, 90
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i32*, i32** %8
%20 = load i32*, i32** %9
%21 = load i8*, i8** %10
%22 = call i64 @cset82(i8* %17, i32 %18, i32 0, i32 1, i32 90, i32* %19, i32* %20, i8* %21)
%23 = icmp ne i64 %22, 0
br label %24
24: ; preds = %16, %13, %5
%25 = phi i1 [ false, %13 ], [ false, %5 ], [ %23, %16 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @x1__90(i8* %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = add i32 %1, -1
%7 = icmp ult i32 %6, 90
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = tail call i64 @cset82(i8* %0, i32 %1, i32 0, i32 1, i32 90, i32* %2, i32* %3, i8* %4)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ 0, %5 ], [ %11, %8 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ split_n_sort(int *, int);
char *test_split_n_sort_one_elements() {
  int a[] = {1};
  split_n_sort(a, 1);
  do {
    if (!(a[0] == 1))
      return "sorted[0] != 1";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_split_n_sort_one_elements>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x1,%esi
call   1030 <split_n_sort@plt>
cmpl   $0x1,-0xc(%rbp)
je     1149 <test_split_n_sort_one_elements+0x39>
lea    0xec4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <test_split_n_sort_one_elements+0x46>
jmp    114e <test_split_n_sort_one_elements+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_split_n_sort_one_elements>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
call   1030 <split_n_sort@plt>
xor    %eax,%eax
cmpl   $0x1,0x4(%rsp)
lea    0xeca(%rip),%rcx
cmovne %rcx,%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"sorted[0] != 1\00"
define i8* @test_split_n_sort_one_elements() {
%1 = alloca [1 x i32]
%2 = bitcast [1 x i32]* %1 to i8*
%3 = getelementptr inbounds [1 x i32], [1 x i32]* %1, i64 0, i64 0
store i32 1, i32* %3
%4 = call i32 @split_n_sort(i32* %3, i32 1)
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* null, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
ret i8* %7
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long serial;
};
typedef TYPE_1__ XKeymapEvent;

/* Variables and functions */
void set_XKeymapEvent_serial(void *_p, unsigned long _v) {
  ((XKeymapEvent *)_p)->serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XKeymapEvent_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XKeymapEvent_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
struct _vtable {
  int dummy;
};

/* Variables and functions */
scalar_t__ calloc(int, int);
void *alloc(size_t size) {
  struct _vtable **ppvt =
      (struct _vtable **)calloc(1, sizeof(struct _vtable *) + size);
  return (void *)(ppvt + 1);
}


x86 assembly (clang, -O0):
<alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %eax,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc>:
push   %rax
lea    0x8(%rdi),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
add    $0x8,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct._vtable = type { i32 }
define i8* @alloc(i64 %0) {
%2 = alloca i64
%3 = alloca %struct._vtable**
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = add i64 8, %4
%6 = trunc i64 %5 to i32
%7 = call i64 @calloc(i32 1, i32 %6)
%8 = inttoptr i64 %7 to %struct._vtable**
store %struct._vtable** %8, %struct._vtable*** %3
%9 = load %struct._vtable**, %struct._vtable*** %3
%10 = getelementptr inbounds %struct._vtable*, %struct._vtable** %9, i64 1
%11 = bitcast %struct._vtable** %10 to i8*
ret i8* %11
}

LLVM IR (-O2):
%struct._vtable = type { i32 }
define i8* @alloc(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = add i32 %2, 8
%4 = tail call i64 @calloc(i32 1, i32 %3)
%5 = inttoptr i64 %4 to %struct._vtable**
%6 = getelementptr inbounds %struct._vtable*, %struct._vtable** %5, i64 1
%7 = bitcast %struct._vtable** %6 to i8*
ret i8* %7
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int ENOSYS;
int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t *attr,
                                     int *prioceiling) {
  return (ENOSYS);
}


x86 assembly (clang, -O0):
<pthread_mutexattr_getprioceiling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutexattr_getprioceiling>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

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

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_mutexattr_getprioceiling(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
ret i32 %3
}