xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int _is_file(const char *path) {
  struct stat st;
  if (stat(path, &st) != 0)
    return 0;
  return S_ISREG(st.st_mode);
}


x86 assembly (clang, -O0):
<_is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
je     114f <_is_file+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <_is_file+0x3a>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_is_file>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <_is_file+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @_is_file(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ out52(char);
int /*<<< orphan*/ write(int, char *, int);
void out52nn(char c, char n, char m) {
  out52(c);
  write(1, &n, 1);
  write(1, &m, 1);
}


x86 assembly (clang, -O0):
<out52nn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <out52@plt>
mov    $0x1,%edx
lea    -0x2(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    $0x1,%edx
lea    -0x3(%rbp),%rsi
mov    %edx,%edi
call   1040 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out52nn>:
push   %rax
mov    %sil,0x7(%rsp)
mov    %dl,0x6(%rsp)
call   1030 <out52@plt>
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1040 <write@plt>
lea    0x6(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1040 <write@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @out52nn(i8 signext %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8
%5 = alloca i8
store i8 %1, i8* %4
store i8 %2, i8* %5
%6 = tail call i32 @out52(i8 signext %0)
%7 = call i32 @write(i32 1, i8* %4, i32 1)
%8 = call i32 @write(i32 1, i8* %5, i32 1)
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int rand();
int random_at_most(int max) {
  unsigned int num_bins = (unsigned int)max + 1,
               num_rand = (unsigned int)RAND_MAX + 1,
               bin_size = num_rand / num_bins, defect = num_rand % num_bins;
  int x;
  do {
    x = rand();
  } while (num_rand - defect <= (unsigned int)x);
  return x / bin_size;
}


x86 assembly (clang, -O0):
<random_at_most>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%rax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jbe    114a <random_at_most+0x3a>
mov    -0x18(%rbp),%eax
xor    %edx,%edx
divl   -0x10(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_at_most>:
push   %rbp
push   %rbx
push   %rax
add    $0x1,%edi
mov    0x2ecb(%rip),%rax
mov    (%rax),%ebx
add    $0x1,%ebx
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
mov    %eax,%ebp
sub    %edx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
cmp    %eax,%ebx
jbe    1130 <random_at_most+0x20>
xor    %edx,%edx
div    %ebp
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i32 @random_at_most(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %2
%8 = load i32, i32* %2
%9 = add i32 %8, 1
store i32 %9, i32* %3
%10 = load i64, i64* @RAND_MAX
%11 = trunc i64 %10 to i32
%12 = add i32 %11, 1
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = udiv i32 %13, %14
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = load i32, i32* %3
%18 = urem i32 %16, %17
store i32 %18, i32* %6
br label %19
19: ; preds = %21, %1
%20 = call i32 (...) @rand()
store i32 %20, i32* %7
br label %21
21: ; preds = %19
%22 = load i32, i32* %4
%23 = load i32, i32* %6
%24 = sub i32 %22, %23
%25 = load i32, i32* %7
%26 = icmp ule i32 %24, %25
br i1 %26, label %19, label %27
27: ; preds = %21
%28 = load i32, i32* %7
%29 = load i32, i32* %5
%30 = udiv i32 %28, %29
ret i32 %30
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i32 @random_at_most(i32 %0) {
%2 = add i32 %0, 1
%3 = load i64, i64* @RAND_MAX
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = urem i32 %5, %2
%7 = udiv i32 %5, %2
%8 = sub i32 %5, %6
br label %9
9: ; preds = %9, %1
%10 = tail call i32 (...) @rand()
%11 = icmp ugt i32 %8, %10
br i1 %11, label %12, label %9
12: ; preds = %9
%13 = udiv i32 %10, %7
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xad() {
  Assert_real((isxdigit(173) == 0),
              "/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_isxdigit.c",
              870, ("isxdigit should be 0 for 0xad"));
}


x86 assembly (clang, -O0):
<t_isxdigit_0xad>:
push   %rbp
mov    %rsp,%rbp
mov    $0xad,%edi
call   1030 <isxdigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x366,%edx
lea    0xf5c(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isxdigit_0xad>:
push   %rax
mov    $0xad,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x366,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xad\00"
define void @t_isxdigit_0xad() {
%1 = call i64 @isxdigit(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xad\00"
define void @t_isxdigit_0xad() {
%1 = tail call i64 @isxdigit(i32 173)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 870, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double errorBase(double, double, double, double);
double errorDiv(double A, double errorA, double B, double errorB) {
  return errorBase(A, errorA, B, errorB) * (A / B);
}


x86 assembly (clang, -O0):
<errorDiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
call   1030 <errorBase@plt>
movsd  -0x8(%rbp),%xmm1
divsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<errorDiv>:
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
call   1030 <errorBase@plt>
movsd  0x10(%rsp),%xmm1
divsd  0x8(%rsp),%xmm1
mulsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @errorDiv(double %0, double %1, double %2, double %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load double, double* %5
%10 = load double, double* %6
%11 = load double, double* %7
%12 = load double, double* %8
%13 = call double @errorBase(double %9, double %10, double %11, double %12)
%14 = load double, double* %5
%15 = load double, double* %7
%16 = fdiv double %14, %15
%17 = fmul double %13, %16
ret double %17
}

LLVM IR (-O2):
define double @errorDiv(double %0, double %1, double %2, double %3) {
%5 = tail call double @errorBase(double %0, double %1, double %2, double %3)
%6 = fdiv double %0, %2
%7 = fmul double %6, %5
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ nand_cmd(int);
int /*<<< orphan*/ printf_str(char *);
unsigned char nand_read_status() {
  char status = 0x00;
  nand_cmd(0x70);
  status = *((volatile unsigned char *)0x70200010);
  if ((status & 0x01) == 0x01) {
    printf_str("\r\nNand Command FAIL");
  } else {
    printf_str("\r\nNand Command OK");
  }
  return status;
}


x86 assembly (clang, -O0):
<nand_read_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
mov    $0x70,%edi
call   1030 <nand_cmd@plt>
mov    $0x70200010,%eax
mov    (%rax),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    1161 <nand_read_status+0x41>
lea    0xea9(%rip),%rdi
call   1040 <printf_str@plt>
jmp    116d <nand_read_status+0x4d>
lea    0xeac(%rip),%rdi
call   1040 <printf_str@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nand_read_status>:
push   %rbx
mov    $0x70,%edi
call   1030 <nand_cmd@plt>
mov    0x70200010,%bl
test   $0x1,%bl
lea    0xed8(%rip),%rax
lea    0xebd(%rip),%rdi
cmove  %rax,%rdi
call   1040 <printf_str@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0D\0ANand Command FAIL\00"
@.str.1 = [18 x i8] c"\0D\0ANand Command OK\00"
define zeroext i8 @nand_read_status() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @nand_cmd(i32 112)
%3 = load volatile i8, i8* inttoptr (i64 1881145360 to i8*)
store i8 %3, i8* %1
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf_str(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf_str(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
%13 = load i8, i8* %1
ret i8 %13
}

LLVM IR (-O2):
@.str = [20 x i8] c"\0D\0ANand Command FAIL\00"
@.str.1 = [18 x i8] c"\0D\0ANand Command OK\00"
define zeroext i8 @nand_read_status() {
%1 = tail call i32 @nand_cmd(i32 112)
%2 = load volatile i8, i8* inttoptr (i64 1881145360 to i8*)
%3 = and i8 %2, 1
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0)
%6 = tail call i32 @printf_str(i8* %5)
ret i8 %2
}
/* Variables and functions */
double funcLenDbl(double const *);
int /*<<< orphan*/ sprintf(char *, char *, double, double const);
void funcDbl2Char(const double *pdD, const int *piLenD, char *pcD) {
  sprintf(pcD, "%.*g", funcLenDbl(pdD), *pdD);
  pcD[*piLenD] = '\0';
}


x86 assembly (clang, -O0):
<funcDbl2Char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <funcLenDbl@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
lea    0xea8(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcDbl2Char>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <funcLenDbl@plt>
movsd  (%rbx),%xmm1
lea    0xec2(%rip),%rsi
mov    %r15,%rdi
call   1040 <sprintf@plt>
movslq (%r14),%rax
movb   $0x0,(%r15,%rax,1)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.*g\00"
define void @funcDbl2Char(double* %0, i32* %1, i8* %2) {
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i8*
store double* %0, double** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load double*, double** %4
%9 = call double @funcLenDbl(double* %8)
%10 = load double*, double** %4
%11 = load double, double* %10
%12 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %9, double %11)
%13 = load i8*, i8** %6
%14 = load i32*, i32** %5
%15 = load i32, i32* %14
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.*g\00"
define void @funcDbl2Char(double* %0, i32* nocapture %1, i8* nocapture writeonly %2) {
%4 = tail call double @funcLenDbl(double* %0)
%5 = load double, double* %0
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %4, double %5)
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %2, i64 %8
store i8 0, i8* %9
ret void
}
/* Variables and functions */
int f436(int *);
int f437(int *p) { return f436(p); }


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

x86 assembly (clang, -O2):
<f437>:
jmp    1030 <f436@plt>

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

LLVM IR (-O2):
define i32 @f437(i32* %0) {
%2 = tail call i32 @f436(i32* %0)
ret i32 %2
}
void foobar(void) {}


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

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

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

LLVM IR (-O2):
define void @foobar() {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ leblanc_apply(int, char **);
int main(int argc, char **argv) {
  leblanc_apply(argc, argv);
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
call   1030 <leblanc_apply@plt>
mov    0x2ec3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 = load i8**, i8*** %5
%8 = call i32 @leblanc_apply(i32 %6, i8** %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @leblanc_apply(i32 %0, i8** %1)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void usage(FILE *stream) {
  fprintf(stream, "Usage: fileops [file] [text-to-write] ...\n");
  fprintf(stream, "Write text to a file.\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xef4(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    $0x2a,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fwrite@plt>
lea    0xef7(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Usage: fileops [file] [text-to-write] ...\0A\00"
@.str.1 = [23 x i8] c"Write text to a file.\0A\00"
define void @usage(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"Usage: fileops [file] [text-to-write] ...\0A\00"
@.str.1 = [23 x i8] c"Write text to a file.\0A\00"
define void @usage(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i64 42, i64 1, i32* %0)
%3 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i64 22, i64 1, i32* %0)
ret void
}
int leaps_thru_end_of(const int y) {
  return (y >= 0) ? (y / 4 - y / 100 + y / 400)
                  : -(leaps_thru_end_of(-(y + 1)) + 1);
}


x86 assembly (clang, -O0):
<leaps_thru_end_of>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1162 <leaps_thru_end_of+0x52>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    117d <leaps_thru_end_of+0x6d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
xor    %edi,%edi
sub    %eax,%edi
call   1030 <leaps_thru_end_of@plt>
mov    %eax,%ecx
add    $0x1,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leaps_thru_end_of>:
xor    %ecx,%ecx
test   %edi,%edi
js     110a <leaps_thru_end_of+0xa>
mov    %edi,%edx
jmp    111a <leaps_thru_end_of+0x1a>
xor    %ecx,%ecx
mov    %edi,%edx
xchg   %ax,%ax
not    %edx
not    %ecx
test   %edi,%edi
mov    %edx,%edi
jns    1110 <leaps_thru_end_of+0x10>
mov    %edx,%eax
shr    $0x2,%edx
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rsi
shr    $0x25,%rsi
sub    %esi,%edx
shr    $0x27,%rax
add    %edx,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @leaps_thru_end_of(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = sdiv i32 %6, 4
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 100
%10 = sub nsw i32 %7, %9
%11 = load i32, i32* %2
%12 = sdiv i32 %11, 400
%13 = add nsw i32 %10, %12
br label %21
14: ; preds = %1
%15 = load i32, i32* %2
%16 = add nsw i32 %15, 1
%17 = sub nsw i32 0, %16
%18 = call i32 @leaps_thru_end_of(i32 %17)
%19 = add nsw i32 %18, 1
%20 = sub nsw i32 0, %19
br label %21
21: ; preds = %14, %5
%22 = phi i32 [ %13, %5 ], [ %20, %14 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @leaps_thru_end_of(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %12
3: ; preds = %12, %1
%4 = phi i32 [ 0, %1 ], [ %16, %12 ]
%5 = phi i32 [ %0, %1 ], [ %15, %12 ]
%6 = lshr i32 %5, 2
%7 = udiv i32 %5, 100
%8 = sub nsw i32 %6, %7
%9 = udiv i32 %5, 400
%10 = add nsw i32 %8, %9
%11 = xor i32 %10, %4
ret i32 %11
12: ; preds = %1, %12
%13 = phi i32 [ %15, %12 ], [ %0, %1 ]
%14 = phi i32 [ %16, %12 ], [ 0, %1 ]
%15 = xor i32 %13, -1
%16 = xor i32 %14, -1
%17 = icmp slt i32 %13, 0
br i1 %17, label %3, label %12
}
void BOARD_InitDebugConsole(void) {}


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

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

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

LLVM IR (-O2):
define void @BOARD_InitDebugConsole() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hcs08_enable_interrupt();
void __nesc_enable_interrupt() { hcs08_enable_interrupt(); }


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

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

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

LLVM IR (-O2):
define void @__nesc_enable_interrupt() {
%1 = tail call i32 (...) @hcs08_enable_interrupt()
ret void
}
void TestAngle(void) {
  (void)0;
  (void)0;
  (void)0;
  (void)0;
}


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

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

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

LLVM IR (-O2):
define void @TestAngle() {
ret void
}
int _plnorm(double x) { return ((int)(10.0 * x + 0.5)); }


x86 assembly (clang, -O0):
<_plnorm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_plnorm>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @_plnorm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double 1.000000e+01, double %3, double 5.000000e-01)
%5 = fptosi double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @_plnorm(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 1.000000e+01, double 5.000000e-01)
%3 = fptosi double %2 to i32
ret i32 %3
}
/* Variables and functions */
int fac(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
main() {
  int m, n, res;
  printf("please input two number: m,n\n");
  scanf("%d%d", &m, &n);
  res = fac(m, n);
  printf("%d的%d次方为%d\n", m, n, res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <fac@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1040 <fac@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
lea    0xe8a(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"please input two number: m,n\0A\00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [20 x i8] c"%d\E7\9A\84%d\E6\AC\A1\E6\96\B9\E4\B8\BA%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = call i32 @fac(i32 %6, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [20 x i8] c"%d\E7\9A\84%d\E6\AC\A1\E6\96\B9\E4\B8\BA%d\0A\00"
@str = [29 x i8] c"please input two number: m,n\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @fac(i32 %7, i32 %8)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %10, i32 %11, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void main() {
  int num = 1;
  double outcome = 1;
  double sum = 0;
  while (num <= 20) {
    outcome = outcome * num;
    sum = sum + outcome;
    num++;
  }
  printf("%f\n", sum);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x14,-0x4(%rbp)
jg     116e <main+0x5e>
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1134 <main+0x24>
movsd  -0x18(%rbp),%xmm0
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xef1(%rip),%rdi
movsd  0xee1(%rip),%xmm0
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 1, i32* %1
store double 1.000000e+00, double* %2
store double 0.000000e+00, double* %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 20
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = load double, double* %2
%9 = load i32, i32* %1
%10 = sitofp i32 %9 to double
%11 = fmul double %8, %10
store double %11, double* %2
%12 = load double, double* %3
%13 = load double, double* %2
%14 = fadd double %12, %13
store double %14, double* %3
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %4
17: ; preds = %4
%18 = load double, double* %3
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %18)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x43C1C5D4E487FCFD)
ret void
}
/* Variables and functions */
int XXH_main(int, char const **);
int main(int argc, const char *argv[]) { return XXH_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <XXH_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @XXH_main(i32 %0, i8** %1)
ret i32 %3
}
void prebuilt_func_F() {}


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

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

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

LLVM IR (-O2):
define void @prebuilt_func_F() {
ret void
}
const char *dns_version(void) { return "0.0.9"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"0.0.9\00"
define i8* @dns_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"0.0.9\00"
define i8* @dns_version() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
bool overlapping(float minA, float maxA, float minB, float maxB) {
  return minB <= maxA && minA <= maxB;
}


x86 assembly (clang, -O0):
<overlapping>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
xor    %eax,%eax
ucomiss %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jb     1143 <overlapping+0x43>
movss  -0x4(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<overlapping>:
ucomiss %xmm2,%xmm1
setae  %al
ucomiss %xmm0,%xmm3
setae  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @overlapping(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %6
%11 = fcmp ole float %9, %10
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load float, float* %5
%14 = load float, float* %8
%15 = fcmp ole float %13, %14
br label %16
16: ; preds = %12, %4
%17 = phi i1 [ false, %4 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @overlapping(float %0, float %1, float %2, float %3) {
%5 = fcmp ole float %2, %1
%6 = fcmp ole float %0, %3
%7 = and i1 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void returnVoid() {}


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

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

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

LLVM IR (-O2):
define void @returnVoid() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(int, unsigned int);
void fput_long(long d, unsigned handle) {
  int low, high;
  long l = d;
  low = l & 0xffffffffu;
  high = l >> 32;
  fputc(low, handle);
  fputc(high, handle);
}


x86 assembly (clang, -O0):
<fput_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movabs $0xffffffff,%rax
and    -0x20(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
sar    $0x20,%rax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fputc@plt>
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <fputc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput_long>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
shr    $0x20,%rbx
call   1030 <fputc@plt>
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @fput_long(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%8 = load i64, i64* %3
store i64 %8, i64* %7
%9 = load i64, i64* %7
%10 = and i64 %9, 4294967295
%11 = trunc i64 %10 to i32
store i32 %11, i32* %5
%12 = load i64, i64* %7
%13 = ashr i64 %12, 32
%14 = trunc i64 %13 to i32
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = load i32, i32* %4
%17 = call i32 @fputc(i32 %15, i32 %16)
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = call i32 @fputc(i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
define void @fput_long(i64 %0, i32 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i64 %0, 32
%5 = trunc i64 %4 to i32
%6 = tail call i32 @fputc(i32 %3, i32 %1)
%7 = tail call i32 @fputc(i32 %5, i32 %1)
ret void
}
int test_imm_77uint16_mem(unsigned short *val) {
  return ((*val) & (-0x77 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_77uint16_mem>:
movzwl (%rdi),%eax
test   $0xff89,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_77uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -119
%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_77uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -119
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned long int redondear_a_potencia_2(unsigned long int valor) {
  unsigned long int i = 1;
  while (i < valor)
    i *= 2;
  return i;
}


x86 assembly (clang, -O0):
<redondear_a_potencia_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    112f <redondear_a_potencia_2+0x2f>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <redondear_a_potencia_2+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<redondear_a_potencia_2>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rcx,%rax
add    %rcx,%rcx
cmp    %rdi,%rax
jb     1110 <redondear_a_potencia_2+0x10>
ret

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

LLVM IR (-O2):
define i64 @redondear_a_potencia_2(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 1, %1 ], [ %5, %2 ]
%4 = icmp ult i64 %3, %0
%5 = shl i64 %3, 1
br i1 %4, label %2, label %6
6: ; preds = %2
ret i64 %3
}
int sign(float f) {
  if (f > 0)
    return 1;
  else
    return f == 0 ? 0 : -1;
}


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1126 <sign+0x26>
movl   $0x1,-0x4(%rbp)
jmp    1148 <sign+0x48>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
mov    $0xffffffff,%eax
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
setnp  %sil
sete   %dl
test   %sil,%dl
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
cmpneqss %xmm1,%xmm0
movd   %xmm0,%ecx
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sign(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ogt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp oeq float %8, 0.000000e+00
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sign(float %0) {
%2 = fcmp ogt float %0, 0.000000e+00
%3 = fcmp une float %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
int bar(int x, int b) {
  int cst;
  if (b)
    cst = 0x7fffffff;
  else
    cst = 0x7fffffff - 1;
  x = x & cst;
  if (x < 0)
    return 12345;
  return x;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1120 <bar+0x20>
movl   $0x7fffffff,-0x10(%rbp)
jmp    1127 <bar+0x27>
movl   $0x7ffffffe,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1146 <bar+0x46>
movl   $0x3039,-0x4(%rbp)
jmp    114c <bar+0x4c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
cmp    $0x1,%esi
mov    $0x7fffffff,%eax
sbb    $0x0,%eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @bar(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 2147483647, i32* %6
br label %11
10: ; preds = %2
store i32 2147483646, i32* %6
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = and i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %11
store i32 12345, i32* %3
br label %20
18: ; preds = %11
%19 = load i32, i32* %4
store i32 %19, i32* %3
br label %20
20: ; preds = %18, %17
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @bar(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 2147483646, i32 2147483647
%5 = and i32 %4, %0
ret i32 %5
}
/* Type definitions */
union bpf_attr {
  int target_fd;
  int attach_bpf_fd;
  int attach_type;
};
typedef enum bpf_attach_type {
  ____Placeholder_bpf_attach_type
} bpf_attach_type;
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_PROG_ATTACH;
int /*<<< orphan*/ __NR_bpf;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_prog_attach(int prog_fd, int target_fd, enum bpf_attach_type type) {
  union bpf_attr attr = {
      .target_fd = target_fd,
      .attach_bpf_fd = prog_fd,
      .attach_type = type,
  };
  return syscall(__NR_bpf, BPF_PROG_ATTACH, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_prog_attach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_prog_attach>:
push   %rax
mov    %edx,(%rsp)
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_PROG_ATTACH = global i32 0
define i32 @bpf_prog_attach(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = bitcast %union.bpf_attr* %7 to i32*
%9 = load i32, i32* %6
store i32 %9, i32* %8
%10 = load i32, i32* @__NR_bpf
%11 = load i32, i32* @BPF_PROG_ATTACH
%12 = call i32 @syscall(i32 %10, i32 %11, %union.bpf_attr* %7, i32 4)
ret i32 %12
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_PROG_ATTACH = global i32 0
define i32 @bpf_prog_attach(i32 %0, i32 %1, i32 %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
store i32 %2, i32* %6
%7 = load i32, i32* @__NR_bpf
%8 = load i32, i32* @BPF_PROG_ATTACH
%9 = call i32 @syscall(i32 %7, i32 %8, %union.bpf_attr* %4, i32 4)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void printScalarConversionError() {
  fprintf(stderr,
          "Could not convert a given mult to float (see -h for usage)\n");
}


x86 assembly (clang, -O0):
<printScalarConversionError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<printScalarConversionError>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"Could not convert a given mult to float (see -h for usage)\0A\00"
define void @printScalarConversionError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"Could not convert a given mult to float (see -h for usage)\0A\00"
define void @printScalarConversionError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t big_to_little(uint32_t big) {
  uint32_t little;
  little = (((big & 0xff000000) >> 24) | ((big & 0x00ff0000) >> 8) |
            ((big & 0x0000ff00) << 8) | ((big & 0x000000ff) << 24));
  return little;
}


x86 assembly (clang, -O0):
<big_to_little>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @big_to_little(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, -16777216
%6 = lshr i32 %5, 24
%7 = load i32, i32* %2
%8 = and i32 %7, 16711680
%9 = ashr i32 %8, 8
%10 = or i32 %6, %9
%11 = load i32, i32* %2
%12 = and i32 %11, 65280
%13 = shl i32 %12, 8
%14 = or i32 %10, %13
%15 = load i32, i32* %2
%16 = and i32 %15, 255
%17 = shl i32 %16, 24
%18 = or i32 %14, %17
store i32 %18, i32* %3
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @big_to_little(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
void rul__dbg_enable_control_y() {}


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

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

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

LLVM IR (-O2):
define void @rul__dbg_enable_control_y() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void perror(const char *s) {
  fprintf(stderr, "%s:%s", s, strerror(errno));
  fflush(stderr);
}


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    %rax,%rcx
lea    0xe91(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x2ea2(%rip),%r14
mov    (%r14),%ebp
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeaa(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1030 <fprintf@plt>
mov    (%r14),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [6 x i8] c"%s:%s\00"
@errno = global i32 0
define void @perror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = load i32, i32* @errno
%6 = call i8* @strerror(i32 %5)
%7 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 @fflush(i32 %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [6 x i8] c"%s:%s\00"
@errno = global i32 0
define void @perror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = load i32, i32* @errno
%4 = tail call i8* @strerror(i32 %3)
%5 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %4)
%6 = load i32, i32* @stderr
%7 = tail call i32 @fflush(i32 %6)
ret void
}
/* Variables and functions */
void *mag_malloc(size_t);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *mag_mallocz(size_t size) {
  void *ptr = mag_malloc(size);
  if (ptr)
    memset(ptr, 0, size);
  return ptr;
}


x86 assembly (clang, -O0):
<mag_mallocz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <mag_malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1153 <mag_mallocz+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mag_mallocz>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <mag_malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <mag_mallocz+0x21>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @mag_mallocz(i64 %0) {
%2 = tail call i8* @mag_malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @memset(i8* %2, i32 0, i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
char *fcvtbuf(double value, int ndigits, int *decpt, int *sign, char *buf) {}


x86 assembly (clang, -O0):
<fcvtbuf>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @fcvtbuf(double %0, i32 %1, i32* %2, i32* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca double
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
store double %0, double* %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i8* %4, i8** %11
%12 = load i8*, i8** %6
ret i8* %12
}

LLVM IR (-O2):
define noalias i8* @fcvtbuf(double %0, i32 %1, i32* nocapture readnone %2, i32* nocapture readnone %3, i8* nocapture readnone %4) {
ret i8* undef
}