xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ SIG_SETMASK;
int /*<<< orphan*/ SIG_UNBLOCK;
int sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int main(void) {
  int status;
  sigset_t set1, set2;
  status = sigprocmask(SIG_BLOCK, &set1, &set2);
  status = sigprocmask(SIG_UNBLOCK, &set1, &set2);
  status = sigprocmask(SIG_SETMASK, &set1, &set2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <sigprocmask@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
@SIG_UNBLOCK = global i32 0
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %3, i32* %4)
store i32 %6, i32* %2
%7 = load i32, i32* @SIG_UNBLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %3, i32* %4)
store i32 %8, i32* %2
%9 = load i32, i32* @SIG_SETMASK
%10 = call i32 @sigprocmask(i32 %9, i32* %3, i32* %4)
store i32 %10, i32* %2
ret i32 0
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
@SIG_UNBLOCK = global i32 0
@SIG_SETMASK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* %1, i32* %2)
%7 = load i32, i32* @SIG_UNBLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %1, i32* %2)
%9 = load i32, i32* @SIG_SETMASK
%10 = call i32 @sigprocmask(i32 %9, i32* %1, i32* %2)
ret i32 0
}
/* Variables and functions */
int test_fifo(int, int, int);
int test_fifo_7_1_30(int argc, const char **argv) {
  return test_fifo(7, 1, 30);
}


x86 assembly (clang, -O0):
<test_fifo_7_1_30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1e,%edx
call   1030 <test_fifo@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fifo_7_1_30>:
mov    $0x7,%edi
mov    $0x1,%esi
mov    $0x1e,%edx
jmp    1030 <test_fifo@plt>

