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

/* Variables and functions */
int /*<<< orphan*/ mat4_perspective_fov(float *, float, float, float, float,
                                        float);
__attribute__((always_)) struct mat4 *
psmat4_perspective_fov(struct mat4 *result, float fov, float w, float h,
                       float n, float f) {
  mat4_perspective_fov((float *)result, fov, w, h, n, f);
  return result;
}


x86 assembly (clang, -O0):
<psmat4_perspective_fov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
movss  %xmm3,-0x18(%rbp)
movss  %xmm4,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0x14(%rbp),%xmm2
movss  -0x18(%rbp),%xmm3
movss  -0x1c(%rbp),%xmm4
call   1030 <mat4_perspective_fov@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psmat4_perspective_fov>:
push   %rbx
mov    %rdi,%rbx
call   1030 <mat4_perspective_fov@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_perspective_fov(%struct.mat4* %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca %struct.mat4*
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store %struct.mat4* %0, %struct.mat4** %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load %struct.mat4*, %struct.mat4** %7
%14 = bitcast %struct.mat4* %13 to float*
%15 = load float, float* %8
%16 = load float, float* %9
%17 = load float, float* %10
%18 = load float, float* %11
%19 = load float, float* %12
%20 = call i32 @mat4_perspective_fov(float* %14, float %15, float %16, float %17, float %18, float %19)
%21 = load %struct.mat4*, %struct.mat4** %7
ret %struct.mat4* %21
}

LLVM IR (-O2):
%struct.mat4 = type { i32 }
define %struct.mat4* @psmat4_perspective_fov(%struct.mat4* returned %0, float %1, float %2, float %3, float %4, float %5) {
%7 = bitcast %struct.mat4* %0 to float*
%8 = tail call i32 @mat4_perspective_fov(float* %7, float %1, float %2, float %3, float %4, float %5)
ret %struct.mat4* %0
}
int clrbit(int word, int bit) { return (word & ~(1 << bit)); }


