xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  scalar_t__ st_mtime;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char const *, struct stat *);
int zompFileModificationTimestamp(const char *filename) {
  struct stat s;
  stat(filename, &s);
  return (int)s.st_mtime;
}


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

x86 assembly (clang, -O2):
<zompFileModificationTimestamp>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @zompFileModificationTimestamp(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @zompFileModificationTimestamp(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void call2() {
  float a, r;
  printf("enter the radius\n");
  scanf("%f", &r);
  a = 3.142 * r * r;
  printf("the area is %f\n", a);
}


x86 assembly (clang, -O0):
<call2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call2>:
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xec4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea0(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe91(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [18 x i8] c"enter the radius\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"the area is %f\0A\00"
define void @call2() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = fmul double 3.142000e+00, %6
%8 = load float, float* %2
%9 = fpext float %8 to double
%10 = fmul double %7, %9
%11 = fptrunc double %10 to float
store float %11, float* %1
%12 = load float, float* %1
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %13)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [16 x i8] c"the area is %f\0A\00"
@str = [17 x i8] c"enter the radius\00"
define void @call2() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 3.142000e+00
%8 = fmul double %7, %6
%9 = fptrunc double %8 to float
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %10)
ret void
}
int is_dead(char ch) { return ch == 'x'; }


x86 assembly (clang, -O0):
<is_dead>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x78,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_dead>:
xor    %eax,%eax
cmp    $0x78,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_dead(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 120
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_dead(i8 signext %0) {
%2 = icmp eq i8 %0, 120
%3 = zext i1 %2 to i32
ret i32 %3
}
void curl_memdebug(void) {}


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

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

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

LLVM IR (-O2):
define void @curl_memdebug() {
ret void
}
int cairo_code_draw_pwrcutLabel_get_width() { return 280; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_pwrcutLabel_get_width() {
ret i32 280
}

LLVM IR (-O2):
define i32 @cairo_code_draw_pwrcutLabel_get_width() {
ret i32 280
}
int test_imm_5Cint16_mem(short *val) {
  return ((*val) & (0x5C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Cint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 92
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void *Athena_Private_CreateHandle() { return 1; }


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

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

LLVM IR (-O0):
define i8* @Athena_Private_CreateHandle() {
ret i8* inttoptr (i64 1 to i8*)
}

LLVM IR (-O2):
define i8* @Athena_Private_CreateHandle() {
ret i8* inttoptr (i64 1 to i8*)
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *, int /*<<< orphan*/);
int solve_by_dobldobl_homotopy_continuation(int number_of_tasks) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(236, &number_of_tasks, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solve_by_dobldobl_homotopy_continuation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0xec,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve_by_dobldobl_homotopy_continuation>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xec,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @solve_by_dobldobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %3
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc(i32 236, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %4
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
define i32 @solve_by_dobldobl_homotopy_continuation(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 236, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
int fci_hpi_init(void *handle, int speed, int slaveaddr) { return 0; }


x86 assembly (clang, -O0):
<fci_hpi_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fci_hpi_init(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ F(char *);
int /*<<< orphan*/ print_P(int /*<<< orphan*/);
void print_text_close() { print_P(F("</text>\n")); }


x86 assembly (clang, -O0):
<print_text_close>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <F@plt>
mov    %eax,%edi
call   1040 <print_P@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_text_close>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <F@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <print_P@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"</text>\0A\00"
define void @print_text_close() {
%1 = call i32 @F(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @print_P(i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"</text>\0A\00"
define void @print_text_close() {
%1 = tail call i32 @F(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @print_P(i32 %1)
ret void
}
int bit_index(int x, int y, int width) { return (y * width + x) % 32; }


x86 assembly (clang, -O0):
<bit_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_index>:
imul   %edx,%esi
lea    (%rsi,%rdi,1),%ecx
add    $0x1f,%ecx
mov    %esi,%eax
add    %edi,%eax
cmovns %eax,%ecx
and    $0xffffffe0,%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @bit_index(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %4
%11 = add nsw i32 %9, %10
%12 = srem i32 %11, 32
ret i32 %12
}

LLVM IR (-O2):
define i32 @bit_index(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = add nsw i32 %4, %0
%6 = srem i32 %5, 32
ret i32 %6
}
/* Variables and functions */
double trunc(double);
double module_libc_trunc(double x) { return trunc(x); }


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

x86 assembly (clang, -O2):
<module_libc_trunc>:
jmp    1030 <trunc@plt>

LLVM IR (-O0):
define double @module_libc_trunc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.trunc.f64(double %3)
ret double %4
}

LLVM IR (-O2):
define double @module_libc_trunc(double %0) {
%2 = tail call double @llvm.trunc.f64(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ SCB_I2CStop();
void SCB_ScbModeStop(void) { SCB_I2CStop(); }


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

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

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

LLVM IR (-O2):
define void @SCB_ScbModeStop() {
%1 = tail call i32 (...) @SCB_I2CStop()
ret void
}
/* Variables and functions */
int mkdir(char const *, int);
int my_mkdir(const char *path) { return mkdir(path, 0777); }


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

x86 assembly (clang, -O2):
<my_mkdir>:
mov    $0x1ff,%esi
jmp    1030 <mkdir@plt>

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

LLVM IR (-O2):
define i32 @my_mkdir(i8* nocapture %0) {
%2 = tail call i32 @mkdir(i8* %0, i32 511)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ raise(int /*<<< orphan*/);
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void sigint(int sig) {
  fprintf(stderr, "W:\t%s\n", "trapped INT and kill itself again");
  signal(SIGINT, SIG_DFL);
  raise(SIGINT);
}


x86 assembly (clang, -O0):
<sigint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
lea    0xeb5(%rip),%rdx
call   1050 <fprintf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1030 <raise@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigint>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1050 <fprintf@plt>
mov    0x2e94(%rip),%rbx
mov    (%rbx),%edi
mov    0x2e73(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <raise@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"W:\09%s\0A\00"
@.str.1 = [34 x i8] c"trapped INT and kill itself again\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @sigint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @SIGINT
%6 = load i32, i32* @SIG_DFL
%7 = call i32 @signal(i32 %5, i32 %6)
%8 = load i32, i32* @SIGINT
%9 = call i32 @raise(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"W:\09%s\0A\00"
@.str.1 = [34 x i8] c"trapped INT and kill itself again\00"
@SIGINT = global i32 0
@SIG_DFL = global i32 0
define void @sigint(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @SIGINT
%5 = load i32, i32* @SIG_DFL
%6 = tail call i32 @signal(i32 %4, i32 %5)
%7 = load i32, i32* @SIGINT
%8 = tail call i32 @raise(i32 %7)
ret void
}
int do_238() { return 238; }


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

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

LLVM IR (-O0):
define i32 @do_238() {
ret i32 238
}

LLVM IR (-O2):
define i32 @do_238() {
ret i32 238
}
/* Variables and functions */
scalar_t__ system(char *);
int is_mmc_card_mounted(void) {
  if (system("mount | grep \"mmcblk0p1\"") == 0) {
    return 1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<is_mmc_card_mounted>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jne    113a <is_mmc_card_mounted+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1141 <is_mmc_card_mounted+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mmc_card_mounted>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"mount | grep \22mmcblk0p1\22\00"
define i32 @is_mmc_card_mounted() {
%1 = alloca i32
%2 = call i64 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 1, i32* %1
br label %6
5: ; preds = %0
store i32 0, i32* %1
br label %6
6: ; preds = %5, %4
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
@.str = [25 x i8] c"mount | grep \22mmcblk0p1\22\00"
define i32 @is_mmc_card_mounted() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int write(int, unsigned char *, int);
int rs232_send_buf(int fd, unsigned char *buf, int size) {
  return (write(fd, buf, size));
}


x86 assembly (clang, -O0):
<rs232_send_buf>:
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 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs232_send_buf>:
jmp    1030 <write@plt>

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

LLVM IR (-O2):
define i32 @rs232_send_buf(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *const);
extern void eFree(void *const ptr) {
  Assert(ptr != NULL);
  free(ptr);
}


x86 assembly (clang, -O0):
<eFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <Assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eFree>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <Assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @eFree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = call i32 @Assert(i32 %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @eFree(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert(i32 %3)
%5 = tail call i32 @free(i8* %0)
ret void
}
void ERR_get_error_line(void) {}


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

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

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

LLVM IR (-O2):
define void @ERR_get_error_line() {
ret void
}
int __gthread_active_p() { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ cmd_reboot();
int /*<<< orphan*/ reset_cs_to_default();
void cmdRestoreDefault(int cmdType, struct cmd_arg *pCmdArg) {
  reset_cs_to_default();
  cmd_reboot();
}


x86 assembly (clang, -O0):
<cmdRestoreDefault>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <reset_cs_to_default@plt>
mov    $0x0,%al
call   1030 <cmd_reboot@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmdRestoreDefault>:
push   %rax
xor    %eax,%eax
call   1040 <reset_cs_to_default@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <cmd_reboot@plt>

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdRestoreDefault(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @reset_cs_to_default()
%6 = call i32 (...) @cmd_reboot()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdRestoreDefault(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @reset_cs_to_default()
%4 = tail call i32 (...) @cmd_reboot()
ret void
}
int gfx_set_tv_defaults(int format) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @gfx_set_tv_defaults(i32 %0) {
ret i32 0
}
__attribute__((__no__)) void do_nothing_packed_none(struct test_packed *ptr) {
  if ((unsigned long)ptr > 0x2)
    return;
  else
    return;
}


x86 assembly (clang, -O0):
<do_nothing_packed_none>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x2,%rax
jbe    111b <do_nothing_packed_none+0x1b>
jmp    1120 <do_nothing_packed_none+0x20>
jmp    1120 <do_nothing_packed_none+0x20>
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.test_packed = type opaque
define void @do_nothing_packed_none(%struct.test_packed* %0) {
%2 = alloca %struct.test_packed*
store %struct.test_packed* %0, %struct.test_packed** %2
%3 = load %struct.test_packed*, %struct.test_packed** %2
%4 = ptrtoint %struct.test_packed* %3 to i64
%5 = icmp ugt i64 %4, 2
br i1 %5, label %6, label %7
6: ; preds = %1
br label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.test_packed = type opaque
define void @do_nothing_packed_none(%struct.test_packed* nocapture %0) {
ret void
}
/* Variables and functions */
double ignnbn(long, double);
void nbino_rndc(int n, long a, double p, double *array) {
  int i;
  for (i = 0; i < n; i++)
    *(array + i) = ignnbn(a, p);
}


x86 assembly (clang, -O0):
<nbino_rndc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1164 <nbino_rndc+0x54>
mov    -0x10(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1030 <ignnbn@plt>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112f <nbino_rndc+0x1f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nbino_rndc>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    114c <nbino_rndc+0x3c>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r12d
xor    %ebx,%ebx
movsd  %xmm0,(%rsp)
nopl   0x0(%rax)
mov    %r15,%rdi
movsd  (%rsp),%xmm0
call   1030 <ignnbn@plt>
movsd  %xmm0,(%r14,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <nbino_rndc+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @nbino_rndc(i32 %0, i64 %1, double %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %12, %8 ]
%10 = tail call double @ignnbn(i64 %1, double %2)
%11 = getelementptr inbounds double, double* %3, i64 %9
store double %10, double* %11
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %7
br i1 %13, label %14, label %8
14: ; preds = %8, %4
ret void
}
/* Type definitions */
struct cmd_arg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ showUrlBlocking();
void cmdShowUrlBlocking(int cmdType, struct cmd_arg *pCmdArg) {
  showUrlBlocking();
}


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

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

LLVM IR (-O0):
%struct.cmd_arg = type { i32 }
define void @cmdShowUrlBlocking(i32 %0, %struct.cmd_arg* %1) {
%3 = alloca i32
%4 = alloca %struct.cmd_arg*
store i32 %0, i32* %3
store %struct.cmd_arg* %1, %struct.cmd_arg** %4
%5 = call i32 (...) @showUrlBlocking()
ret void
}

LLVM IR (-O2):
%struct.cmd_arg = type { i32 }
define void @cmdShowUrlBlocking(i32 %0, %struct.cmd_arg* nocapture readnone %1) {
%3 = tail call i32 (...) @showUrlBlocking()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void welcomeScreen() {
  printf("\n-------------------------------------------------\n");
  printf("\tWelcome to Xsh  \n");
  printf("\tAuthor @burzumishi\n");
  printf("-------------------------------------------------\n");
  printf("\n\n");
}


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

x86 assembly (clang, -O2):
<welcomeScreen>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf15(%rip),%rdi
call   1030 <puts@plt>
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xf11(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [52 x i8] c"\0A-------------------------------------------------\0A\00"
@.str.1 = [19 x i8] c"\09Welcome to Xsh \0A\00"
@.str.2 = [21 x i8] c"\09Author @burzumishi\0A\00"
@.str.3 = [51 x i8] c"-------------------------------------------------\0A\00"
@.str.4 = [3 x i8] c"\0A\0A\00"
define void @welcomeScreen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"\0A-------------------------------------------------\00"
@str.5 = [18 x i8] c"\09Welcome to Xsh \00"
@str.6 = [20 x i8] c"\09Author @burzumishi\00"
@str.7 = [50 x i8] c"-------------------------------------------------\00"
@str.8 = [2 x i8] c"\0A\00"
define void @welcomeScreen() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
ret void
}
int main(void) { return 3 + 4; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 7
}
/* Variables and functions */
int /*<<< orphan*/ probability(int);
int /*<<< orphan*/ probability_mc(int, int);
double round(int /*<<< orphan*/);
int test_10() {
  return 0.11 == round(probability(10)) &&
         0.11 == round(probability_mc(10, 100000));
}


x86 assembly (clang, -O0):
<test_10>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
call   1030 <probability@plt>
mov    %eax,%edi
call   1050 <round@plt>
movaps %xmm0,%xmm1
xor    %eax,%eax
movsd  0xeaa(%rip),%xmm0
ucomisd %xmm1,%xmm0
mov    %al,-0x1(%rbp)
jne    1199 <test_10+0x69>
jp     1199 <test_10+0x69>
mov    $0xa,%edi
mov    $0x186a0,%esi
call   1040 <probability_mc@plt>
mov    %eax,%edi
call   1050 <round@plt>
movaps %xmm0,%xmm1
movsd  0xe76(%rip),%xmm0
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_10>:
push   %rax
mov    $0xa,%edi
call   1030 <probability@plt>
mov    %eax,%edi
call   1050 <round@plt>
ucomisd 0xeb6(%rip),%xmm0
jne    1177 <test_10+0x47>
jp     1177 <test_10+0x47>
mov    $0xa,%edi
mov    $0x186a0,%esi
call   1040 <probability_mc@plt>
mov    %eax,%edi
call   1050 <round@plt>
cmpeqsd 0xe93(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_10() {
%1 = call i32 @probability(i32 10)
%2 = call double @round(i32 %1)
%3 = fcmp oeq double 1.100000e-01, %2
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 @probability_mc(i32 10, i32 100000)
%6 = call double @round(i32 %5)
%7 = fcmp oeq double 1.100000e-01, %6
br label %8
8: ; preds = %4, %0
%9 = phi i1 [ false, %0 ], [ %7, %4 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_10() {
%1 = tail call i32 @probability(i32 10)
%2 = tail call double @round(i32 %1)
%3 = fcmp oeq double %2, 1.100000e-01
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = tail call i32 @probability_mc(i32 10, i32 100000)
%6 = tail call double @round(i32 %5)
%7 = fcmp oeq double %6, 1.100000e-01
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %0
%10 = phi i32 [ 0, %0 ], [ %8, %4 ]
ret i32 %10
}
long time() { return 0; }


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

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

LLVM IR (-O0):
define i64 @time() {
ret i64 0
}

LLVM IR (-O2):
define i64 @time() {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ go();
int /*<<< orphan*/ init(char *);
int main(int argc, char *test_name[]) {
  init(test_name[1]);
  go();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <init@plt>
mov    $0x0,%al
call   1030 <go@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <init@plt>
xor    %eax,%eax
call   1030 <go@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @init(i8* %8)
%10 = call i32 (...) @go()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @init(i8* %4)
%6 = tail call i32 (...) @go()
ret i32 0
}
int analogRead(int pin) { return 10; }


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

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

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

LLVM IR (-O2):
define i32 @analogRead(i32 %0) {
ret i32 10
}
/* Variables and functions */
scalar_t__ isprint(int);
int isgraph(int c) { return c != ' ' && isprint(c); }


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113c <isgraph+0x2c>
mov    -0x4(%rbp),%edi
call   1030 <isprint@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
xor    %eax,%eax
cmp    $0x20,%edi
je     112c <isgraph+0x1c>
push   %rax
call   1030 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = icmp eq i32 %0, 32
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @isprint(i32 %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int sort_string_icmp(const void *a, const void *b) {
  const char **a_ptr = (const char **)a;
  const char **b_ptr = (const char **)b;
  return strcasecmp(*a_ptr, *b_ptr);
}


x86 assembly (clang, -O0):
<sort_string_icmp>:
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    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
call   1030 <strcasecmp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_string_icmp>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
define i32 @sort_string_icmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i8**
store i8** %8, i8*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %6
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = load i8**, i8*** %6
%14 = load i8*, i8** %13
%15 = call i32 @strcasecmp(i8* %12, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @sort_string_icmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = tail call i32 @strcasecmp(i8* %5, i8* %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ kill_children();
void signal_handler(int signum) {
  (void)signum;
  kill_children();
}


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

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

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

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 (...) @kill_children()
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct mmsghdr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int recvmmsg(int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
             struct timespec *tmo) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<recvmmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recvmmsg>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.mmsghdr = type { i32 }
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @recvmmsg(i32 %0, %struct.mmsghdr* %1, i32 %2, i32 %3, %struct.timespec* %4) {
%6 = alloca i32
%7 = alloca %struct.mmsghdr*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store %struct.mmsghdr* %1, %struct.mmsghdr** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* @ENOSYS
%12 = call i32 @__set_errno(i32 %11)
ret i32 -1
}

LLVM IR (-O2):
%struct.mmsghdr = type { i32 }
%struct.timespec = type { i32 }
@ENOSYS = global i32 0
define i32 @recvmmsg(i32 %0, %struct.mmsghdr* nocapture readnone %1, i32 %2, i32 %3, %struct.timespec* nocapture readnone %4) {
%6 = load i32, i32* @ENOSYS
%7 = tail call i32 @__set_errno(i32 %6)
ret i32 -1
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ opng_panic_memory();
void *opng_xmalloc(size_t size) {
  void *result;
  result = malloc(size);
  if (result == NULL && size != 0)
    opng_panic_memory();
  return result;
}


x86 assembly (clang, -O0):
<opng_xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <opng_xmalloc+0x36>
cmpq   $0x0,-0x8(%rbp)
je     1156 <opng_xmalloc+0x36>
mov    $0x0,%al
call   1040 <opng_panic_memory@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opng_xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <malloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1140 <opng_xmalloc+0x20>
test   %r14,%r14
jne    1140 <opng_xmalloc+0x20>
xor    %eax,%eax
call   1040 <opng_panic_memory@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @opng_xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
%4 = icmp ne i64 %0, 0
%5 = and i1 %4, %3
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 (...) @opng_panic_memory()
br label %8
8: ; preds = %6, %1
ret i8* %2
}
/* Type definitions */
struct ibv_srq {
  int dummy;
};

/* Variables and functions */
int _destroy_srq(struct ibv_srq *);
int /*<<< orphan*/ dmtcp_plugin_disable_ckpt();
int /*<<< orphan*/ dmtcp_plugin_enable_ckpt();
int ibv_destroy_srq(struct ibv_srq *srq) {
  dmtcp_plugin_disable_ckpt();
  int rslt = _destroy_srq(srq);
  dmtcp_plugin_enable_ckpt();
  return rslt;
}


x86 assembly (clang, -O0):
<ibv_destroy_srq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    -0x8(%rbp),%rdi
call   1030 <_destroy_srq@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibv_destroy_srq>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dmtcp_plugin_disable_ckpt@plt>
mov    %rbx,%rdi
call   1030 <_destroy_srq@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <dmtcp_plugin_enable_ckpt@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ibv_srq = type { i32 }
define i32 @ibv_destroy_srq(%struct.ibv_srq* %0) {
%2 = alloca %struct.ibv_srq*
%3 = alloca i32
store %struct.ibv_srq* %0, %struct.ibv_srq** %2
%4 = call i32 (...) @dmtcp_plugin_disable_ckpt()
%5 = load %struct.ibv_srq*, %struct.ibv_srq** %2
%6 = call i32 @_destroy_srq(%struct.ibv_srq* %5)
store i32 %6, i32* %3
%7 = call i32 (...) @dmtcp_plugin_enable_ckpt()
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.ibv_srq = type { i32 }
define i32 @ibv_destroy_srq(%struct.ibv_srq* %0) {
%2 = tail call i32 (...) @dmtcp_plugin_disable_ckpt()
%3 = tail call i32 @_destroy_srq(%struct.ibv_srq* %0)
%4 = tail call i32 (...) @dmtcp_plugin_enable_ckpt()
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ nrf_802154_swi_notify_cca(int);
void nrf_802154_notify_cca(bool is_free) { nrf_802154_swi_notify_cca(is_free); }


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

x86 assembly (clang, -O2):
<nrf_802154_notify_cca>:
jmp    1030 <nrf_802154_swi_notify_cca@plt>

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

LLVM IR (-O2):
define void @nrf_802154_notify_cca(i32 %0) {
%2 = tail call i32 @nrf_802154_swi_notify_cca(i32 %0)
ret void
}
int E(double dx, double dz) { return dx / dx == dz / dz; }


x86 assembly (clang, -O0):
<E>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  -0x10(%rbp),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<E>:
unpcklpd %xmm1,%xmm0
divpd  %xmm0,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
cmpeqsd %xmm0,%xmm1
movq   %xmm1,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @E(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* %3
%7 = fdiv double %5, %6
%8 = load double, double* %4
%9 = load double, double* %4
%10 = fdiv double %8, %9
%11 = fcmp oeq double %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @E(double %0, double %1) {
%3 = insertelement <2 x double> poison, double %0, i64 0
%4 = insertelement <2 x double> %3, double %1, i64 1
%5 = fdiv <2 x double> %4, %4
%6 = extractelement <2 x double> %5, i64 0
%7 = extractelement <2 x double> %5, i64 1
%8 = fcmp oeq double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}
const char *__malidrv_build_info(void) {
  return "malidrv:  API_VERSION=600 REPO_URL=heads/temp "
         "REVISION=-v3.10.69-75-ga178e16 CHANGED_REVISION=v3.10.69-75-ga178e16 "
         "CHANGE_DATE=2015-02-20 00:53:48 +0100 BUILD_DATE=Fri Feb 20 05:24:37 "
         "CET 2015 BUILD=release TARGET_PLATFORM=meson_m450 MALI_PLATFORM= "
         "KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= "
         "USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 "
         "USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1";
}


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

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

LLVM IR (-O0):
@.str = [432 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/temp REVISION=-v3.10.69-75-ga178e16 CHANGED_REVISION=v3.10.69-75-ga178e16 CHANGE_DATE=2015-02-20 00:53:48 +0100 BUILD_DATE=Fri Feb 20 05:24:37 CET 2015 BUILD=release TARGET_PLATFORM=meson_m450 MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([432 x i8], [432 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [432 x i8] c"malidrv: API_VERSION=600 REPO_URL=heads/temp REVISION=-v3.10.69-75-ga178e16 CHANGED_REVISION=v3.10.69-75-ga178e16 CHANGE_DATE=2015-02-20 00:53:48 +0100 BUILD_DATE=Fri Feb 20 05:24:37 CET 2015 BUILD=release TARGET_PLATFORM=meson_m450 MALI_PLATFORM= KDIR= OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_UMP= USING_PROFILING= USING_INTERNAL_PROFILING= USING_GPU_UTILIZATION=1 USING_POWER_PERFORMANCE_POLICY= MALI_UPPER_HALF_SCHEDULING=1\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([432 x i8], [432 x i8]* @.str, i64 0, i64 0)
}
int P(sid)
int sid;
{ return (semcall(sid, -1, 0)); }


x86 assembly (clang, -O0):
<P>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <semcall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<P>:
mov    $0xffffffff,%esi
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <semcall@plt>

LLVM IR (-O0):
define i32 @P(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, i32, ...)*)(i32 %3, i32 -1, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @P(i32 %0) {
%2 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @semcall to i32 (i32, i32, i32, ...)*)(i32 %0, i32 -1, i32 0)
ret i32 %2
}