LLVM IR (-O0):
define i32 @test_fifo_7_1_30(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @test_fifo(i32 7, i32 1, i32 30)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_fifo_7_1_30(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @test_fifo(i32 7, i32 1, i32 30)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ds1337_write_register(int, unsigned char);
void ds1337_set_hour(unsigned char hour) { ds1337_write_register(0x01, hour); }


x86 assembly (clang, -O0):
<ds1337_set_hour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <ds1337_write_register@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1337_set_hour>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <ds1337_write_register@plt>

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

LLVM IR (-O2):
define void @ds1337_set_hour(i8 zeroext %0) {
%2 = tail call i32 @ds1337_write_register(i32 1, i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int mainb() {
  float pi = 3.14159265;
  float d = 30.0;
  float a = d * pi;
  printf("%6.6f\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<mainb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed3(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mainb>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%6.6f\0A\00"
define i32 @mainb() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
store float 0x400921FB60000000, float* %1
store float 3.000000e+01, float* %2
%4 = load float, float* %2
%5 = load float, float* %1
%6 = fmul float %4, %5
store float %6, float* %3
%7 = load float, float* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%6.6f\0A\00"
define i32 @mainb() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), float 0x40578FDBA0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void f() {
  char buffer[32];
  read(0, buffer, 2048);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
xor    %edi,%edi
mov    $0x800,%edx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
sub    $0x28,%rsp
mov    %rsp,%rsi
xor    %edi,%edi
mov    $0x800,%edx
call   1030 <read@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @f() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 2048)
ret void
}

LLVM IR (-O2):
define void @f() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 2048)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isspace(int);
void t_isspace_0x0d() {
  Assert_real((isspace(13)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              70, ("isspace should be 1 for 0x0d"));
}


x86 assembly (clang, -O0):
<t_isspace_0x0d>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1030 <isspace@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x46,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isspace_0x0d>:
push   %rax
mov    $0xd,%edi
call   1030 <isspace@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x46,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 1 for 0x0d\00"
define void @t_isspace_0x0d() {
%1 = call i32 @isspace(i32 13)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 1 for 0x0d\00"
define void @t_isspace_0x0d() {
%1 = tail call i32 @isspace(i32 13)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 70, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strchr(char const *, char);
const char *check_array(const char *type) {
  const char *str = strchr(type, '[');
  if (str)
    return str;
  return NULL;
}


x86 assembly (clang, -O0):
<check_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5b,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1146 <check_array+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114e <check_array+0x3e>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_array>:
mov    $0x5b,%esi
jmp    1030 <strchr@plt>

LLVM IR (-O0):
define i8* @check_array(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strchr(i8* %5, i8 signext 91)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i8*, i8** %4
store i8* %10, i8** %2
br label %12
11: ; preds = %1
store i8* null, i8** %2
br label %12
12: ; preds = %11, %9
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @check_array(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 91)
ret i8* %2
}
/* Variables and functions */
scalar_t__ isalpha(char const);
char *skip_alphas(const char str[]) {
  while (isalpha(*str))
    str++;
  return (char *)str;
}


x86 assembly (clang, -O0):
<skip_alphas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
je     1143 <skip_alphas+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_alphas+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_alphas>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isalpha@plt>
test   %rax,%rax
jne    1120 <skip_alphas+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_alphas(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isalpha(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skip_alphas(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isalpha(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
void f_void_p1(void) { return; }


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

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

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

LLVM IR (-O2):
define void @f_void_p1() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_retrieve_dobldobl_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc(344, &k, m, sol);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_retrieve_dobldobl_solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x158,%edi
lea    -0x8(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @solcon_retrieve_dobldobl_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store double* %3, double** %8
%10 = load i32*, i32** %7
%11 = load double*, double** %8
%12 = call i32 @_ada_use_c2phc(i32 344, i32* %6, i32* %10, double* %11)
store i32 %12, i32* %9
%13 = load i32, i32* %9
ret i32 %13
}

LLVM IR (-O2):
define i32 @solcon_retrieve_dobldobl_solution(i32 %0, i32 %1, i32* %2, double* %3) {
%5 = alloca i32
store i32 %1, i32* %5
%6 = call i32 @_ada_use_c2phc(i32 344, i32* %5, i32* %2, double* %3)
ret i32 %6
}
int test_imm_D5int64_lowword_reg(long long val) {
  return ((val) & (0xD5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_D5int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 213
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int fun334() { return 334; }


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

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

LLVM IR (-O0):
define i32 @fun334() {
ret i32 334
}

LLVM IR (-O2):
define i32 @fun334() {
ret i32 334
}
void deInitializePlateform() {}


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

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

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

LLVM IR (-O2):
define void @deInitializePlateform() {
ret void
}
void ft_foreach(int *tab, int length, void (*f)(int)) {
  int i;
  i = -1;
  while (++i < length)
    (*f)(tab[i]);
}


x86 assembly (clang, -O0):
<ft_foreach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
cmp    -0xc(%rbp),%eax
jge    1142 <ft_foreach+0x42>
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
mov    (%rcx,%rdx,4),%edi
call   *%rax
jmp    111a <ft_foreach+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_foreach>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1130 <ft_foreach+0x30>
mov    %rdx,%r14
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   *%r14
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1120 <ft_foreach+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ft_foreach(i32* nocapture %0, i32 %1, void (i32)* nocapture %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %13
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %7
%8 = phi i64 [ 0, %5 ], [ %11, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
tail call void %2(i32 %10)
%11 = add nuw nsw i64 %8, 1
%12 = icmp eq i64 %11, %6
br i1 %12, label %13, label %7
13: ; preds = %7, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UnitTest_report();
int /*<<< orphan*/ testBackward();
int /*<<< orphan*/ testForward();
int /*<<< orphan*/ testFree();
int /*<<< orphan*/ testNew();
int main(int argc, char **argv) {
  testBackward();
  testForward();
  testFree();
  testNew();
  UnitTest_report();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <testBackward@plt>
mov    $0x0,%al
call   1040 <testForward@plt>
mov    $0x0,%al
call   1060 <testFree@plt>
mov    $0x0,%al
call   1030 <testNew@plt>
mov    $0x0,%al
call   1050 <UnitTest_report@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <testBackward@plt>
xor    %eax,%eax
call   1040 <testForward@plt>
xor    %eax,%eax
call   1060 <testFree@plt>
xor    %eax,%eax
call   1030 <testNew@plt>
xor    %eax,%eax
call   1050 <UnitTest_report@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @testBackward()
%6 = call i32 (...) @testForward()
%7 = call i32 (...) @testFree()
%8 = call i32 (...) @testNew()
%9 = call i32 (...) @UnitTest_report()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @testBackward()
%4 = tail call i32 (...) @testForward()
%5 = tail call i32 (...) @testFree()
%6 = tail call i32 (...) @testNew()
%7 = tail call i32 (...) @UnitTest_report()
ret i32 0
}
int rpl_lrint(double x) { return (int)x; }


x86 assembly (clang, -O0):
<rpl_lrint>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_lrint>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @rpl_lrint(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fptosi double %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @rpl_lrint(double %0) {
%2 = fptosi double %0 to i32
ret i32 %2
}
void DMA1_Channel4_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @DMA1_Channel4_IRQHandler() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_bzero(char *, size_t);
scalar_t__ realloc(void *, size_t);
void *do_realloc(void *ptr, size_t oldSize, size_t newSize) {
  char *newptr = (char *)realloc(ptr, newSize);
  do_bzero(newptr + oldSize, newSize - oldSize);
  ;
  return (void *)newptr;
}


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

x86 assembly (clang, -O2):
<do_realloc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdx,%rsi
call   1040 <realloc@plt>
mov    %rax,%r15
lea    (%rax,%r14,1),%rdi
sub    %r14,%rbx
mov    %rbx,%rsi
call   1030 <do_bzero@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @do_realloc(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = load i64, i64* %6
%10 = call i64 @realloc(i8* %8, i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i64, i64* %5
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i64, i64* %6
%16 = load i64, i64* %5
%17 = sub i64 %15, %16
%18 = call i32 @do_bzero(i8* %14, i64 %17)
%19 = load i8*, i8** %7
ret i8* %19
}

LLVM IR (-O2):
define i8* @do_realloc(i8* %0, i64 %1, i64 %2) {
%4 = tail call i64 @realloc(i8* %0, i64 %2)
%5 = inttoptr i64 %4 to i8*
%6 = getelementptr inbounds i8, i8* %5, i64 %1
%7 = sub i64 %2, %1
%8 = tail call i32 @do_bzero(i8* %6, i64 %7)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ *newwin(int const, int const, int const, int const);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
WINDOW *create_newwin(const int height, const int width, const int starty,
                      const int startx) {
  WINDOW *local_win;
  local_win = newwin(height, width, starty, startx);
  box(local_win, 0, 0);
  wrefresh(local_win);
  return local_win;
}


x86 assembly (clang, -O0):
<create_newwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1040 <newwin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <box@plt>
mov    -0x18(%rbp),%rdi
call   1030 <wrefresh@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_newwin>:
push   %rbx
call   1040 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <box@plt>
mov    %rbx,%rdi
call   1030 <wrefresh@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = call i32* @newwin(i32 %10, i32 %11, i32 %12, i32 %13)
store i32* %14, i32** %9
%15 = load i32*, i32** %9
%16 = call i32 @box(i32* %15, i32 0, i32 0)
%17 = load i32*, i32** %9
%18 = call i32 @wrefresh(i32* %17)
%19 = load i32*, i32** %9
ret i32* %19
}

LLVM IR (-O2):
define i32* @create_newwin(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32* @newwin(i32 %0, i32 %1, i32 %2, i32 %3)
%6 = tail call i32 @box(i32* %5, i32 0, i32 0)
%7 = tail call i32 @wrefresh(i32* %5)
ret i32* %5
}
void XCheckIfEvent() {}


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

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

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

LLVM IR (-O2):
define void @XCheckIfEvent() {
ret void
}
/* Variables and functions */
int z_arc_v2_aux_reg_read(int);
int /*<<< orphan*/ z_arc_v2_aux_reg_write(int, int);
void arc_core_mpu_disable(void) {
  z_arc_v2_aux_reg_write((0x409),
                         z_arc_v2_aux_reg_read((0x409)) & (0xBFFFFFFF));
}


x86 assembly (clang, -O0):
<arc_core_mpu_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x409,%edi
call   1040 <z_arc_v2_aux_reg_read@plt>
mov    %eax,%esi
and    $0xbfffffff,%esi
mov    $0x409,%edi
call   1030 <z_arc_v2_aux_reg_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arc_core_mpu_disable>:
push   %rax
mov    $0x409,%edi
call   1040 <z_arc_v2_aux_reg_read@plt>
and    $0xbfffffff,%eax
mov    $0x409,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <z_arc_v2_aux_reg_write@plt>

LLVM IR (-O0):
define void @arc_core_mpu_disable() {
%1 = call i32 @z_arc_v2_aux_reg_read(i32 1033)
%2 = and i32 %1, -1073741825
%3 = call i32 @z_arc_v2_aux_reg_write(i32 1033, i32 %2)
ret void
}

LLVM IR (-O2):
define void @arc_core_mpu_disable() {
%1 = tail call i32 @z_arc_v2_aux_reg_read(i32 1033)
%2 = and i32 %1, -1073741825
%3 = tail call i32 @z_arc_v2_aux_reg_write(i32 1033, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int sum = 0;
  int *p = &sum;
  for (int i = 0; i < 1000; i++) {
    (*p)++;
  }
  assert(sum == 1000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    115b <main+0x4b>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <main+0x25>
cmpl   $0x3e8,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32* %2, i32** %3
store i32 0, i32* %4
br label %5
5: ; preds = %12, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1000
br i1 %7, label %8, label %15
8: ; preds = %5
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
br label %12
12: ; preds = %8
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
br label %5
15: ; preds = %5
%16 = load i32, i32* %2
%17 = icmp eq i32 %16, 1000
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 1)
ret i32 0
}
float __truncdfsf2(double a __attribute__((unused))) { return 0.0; }


x86 assembly (clang, -O0):
<__truncdfsf2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__truncdfsf2>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @__truncdfsf2(double %0) {
%2 = alloca double
store double %0, double* %2
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @__truncdfsf2(double %0) {
ret float 0.000000e+00
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ca7-virtex820-m400-2 USING_OS_MEMORY=0 "
         "API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= "
         "BUILD_DATE=Fri Nov  7 15:50:52 CET 2014 BUILD=RELEASE CPU= "
         "USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 "
         "USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/mali400-pmu/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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 = [430 x i8] c"malidrv: CONFIG=ca7-virtex820-m400-2 USING_OS_MEMORY=0 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Nov 7 15:50:52 CET 2014 BUILD=RELEASE CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/mali400-pmu/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([430 x i8], [430 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [430 x i8] c"malidrv: CONFIG=ca7-virtex820-m400-2 USING_OS_MEMORY=0 API_VERSION=14 REPO_URL= REVISION= CHANGED_REVISION= CHANGE_DATE= BUILD_DATE=Fri Nov 7 15:50:52 CET 2014 BUILD=RELEASE CPU= USING_UMP=1 USING_MALI200=0 USING_MALI400=4 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/mali400-pmu/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=6 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([430 x i8], [430 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
bool nrf51_errata_52(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_52() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
scalar_t__ ftell(int /*<<< orphan*/ *);
unsigned long f_tot_size(FILE *f) {
  fseek(f, 0, SEEK_END);
  unsigned long len = (unsigned long)ftell(f);
  return len;
}


x86 assembly (clang, -O0):
<f_tot_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_tot_size>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ftell@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @f_tot_size(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i64, i64* %3
ret i64 %9
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @f_tot_size(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
ret i64 %4
}
/* Variables and functions */
int ArgNum();
int GetFlag(int);
int /*<<< orphan*/ SetFlag(int, int);
void Act_BitClear(void) {
  int v = ArgNum();
  int x = ArgNum();
  SetFlag(v, GetFlag(v) & ~(1 << x));
}


x86 assembly (clang, -O0):
<Act_BitClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ArgNum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <GetFlag@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    %eax,%esi
call   1030 <SetFlag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_BitClear>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <ArgNum@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <GetFlag@plt>
btr    %ebp,%eax
mov    %ebx,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <SetFlag@plt>

LLVM IR (-O0):
define void @Act_BitClear() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @ArgNum()
store i32 %3, i32* %1
%4 = call i32 (...) @ArgNum()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @GetFlag(i32 %6)
%8 = load i32, i32* %2
%9 = shl i32 1, %8
%10 = xor i32 %9, -1
%11 = and i32 %7, %10
%12 = call i32 @SetFlag(i32 %5, i32 %11)
ret void
}

LLVM IR (-O2):
define void @Act_BitClear() {
%1 = tail call i32 (...) @ArgNum()
%2 = tail call i32 (...) @ArgNum()
%3 = tail call i32 @GetFlag(i32 %1)
%4 = shl nuw i32 1, %2
%5 = xor i32 %4, -1
%6 = and i32 %3, %5
%7 = tail call i32 @SetFlag(i32 %1, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void dump_error(float error) { printf("Global error:\t%f\n", error); }


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Global error:\09%f\0A\00"
define void @dump_error(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %3)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Global error:\09%f\0A\00"
define void @dump_error(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}
int test_imm_00int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x00 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
mov    $0xffffffd8,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_00int64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 32
%6 = and i64 %5, 0
%7 = icmp ne i64 %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_00int64_highword_mem(i64* nocapture readnone %0) {
ret i32 -40
}
float min(float a, float b) {
  if (a < b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1130 <min+0x30>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113a <min+0x3a>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %0, float %1
ret float %4
}
/* Variables and functions */
int remove(char *);
int ILibFileDir_DeleteFile(char *FileName) { return (remove(FileName)); }


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

x86 assembly (clang, -O2):
<ILibFileDir_DeleteFile>:
jmp    1030 <remove@plt>

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

LLVM IR (-O2):
define i32 @ILibFileDir_DeleteFile(i8* nocapture %0) {
%2 = tail call i32 @remove(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int x(int);
int main() {
  if (x(1000) != 1000)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1040 <x@plt>
cmp    $0x3e8,%eax
je     115b <main+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3e8,%edi
call   1040 <x@plt>
cmp    $0x3e8,%eax
jne    1149 <main+0x19>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @x(i32 1000)
%3 = icmp ne i32 %2, 1000
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @x(i32 1000)
%2 = icmp eq i32 %1, 1000
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int byaj(int, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int p = 10, r = 5, t = 1;
  printf("%d\n", byaj(p, r, t));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <byaj@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x5,%esi
mov    $0x1,%edx
call   1040 <byaj@plt>
lea    0xec4(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @byaj(i32 10, i32 5, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int test_imm_EEint16_reg(short val) {
  return ((val) & (0xEE << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EEint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xee,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_EEint16_reg(i16 signext %0) {
%2 = and i16 %0, 238
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_idxset_rrobin() {
  printf("NOT IMPLEMENTED:"
         "pa_idxset_rrobin"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_idxset_rrobin\00"
define i32 @pa_idxset_rrobin() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int PMPI_Get_processor_name(char *, int *);
int MPI_Get_processor_name(char *name, int *resultlen) {
  ;
  return PMPI_Get_processor_name(name, resultlen);
}


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

x86 assembly (clang, -O2):
<MPI_Get_processor_name>:
jmp    1030 <PMPI_Get_processor_name@plt>

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

LLVM IR (-O2):
define i32 @MPI_Get_processor_name(i8* %0, i32* %1) {
%3 = tail call i32 @PMPI_Get_processor_name(i8* %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ buf_init();
void b_init(void) { buf_init(); }


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

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

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

LLVM IR (-O2):
define void @b_init() {
%1 = tail call i32 (...) @buf_init()
ret void
}
int pacman_speed_fright(int level) {
  if (level == 1)
    return 90;
  if (level <= 4)
    return 95;
  if (level <= 20)
    return 100;
  return 100;
}


x86 assembly (clang, -O0):
<pacman_speed_fright>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <pacman_speed_fright+0x1d>
movl   $0x5a,-0x4(%rbp)
jmp    1150 <pacman_speed_fright+0x50>
cmpl   $0x4,-0x8(%rbp)
jg     1133 <pacman_speed_fright+0x33>
movl   $0x5f,-0x4(%rbp)
jmp    1150 <pacman_speed_fright+0x50>
cmpl   $0x14,-0x8(%rbp)
jg     1149 <pacman_speed_fright+0x49>
movl   $0x64,-0x4(%rbp)
jmp    1150 <pacman_speed_fright+0x50>
movl   $0x64,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pacman_speed_fright>:
xor    %eax,%eax
cmp    $0x5,%edi
setge  %al
cmp    $0x1,%edi
lea    0x5f(%rax,%rax,4),%ecx
mov    $0x5a,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @pacman_speed_fright(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 90, i32* %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp sle i32 %8, 4
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 95, i32* %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp sle i32 %12, 20
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 100, i32* %2
br label %16
15: ; preds = %11
store i32 100, i32* %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @pacman_speed_fright(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = icmp slt i32 %0, 5
%4 = select i1 %3, i32 95, i32 100
%5 = select i1 %2, i32 90, i32 %4
ret i32 %5
}
void main() {
  unsigned int val = 0;
  (*(volatile unsigned int *)(0x44e000AC) = (0x02));
  val = (*(volatile unsigned int *)(0x4804C134));
  val &= ~(0xF << 21);
  (*(volatile unsigned int *)(0x4804C134) = (val));
  (*(volatile unsigned int *)(0x4804C190) = (0x0F << 21));
  (*(volatile unsigned int *)(0x4804C194) = (0x01 << 24));
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x44e000ac,%eax
movl   $0x2,(%rax)
mov    $0x4804c134,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfe1fffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x4804c134,%eax
mov    %ecx,(%rax)
mov    $0x4804c190,%eax
movl   $0x1e00000,(%rax)
mov    $0x4804c194,%eax
movl   $0x1000000,(%rax)
jmp    114b <main+0x4b>

x86 assembly (clang, -O2):
<main>:
movl   $0x2,0x44e000ac
andl   $0xfe1fffff,0x4804c134
ff ff 1f fe
movl   $0x1e00000,0x4804c190
movl   $0x1000000,0x4804c194
nopl   0x0(%rax)
jmp    1130 <main+0x30>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
store i32 0, i32* %1
store volatile i32 2, i32* inttoptr (i64 1155530924 to i32*)
%2 = load volatile i32, i32* inttoptr (i64 1208271156 to i32*)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, -31457281
store i32 %4, i32* %1
%5 = load i32, i32* %1
store volatile i32 %5, i32* inttoptr (i64 1208271156 to i32*)
store volatile i32 31457280, i32* inttoptr (i64 1208271248 to i32*)
store volatile i32 16777216, i32* inttoptr (i64 1208271252 to i32*)
br label %6
6: ; preds = %0, %6
br label %6
}

LLVM IR (-O2):
define void @main() {
store volatile i32 2, i32* inttoptr (i64 1155530924 to i32*)
%1 = load volatile i32, i32* inttoptr (i64 1208271156 to i32*)
%2 = and i32 %1, -31457281
store volatile i32 %2, i32* inttoptr (i64 1208271156 to i32*)
store volatile i32 31457280, i32* inttoptr (i64 1208271248 to i32*)
store volatile i32 16777216, i32* inttoptr (i64 1208271252 to i32*)
br label %3
3: ; preds = %3, %0
br label %3
}
/* Type definitions */
struct addrinfo {
  struct addrinfo *ai_addr;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct addrinfo *);
void freeaddrinfo(struct addrinfo *res) {
  free(res->ai_addr);
  free(res);
}


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

x86 assembly (clang, -O2):
<freeaddrinfo>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.addrinfo = type { %struct.addrinfo* }
define void @freeaddrinfo(%struct.addrinfo* %0) {
%2 = alloca %struct.addrinfo*
store %struct.addrinfo* %0, %struct.addrinfo** %2
%3 = load %struct.addrinfo*, %struct.addrinfo** %2
%4 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i32 0, i32 0
%5 = load %struct.addrinfo*, %struct.addrinfo** %4
%6 = call i32 @free(%struct.addrinfo* %5)
%7 = load %struct.addrinfo*, %struct.addrinfo** %2
%8 = call i32 @free(%struct.addrinfo* %7)
ret void
}

LLVM IR (-O2):
%struct.addrinfo = type { %struct.addrinfo* }
define void @freeaddrinfo(%struct.addrinfo* nocapture %0) {
%2 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %0, i64 0, i32 0
%3 = load %struct.addrinfo*, %struct.addrinfo** %2
%4 = tail call i32 @free(%struct.addrinfo* %3)
%5 = tail call i32 @free(%struct.addrinfo* %0)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void AnsiTerm_fg24_set(uint8_t r, uint8_t g, uint8_t b) {
  printf("\x1B[38;2;%d;%d;%dm", r, g, b);
}


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

x86 assembly (clang, -O2):
<AnsiTerm_fg24_set>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"\1B[38;2;%d;%d;%dm\00"
define void @AnsiTerm_fg24_set(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"\1B[38;2;%d;%d;%dm\00"
define void @AnsiTerm_fg24_set(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
ret void
}