x86 assembly (clang, -O0):
<clrbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @clrbit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @clrbit(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage:\n");
  printf("  -h display this help message\n");
  printf("  -h host ip\n");
  printf("  -p port\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
lea    0xef7(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [32 x i8] c" -h display this help message\0A\00"
@.str.2 = [14 x i8] c" -h host ip\0A\00"
@.str.3 = [11 x i8] c" -p port\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [7 x i8] c"usage:\00"
@str.4 = [31 x i8] c" -h display this help message\00"
@str.5 = [13 x i8] c" -h host ip\00"
@str.6 = [10 x i8] c" -p port\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.6, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int eval(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, int);
char *read(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stdin;
int main() {
  FILE *input = stdin;
  char *expression = read(input);
  int32_t result = eval(expression);
  printf("%d\n", result);
  free(expression);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <read@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <eval@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xe80(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%rdi
call   1050 <read@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1060 <eval@plt>
lea    0xe9e(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32* null
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i8*
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32*, i32** @stdin
store i32* %5, i32** %2
%6 = load i32*, i32** %2
%7 = call i8* @read(i32* %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @eval(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = load i32*, i32** @stdin
%2 = tail call i8* @read(i32* %1)
%3 = tail call i32 @eval(i8* %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
void swap_endian_4byte(int8_t *e) {
  int8_t a;
  a = e[0];
  e[0] = e[3];
  e[3] = a;
  ;
  a = e[1];
  e[1] = e[2];
  e[2] = a;
  ;
}


x86 assembly (clang, -O0):
<swap_endian_4byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_endian_4byte>:
movdqu (%rdi),%xmm0
pshufd $0x1b,%xmm0,%xmm0
movdqu %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @swap_endian_4byte(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 3
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %3
%13 = load i32*, i32** %2
%14 = getelementptr inbounds i32, i32* %13, i64 3
store i32 %12, i32* %14
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 1
%17 = load i32, i32* %16
store i32 %17, i32* %3
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = load i32*, i32** %2
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32 %20, i32* %22
%23 = load i32, i32* %3
%24 = load i32*, i32** %2
%25 = getelementptr inbounds i32, i32* %24, i64 2
store i32 %23, i32* %25
ret void
}

LLVM IR (-O2):
define void @swap_endian_4byte(i32* nocapture %0) {
%2 = bitcast i32* %0 to <4 x i32>*
%3 = load <4 x i32>, <4 x i32>* %2
%4 = shufflevector <4 x i32> %3, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%5 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %4, <4 x i32>* %5
ret void
}
/* Type definitions */
struct timeval {
  double tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double current_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<current_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<current_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdl 0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i32 }
define double @current_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %8
}

LLVM IR (-O2):
%struct.timeval = type { double, i32 }
define double @current_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %9
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_write_quaddobl_system(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(381, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_write_quaddobl_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x17d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_write_quaddobl_system>:
mov    $0x17d,%edi
jmp    1030 <_ada_use_c2phc@plt>

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

LLVM IR (-O2):
define i32 @syscon_write_quaddobl_system() {
%1 = tail call i32 @_ada_use_c2phc(i32 381, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
scalar_t__ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ unix_error(char *);
void Sigaddset(sigset_t *set, int sig) {
  if (sigaddset(set, sig) < 0) {
    unix_error("Sigaddset error");
  }
}


x86 assembly (clang, -O0):
<Sigaddset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <sigaddset@plt>
cmp    $0x0,%rax
jge    1151 <Sigaddset+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sigaddset>:
push   %rax
call   1040 <sigaddset@plt>
test   %rax,%rax
js     112d <Sigaddset+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Sigaddset error\00"
define void @Sigaddset(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i64 @sigaddset(i32* %5, i32 %6)
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Sigaddset error\00"
define void @Sigaddset(i32* %0, i32 %1) {
%3 = tail call i64 @sigaddset(i32* %0, i32 %1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @unix_error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
max(int x, int y) {
  int z;
  if (x > y)
    z = x;
  else
    z = y;
  return z;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int test_imm_37int16_mem(short *val) {
  return ((*val) & (0x37 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_37int16_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, 55
%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_37int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 55
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ceil(int /*<<< orphan*/);
int /*<<< orphan*/ luaL_check_number(int);
int /*<<< orphan*/ lua_pushnumber(int /*<<< orphan*/);
void math_ceil(void) { lua_pushnumber(ceil(luaL_check_number(1))); }


x86 assembly (clang, -O0):
<math_ceil>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <luaL_check_number@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,%edi
call   1050 <lua_pushnumber@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<math_ceil>:
push   %rax
mov    $0x1,%edi
call   1040 <luaL_check_number@plt>
mov    %eax,%edi
call   1030 <ceil@plt>
mov    %eax,%edi
pop    %rax
jmp    1050 <lua_pushnumber@plt>

LLVM IR (-O0):
define void @math_ceil() {
%1 = call i32 @luaL_check_number(i32 1)
%2 = call i32 @ceil(i32 %1)
%3 = call i32 @lua_pushnumber(i32 %2)
ret void
}

LLVM IR (-O2):
define void @math_ceil() {
%1 = tail call i32 @luaL_check_number(i32 1)
%2 = tail call i32 @ceil(i32 %1)
%3 = tail call i32 @lua_pushnumber(i32 %2)
ret void
}
/* Variables and functions */
float asinf(float);
float warp_asinf(float x) { return asinf(x) * 0.63661977236758134f; }


x86 assembly (clang, -O0):
<warp_asinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <asinf@plt>
movss  0xed1(%rip),%xmm1
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warp_asinf>:
push   %rax
call   1030 <asinf@plt>
mulss  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @warp_asinf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @asinf(float %3)
%5 = fmul float %4, 0x3FE45F3060000000
ret float %5
}

LLVM IR (-O2):
define float @warp_asinf(float %0) {
%2 = tail call float @asinf(float %0)
%3 = fmul float %2, 0x3FE45F3060000000
ret float %3
}
/* Variables and functions */
int gpio_pin_oper(unsigned int, unsigned int, int /*<<< orphan*/);
int gpio_clr_pin(unsigned int port, unsigned int pin) {
  return gpio_pin_oper(port, pin, 0);
}


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

x86 assembly (clang, -O2):
<gpio_clr_pin>:
xor    %edx,%edx
jmp    1030 <gpio_pin_oper@plt>

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

LLVM IR (-O2):
define i32 @gpio_clr_pin(i32 %0, i32 %1) {
%3 = tail call i32 @gpio_pin_oper(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ glfPrint(char *, int);
void glfPrintChar(char s) { glfPrint(&s, 1); }


x86 assembly (clang, -O0):
<glfPrintChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <glfPrint@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<glfPrintChar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <glfPrint@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @glfPrintChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @glfPrint(i8* %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @glfPrintChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @glfPrint(i8* %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ helper_double_16_recursive(double *, int);
void helper_double_16(double *buf) { helper_double_16_recursive(buf, 16); }


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

x86 assembly (clang, -O2):
<helper_double_16>:
mov    $0x10,%esi
jmp    1030 <helper_double_16_recursive@plt>

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

LLVM IR (-O2):
define void @helper_double_16(double* %0) {
%2 = tail call i32 @helper_double_16_recursive(double* %0, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
volatile void exiterr() { _exit(1); }


x86 assembly (clang, -O0):
<exiterr>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<exiterr>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @exiterr() {
%1 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @exiterr() {
%1 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int fun_noninline_o(int);
__attribute__((always_)) int fun_f(int argf) {
  static int locf = 0;
  locf += argf;
  return fun_noninline_o(locf);
}


x86 assembly (clang, -O0):
<fun_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    0x2f08(%rip),%eax
mov    %eax,0x2f02(%rip)
mov    0x2efc(%rip),%edi
call   1030 <fun_noninline_o@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_f>:
add    0x2f16(%rip),%edi
mov    %edi,0x2f10(%rip)
jmp    1030 <fun_noninline_o@plt>

LLVM IR (-O0):
@fun_f.locf = internal global i32 0
define i32 @fun_f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @fun_f.locf
%5 = add nsw i32 %4, %3
store i32 %5, i32* @fun_f.locf
%6 = load i32, i32* @fun_f.locf
%7 = call i32 @fun_noninline_o(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
@fun_f.locf = internal unnamed_addr global i32 0
define i32 @fun_f(i32 %0) {
%2 = load i32, i32* @fun_f.locf
%3 = add nsw i32 %2, %0
store i32 %3, i32* @fun_f.locf
%4 = tail call i32 @fun_noninline_o(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ASSERT(int /*<<< orphan*/);
int /*<<< orphan*/ isASCIIHexDigit(char);
int toASCIIHexValue(char c) {
  ASSERT(isASCIIHexDigit(c));
  return c < 'A' ? c - '0' : (c - 'A' + 10) & 0xF;
}


x86 assembly (clang, -O0):
<toASCIIHexValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1040 <isASCIIHexDigit@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jge    115a <toASCIIHexValue+0x3a>
movsbl -0x1(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    116a <toASCIIHexValue+0x4a>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
and    $0xf,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toASCIIHexValue>:
push   %rbx
mov    %edi,%ebx
call   1040 <isASCIIHexDigit@plt>
mov    %eax,%edi
call   1030 <ASSERT@plt>
lea    -0x30(%rbx),%ecx
mov    %ebx,%eax
add    $0x9,%eax
and    $0xf,%eax
cmp    $0x41,%bl
cmovl  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toASCIIHexValue(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isASCIIHexDigit(i8 signext %3)
%5 = call i32 @ASSERT(i32 %4)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp slt i32 %7, 65
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
br label %19
13: ; preds = %1
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 65
%17 = add nsw i32 %16, 10
%18 = and i32 %17, 15
br label %19
19: ; preds = %13, %9
%20 = phi i32 [ %12, %9 ], [ %18, %13 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @toASCIIHexValue(i8 signext %0) {
%2 = tail call i32 @isASCIIHexDigit(i8 signext %0)
%3 = tail call i32 @ASSERT(i32 %2)
%4 = sext i8 %0 to i32
%5 = icmp slt i8 %0, 65
%6 = add nsw i32 %4, -48
%7 = add nsw i32 %4, 9
%8 = and i32 %7, 15
%9 = select i1 %5, i32 %6, i32 %8
ret i32 %9
}
/* Variables and functions */
int strcmp(char *, char *);
int str_lex(const void *p1, const void *p2) {
  return strcmp(*(char **)p1, *(char **)p2);
}


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

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

LLVM IR (-O0):
define i32 @str_lex(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @str_lex(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ atol(char *);
int bench_stat(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  if (argc == 1 + 1) {
    return -bench_stat(atol(argv[1]));
  } else {
    printf("USAGE : bench_open count\n");
    return 7;
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
jne    1172 <main+0x42>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atol@plt>
mov    %eax,%edi
call   1040 <bench_stat@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <main+0x55>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    114a <main+0x1a>
mov    0x8(%rsi),%rdi
call   1050 <atol@plt>
mov    %eax,%edi
call   1040 <bench_stat@plt>
neg    %eax
pop    %rcx
ret
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"USAGE : bench_open count\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @atol(i8* %11)
%13 = call i32 @bench_stat(i32 %12)
%14 = sub nsw i32 0, %13
store i32 %14, i32* %3
br label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 7, i32* %3
br label %17
17: ; preds = %15, %8
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@str = [25 x i8] c"USAGE : bench_open count\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %10
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atol(i8* %6)
%8 = tail call i32 @bench_stat(i32 %7)
%9 = sub nsw i32 0, %8
br label %12
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %12
12: ; preds = %10, %4
%13 = phi i32 [ %9, %4 ], [ 7, %10 ]
ret i32 %13
}
/* Variables and functions */
char *malloc(int);
void while_loop() {
  int i = 0;
  char *a = malloc(10);
  while (*(a + i) && i < 10)
    a[i++] = 1;
}


x86 assembly (clang, -O0):
<while_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1151 <while_loop+0x41>
cmpl   $0xa,-0x4(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1161 <while_loop+0x51>
jmp    117c <while_loop+0x6c>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x4(%rbp)
movslq %ecx,%rcx
movb   $0x1,(%rax,%rcx,1)
jmp    112d <while_loop+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<while_loop>:
push   %rax
mov    $0xa,%edi
call   1030 <malloc@plt>
xor    %ecx,%ecx
nopl   (%rax)
movb   $0x1,(%rax,%rcx,1)
cmpb   $0x0,0x1(%rax,%rcx,1)
je     1138 <while_loop+0x28>
lea    0x1(%rcx),%rdx
cmp    $0x9,%rcx
mov    %rdx,%rcx
jb     1120 <while_loop+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @while_loop() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
br label %2
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %5, %2 ]
%4 = phi i8* [ %1, %0 ], [ %6, %2 ]
%5 = add nuw nsw i64 %3, 1
store i8 1, i8* %4
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp ult i64 %3, 9
%10 = select i1 %8, i1 %9, i1 false
br i1 %10, label %2, label %11
11: ; preds = %2
ret void
}
char *strchr(const char *s, int c) {
  while (*s != '\0') {
    if (*s == c) {
      return (char *)s;
    }
    s++;
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <strchr+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    -0x14(%rbp),%eax
jne    1138 <strchr+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1151 <strchr+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110b <strchr+0xb>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1123 <strchr+0x23>
mov    %rdi,%rax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
je     1125 <strchr+0x25>
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %2, %10
%6 = phi i8 [ %12, %10 ], [ %3, %2 ]
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = sext i8 %6 to i32
%9 = icmp eq i32 %8, %1
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %5
14: ; preds = %5, %10, %2
%15 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %5 ]
ret i8* %15
}
void baz(int x, int y) {
  unsigned char *p = (unsigned char *)&&lab;
  int i;
  if (y) {
    for (i = 0; i < x; i++)
      (*p)++;
  } else {
  lab:
    asm volatile("");
    foo();
  }
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0x44(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1164 <baz+0x54>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <baz+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
add    $0x1,%cl
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <baz+0x2a>
jmp    1170 <baz+0x60>
jmp    1169 <baz+0x59>
mov    $0x0,%al
call   1030 <foo@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<baz>:
test   %esi,%esi
je     1120 <baz+0x10>
test   %edi,%edi
jle    111f <baz+0xf>
add    %dil,0x1(%rip)
ret
xor    %eax,%eax
jmp    1030 <foo@plt>

LLVM IR (-O0):
define void @baz(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i8* blockaddress(@baz, %23), i8** %5
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %22
9: ; preds = %2
store i32 0, i32* %6
br label %10
10: ; preds = %18, %9
%11 = load i32, i32* %6
%12 = load i32, i32* %3
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %21
14: ; preds = %10
%15 = load i8*, i8** %5
%16 = load i8, i8* %15
%17 = add i8 %16, 1
store i8 %17, i8* %15
br label %18
18: ; preds = %14
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %10
21: ; preds = %10
br label %25
22: ; preds = %2
br label %23
23: ; preds = %22, %26
%24 = call i32 (...) @foo()
br label %25
25: ; preds = %23, %21
ret void
26: ; No predecessors!
indirectbr i8* undef, [label %23]
}

LLVM IR (-O2):
define void @baz(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %12
6: ; preds = %4
%7 = load i8, i8* blockaddress(@baz, %10)
%8 = trunc i32 %0 to i8
%9 = add i8 %7, %8
store i8 %9, i8* blockaddress(@baz, %10)
br label %12
10: ; preds = %2
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
%11 = tail call i32 (...) @foo()
br label %12
12: ; preds = %4, %6, %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CE_High();
int /*<<< orphan*/ CE_Low();
int /*<<< orphan*/ Poll_SO();
int /*<<< orphan*/ Send_Byte(unsigned char);
void Auto_Add_IncB_EBSY(unsigned char byte1, unsigned char byte2) {
  CE_Low();
  Send_Byte(0xAD);
  Send_Byte(byte1);
  Send_Byte(byte2);
  CE_High();
  Poll_SO();
}


x86 assembly (clang, -O0):
<Auto_Add_IncB_EBSY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1060 <CE_Low@plt>
mov    $0xad,%edi
call   1030 <Send_Byte@plt>
movzbl -0x1(%rbp),%edi
call   1030 <Send_Byte@plt>
movzbl -0x2(%rbp),%edi
call   1030 <Send_Byte@plt>
mov    $0x0,%al
call   1040 <CE_High@plt>
mov    $0x0,%al
call   1050 <Poll_SO@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Auto_Add_IncB_EBSY>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1060 <CE_Low@plt>
mov    $0xad,%edi
call   1030 <Send_Byte@plt>
mov    %ebp,%edi
call   1030 <Send_Byte@plt>
mov    %ebx,%edi
call   1030 <Send_Byte@plt>
xor    %eax,%eax
call   1040 <CE_High@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <Poll_SO@plt>

LLVM IR (-O0):
define void @Auto_Add_IncB_EBSY(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @CE_Low()
%6 = call i32 @Send_Byte(i8 zeroext -83)
%7 = load i8, i8* %3
%8 = call i32 @Send_Byte(i8 zeroext %7)
%9 = load i8, i8* %4
%10 = call i32 @Send_Byte(i8 zeroext %9)
%11 = call i32 (...) @CE_High()
%12 = call i32 (...) @Poll_SO()
ret void
}

LLVM IR (-O2):
define void @Auto_Add_IncB_EBSY(i8 zeroext %0, i8 zeroext %1) {
%3 = tail call i32 (...) @CE_Low()
%4 = tail call i32 @Send_Byte(i8 zeroext -83)
%5 = tail call i32 @Send_Byte(i8 zeroext %0)
%6 = tail call i32 @Send_Byte(i8 zeroext %1)
%7 = tail call i32 (...) @CE_High()
%8 = tail call i32 (...) @Poll_SO()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int max_value(int array[][4]);
  int a[3][4] = {{1, 3, 5, 7}, {2, 4, 6, 8}, {15, 17, 34, 12}};
  printf("array is :\n");
  printf("max value of two dimention array is %d\n", max_value(a));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x30,%edx
call   1040 <memcpy@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
call   1050 <max_value@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xefa(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1050 <max_value@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 3, i32 5, i32 7], [4 x i32] [i32 2, i32 4, i32 6, i32 8], [4 x i32] [i32 15, i32 17, i32 34, i32 12]]
@.str = [12 x i8] c"array is :\0A\00"
@.str.1 = [40 x i8] c"max value of two dimention array is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x [4 x i32]]
store i32 0, i32* %1
%3 = bitcast [3 x [4 x i32]]* %2 to i8*
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %2, i64 0, i64 0
%6 = call i32 @max_value([4 x i32]* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x [4 x i32]] [[4 x i32] [i32 1, i32 3, i32 5, i32 7], [4 x i32] [i32 2, i32 4, i32 6, i32 8], [4 x i32] [i32 15, i32 17, i32 34, i32 12]]
@.str.1 = [40 x i8] c"max value of two dimention array is %d\0A\00"
@str = [11 x i8] c"array is :\00"
define i32 @main() {
%1 = alloca [3 x [4 x i32]]
%2 = bitcast [3 x [4 x i32]]* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x [4 x i32]], [3 x [4 x i32]]* %1, i64 0, i64 0
%5 = call i32 @max_value([4 x i32]* %4)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
int freecell_solver_user_get_max_num_decks(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @freecell_solver_user_get_max_num_decks() {
ret i32 2
}

LLVM IR (-O2):
define i32 @freecell_solver_user_get_max_num_decks() {
ret i32 2
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_snanrange(int, float *, int);
int main() {
  float x[] = {1.0,  -2.0, -3.0, 4.0,       -5.0,
               -6.0, 7.0,  8.0,  0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  float v = stdlib_strided_snanrange(N, x, stride);
  printf("range: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1050 <stdlib_strided_snanrange@plt>
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_snanrange@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [11 x i8] c"range: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_snanrange(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [11 x i8] c"range: %f\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_snanrange(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MsDelay(int);
int /*<<< orphan*/ RlsSignals();
void StopJtag(void) {
  {
    RlsSignals();
    MsDelay(10);
  }
}


x86 assembly (clang, -O0):
<StopJtag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <RlsSignals@plt>
mov    $0xa,%edi
call   1030 <MsDelay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StopJtag>:
push   %rax
xor    %eax,%eax
call   1040 <RlsSignals@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <MsDelay@plt>

LLVM IR (-O0):
define void @StopJtag() {
%1 = call i32 (...) @RlsSignals()
%2 = call i32 @MsDelay(i32 10)
ret void
}

LLVM IR (-O2):
define void @StopJtag() {
%1 = tail call i32 (...) @RlsSignals()
%2 = tail call i32 @MsDelay(i32 10)
ret void
}
/* Variables and functions */
int d85(int);
unsigned get_base85_word(void) { return d85(d85(d85(d85(d85(0))))); }


x86 assembly (clang, -O0):
<get_base85_word>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <d85@plt>
mov    %eax,%edi
call   1030 <d85@plt>
mov    %eax,%edi
call   1030 <d85@plt>
mov    %eax,%edi
call   1030 <d85@plt>
mov    %eax,%edi
call   1030 <d85@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @get_base85_word() {
%1 = call i32 @d85(i32 0)
%2 = call i32 @d85(i32 %1)
%3 = call i32 @d85(i32 %2)
%4 = call i32 @d85(i32 %3)
%5 = call i32 @d85(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_base85_word() {
%1 = tail call i32 @d85(i32 0)
%2 = tail call i32 @d85(i32 %1)
%3 = tail call i32 @d85(i32 %2)
%4 = tail call i32 @d85(i32 %3)
%5 = tail call i32 @d85(i32 %4)
ret i32 %5
}
int f5(int x) { return (x % 5) % 6; }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x21,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @f5(i32 %0) {
%2 = srem i32 %0, 5
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void filecpy(FILE *ifp, FILE *ofp) {
  int c;
  while ((c = getc(ifp)) != EOF) {
    putc(c, ofp);
  }
}


x86 assembly (clang, -O0):
<filecpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%eax
je     115c <filecpy+0x3c>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <putc@plt>
jmp    1130 <filecpy+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filecpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <getc@plt>
mov    0x2eb1(%rip),%r15
cmp    (%r15),%eax
je     1157 <filecpy+0x37>
nopl   0x0(%rax)
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %rbx,%rdi
call   1040 <getc@plt>
cmp    (%r15),%eax
jne    1140 <filecpy+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i32 0
define void @filecpy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %11, %2
%7 = load i32*, i32** %3
%8 = call i32 @getc(i32* %7)
store i32 %8, i32* %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %15
11: ; preds = %6
%12 = load i32, i32* %5
%13 = load i32*, i32** %4
%14 = call i32 @putc(i32 %12, i32* %13)
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
define void @filecpy(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @getc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %9, %6 ], [ %3, %2 ]
%8 = tail call i32 @putc(i32 %7, i32* %1)
%9 = tail call i32 @getc(i32* %0)
%10 = load i32, i32* @EOF
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
int test_imm_FBuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xFB << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_FBuint64_midword_reg>:
test   $0xfb0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FBuint64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 16
%5 = and i64 %4, 251
%6 = icmp ne i64 %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_FBuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 16449536
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}