xunge/DecIR huggingface dataset:
/* Variables and functions */
int ex_large_model(int);
int EXLGMD(int *idexo) { return (ex_large_model(*idexo)); }


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

x86 assembly (clang, -O2):
<EXLGMD>:
mov    (%rdi),%edi
jmp    1030 <ex_large_model@plt>

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

LLVM IR (-O2):
define i32 @EXLGMD(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @ex_large_model(i32 %2)
ret i32 %3
}
/* Variables and functions */
int mySqrt(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", mySqrt(2147395599));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7ffea80f,%edi
call   1030 <mySqrt@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7ffea80f,%edi
call   1030 <mySqrt@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1040 <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
store i32 0, i32* %1
%2 = call i32 @mySqrt(i32 2147395599)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @mySqrt(i32 2147395599)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void endCurses() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @endCurses() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int aml_m6tvd_sec_boot_check(unsigned char *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/);
int aml_sec_boot_check(unsigned char *pSRC) {
  return aml_m6tvd_sec_boot_check(pSRC, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<aml_sec_boot_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %r8d,%r8d
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
call   1030 <aml_m6tvd_sec_boot_check@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aml_sec_boot_check>:
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
jmp    1030 <aml_m6tvd_sec_boot_check@plt>

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

LLVM IR (-O2):
define i32 @aml_sec_boot_check(i8* %0) {
%2 = tail call i32 @aml_m6tvd_sec_boot_check(i8* %0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}
/* Variables and functions */
double rand_double();
double rand_between(double min, double max) {
  return min + (rand_double() * (max - min));
}


x86 assembly (clang, -O0):
<rand_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x0,%al
call   1030 <rand_double@plt>
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_between>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand_double@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @rand_between(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double (...) @rand_double()
%7 = load double, double* %4
%8 = load double, double* %3
%9 = fsub double %7, %8
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double %5)
ret double %10
}

LLVM IR (-O2):
define double @rand_between(double %0, double %1) {
%3 = tail call double (...) @rand_double()
%4 = fsub double %1, %0
%5 = tail call double @llvm.fmuladd.f64(double %3, double %4, double %0)
ret double %5
}
/* Variables and functions */
int do_rand(unsigned long *);
__attribute__((weak)) int rand_r(unsigned int *ctx) {
  unsigned long val = (unsigned long)*ctx;
  int r = do_rand(&val);
  *ctx = (unsigned int)val;
  return (r);
}


x86 assembly (clang, -O0):
<rand_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <do_rand@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_r>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%eax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <do_rand@plt>
mov    0x8(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define weak i32 @rand_r(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = zext i32 %6 to i64
store i64 %7, i64* %3
%8 = call i32 @do_rand(i64* %3)
store i32 %8, i32* %4
%9 = load i64, i64* %3
%10 = trunc i64 %9 to i32
%11 = load i32*, i32** %2
store i32 %10, i32* %11
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
define weak i32 @rand_r(i32* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = load i32, i32* %0
%5 = zext i32 %4 to i64
store i64 %5, i64* %2
%6 = call i32 @do_rand(i64* %2)
%7 = load i64, i64* %2
%8 = trunc i64 %7 to i32
store i32 %8, i32* %0
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main(void) {
  int squareS = 0;
  int sqNumS = 0;
  for (int i = 1; i < 101; i++) {
    squareS += i;
    sqNumS += i * i;
  }
  squareS = squareS * squareS;
  printf("The difference is %d\n", (squareS - sqNumS));
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
cmpl   $0x65,-0x10(%rbp)
jge    1172 <main+0x52>
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
sub    -0xc(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1040 <printf@plt>
lea    0xe81(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x17ff976,%esi
call   1040 <printf@plt>
lea    0xedd(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The difference is %d\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
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 0, i32* %3
store i32 1, i32* %4
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 101
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %2
%11 = add nsw i32 %10, %9
store i32 %11, i32* %2
%12 = load i32, i32* %4
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = mul nsw i32 %21, %22
store i32 %23, i32* %2
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = sub nsw i32 %24, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"The difference is %d\0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 25164150)
%2 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
void set_16_pixel(uint8_t *buf, unsigned row_bytes, unsigned x, unsigned y,
                  unsigned value) {
  ((uint16_t *)buf)[(row_bytes / 2) * y + x] = (uint16_t)value;
}


x86 assembly (clang, -O0):
<set_16_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shr    $0x1,%ecx
imul   -0x14(%rbp),%ecx
add    -0x10(%rbp),%ecx
mov    %ecx,%ecx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_16_pixel>:
mov    %r8d,%eax
shr    %esi
imul   %ecx,%esi
add    %edx,%esi
mov    %rax,(%rdi,%rsi,8)
ret

LLVM IR (-O0):
define void @set_16_pixel(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %10
%12 = zext i32 %11 to i64
%13 = load i32*, i32** %6
%14 = bitcast i32* %13 to i64*
%15 = load i32, i32* %7
%16 = udiv i32 %15, 2
%17 = load i32, i32* %9
%18 = mul i32 %16, %17
%19 = load i32, i32* %8
%20 = add i32 %18, %19
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %14, i64 %21
store i64 %12, i64* %22
ret void
}

LLVM IR (-O2):
define void @set_16_pixel(i32* nocapture writeonly %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = zext i32 %4 to i64
%7 = bitcast i32* %0 to i64*
%8 = lshr i32 %1, 1
%9 = mul i32 %8, %3
%10 = add i32 %9, %2
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %7, i64 %11
store i64 %6, i64* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printBanner();
int /*<<< orphan*/ run();
int main() {
  printBanner();
  run();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <printBanner@plt>
mov    $0x0,%al
call   1040 <run@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <printBanner@plt>
xor    %eax,%eax
call   1040 <run@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @printBanner()
%3 = call i32 (...) @run()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @printBanner()
%2 = tail call i32 (...) @run()
ret i32 0
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *get_basename(const char *name) {
  const char *base;
  base = strrchr(name, '/');
  if (base)
    base++;
  else
    base = name;
  return base;
}


x86 assembly (clang, -O0):
<get_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <get_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <get_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
char tolower(char);
void strtolower(char *in) {
  int i;
  for (i = 0; in[i] != '\0'; i++) {
    in[i] = tolower(in[i]);
  }
}


x86 assembly (clang, -O0):
<strtolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1164 <strtolower+0x54>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <strtolower+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtolower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strtolower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strtolower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strtolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = phi i8 [ %11, %4 ], [ %2, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call signext i8 @tolower(i8 signext %6)
store i8 %8, i8* %7
%9 = add nuw i64 %5, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SYS_exit_group;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int);
int main() {
  syscall(SYS_exit_group, -1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
mov    $0xffffffff,%esi
call   1030 <syscall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@SYS_exit_group = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @SYS_exit_group
%3 = call i32 @syscall(i32 %2, i32 -1)
ret i32 0
}

LLVM IR (-O2):
@SYS_exit_group = global i32 0
define i32 @main() {
%1 = load i32, i32* @SYS_exit_group
%2 = tail call i32 @syscall(i32 %1, i32 -1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stub1(int *);
int f0(int (*fn)(int *), int *p) {
  printf("in f0 %d\n", *p);
  return (*fn)(p);
}


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

x86 assembly (clang, -O2):
<f0>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rsi),%esi
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

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

LLVM IR (-O2):
@.str = [10 x i8] c"in f0 %d\0A\00"
define i32 @f0(i32 (i32*)* nocapture %0, i32* %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 %0(i32* %1)
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t *utf8_next_symbol(uint8_t *utf8) {
  uint8_t b = *utf8;
  if (!(b & 0x80)) {
    return utf8 + 1;
  }
  while (b & 0x80) {
    b <<= 1;
    utf8++;
  }
  return utf8;
}


x86 assembly (clang, -O0):
<utf8_next_symbol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
jne    1133 <utf8_next_symbol+0x33>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    116b <utf8_next_symbol+0x6b>
jmp    1138 <utf8_next_symbol+0x38>
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1163 <utf8_next_symbol+0x63>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <utf8_next_symbol+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_next_symbol>:
mov    %rdi,%rax
mov    (%rdi),%ecx
test   $0x80,%cl
jne    1110 <utf8_next_symbol+0x10>
add    $0x4,%rax
ret
nop
lea    (%rcx,%rcx,1),%edx
add    $0x4,%rax
test   $0x40,%cl
mov    %edx,%ecx
jne    1110 <utf8_next_symbol+0x10>
ret

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

LLVM IR (-O2):
define i32* @utf8_next_symbol(i32* %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = getelementptr inbounds i32, i32* %0, i64 1
br label %14
7: ; preds = %1, %7
%8 = phi i32 [ %10, %7 ], [ %2, %1 ]
%9 = phi i32* [ %11, %7 ], [ %0, %1 ]
%10 = shl i32 %8, 1
%11 = getelementptr inbounds i32, i32* %9, i64 1
%12 = and i32 %8, 64
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %7
14: ; preds = %7, %5
%15 = phi i32* [ %6, %5 ], [ %11, %7 ]
ret i32* %15
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
#pragma omp parallel num_threads(4)
  {
    int iam = omp_get_thread_num();
    printf("init %d\n", iam);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"init %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @omp_get_thread_num()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
sub1() { printf("In sub1\n"); }


x86 assembly (clang, -O0):
<sub1>:
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):
<sub1>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [8 x i8] c"In sub1\00"
define i32 @sub1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  while (x > 0 && y > 0) {
    x = 10 * y - 2 * x;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jle    114c <main+0x3c>
cmpl   $0x0,-0xc(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    115c <main+0x4c>
jmp    1170 <main+0x60>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %4, i32* %2
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
br label %6
6: ; preds = %14, %0
%7 = load i32, i32* %2
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp sgt i32 %10, 0
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %20
14: ; preds = %12
%15 = load i32, i32* %3
%16 = mul nsw i32 10, %15
%17 = load i32, i32* %2
%18 = mul nsw i32 2, %17
%19 = sub nsw i32 %16, %18
store i32 %19, i32* %2
br label %6
20: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
void customLoop() {}


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

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

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

LLVM IR (-O2):
define void @customLoop() {
ret void
}
void av_fifo_alloc_array() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_alloc_array() {
ret void
}
void rpgp_skip_newline(char **p) {
  if (**p == 13) {
    (*p)++;
    if (**p == 10) {
      (*p)++;
    }
  } else if (**p == 10) {
    (*p)++;
  }
}


x86 assembly (clang, -O0):
<rpgp_skip_newline>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    114f <rpgp_skip_newline+0x4f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    114a <rpgp_skip_newline+0x4a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1175 <rpgp_skip_newline+0x75>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1170 <rpgp_skip_newline+0x70>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1175 <rpgp_skip_newline+0x75>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpgp_skip_newline>:
mov    (%rdi),%rax
mov    (%rax),%cl
cmp    $0xa,%cl
je     1122 <rpgp_skip_newline+0x22>
cmp    $0xd,%cl
jne    1121 <rpgp_skip_newline+0x21>
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
mov    $0x2,%ecx
cmpb   $0xa,0x1(%rax)
je     1127 <rpgp_skip_newline+0x27>
ret
mov    $0x1,%ecx
add    %rcx,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @rpgp_skip_newline(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
switch i8 %3, label %11 [
i8 13, label %4
i8 10, label %8
]
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %5, i8** %0
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 10
br i1 %7, label %8, label %11
8: ; preds = %1, %4
%9 = phi i64 [ 2, %4 ], [ 1, %1 ]
%10 = getelementptr inbounds i8, i8* %2, i64 %9
store i8* %10, i8** %0
br label %11
11: ; preds = %8, %1, %4
ret void
}
/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
extern unsigned long get_ug_id(const char *s,
                               long (*my_getxxnam)(const char *)) {
  unsigned long r;
  char *p;
  r = strtoul(s, &p, 10);
  if (*p || (s == p)) {
    r = my_getxxnam(s);
  }
  return r;
}


x86 assembly (clang, -O0):
<get_ug_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <get_ug_id+0x44>
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1162 <get_ug_id+0x52>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdi
call   *%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_ug_id>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    (%rsp),%rcx
cmp    %rbx,%rcx
je     113d <get_ug_id+0x2d>
cmpb   $0x0,(%rcx)
jne    113d <get_ug_id+0x2d>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    *%rax

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

LLVM IR (-O2):
define i64 @get_ug_id(i8* %0, i64 (i8*)* nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = call i64 @strtoul(i8* %0, i8** %3, i32 10)
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
%9 = icmp eq i8* %6, %0
%10 = or i1 %9, %8
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = tail call i64 %1(i8* %0)
br label %13
13: ; preds = %2, %11
%14 = phi i64 [ %12, %11 ], [ %5, %2 ]
ret i64 %14
}
/* Variables and functions */
size_t Lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ SEEK_END;
size_t Get_filesize(int fd) { return Lseek(fd, 0, SEEK_END); }


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

x86 assembly (clang, -O2):
<Get_filesize>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
jmp    1030 <Lseek@plt>

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @Get_filesize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SEEK_END
%5 = call i64 @Lseek(i32 %3, i32 0, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @Get_filesize(i32 %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i64 @Lseek(i32 %0, i32 0, i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ NOR_SPI_EnableRxInt();
int /*<<< orphan*/ NOR_SPI_EnableTxInt();
void NOR_SPI_EnableInt(void) {
  NOR_SPI_EnableRxInt();
  NOR_SPI_EnableTxInt();
}


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

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

LLVM IR (-O0):
define void @NOR_SPI_EnableInt() {
%1 = call i32 (...) @NOR_SPI_EnableRxInt()
%2 = call i32 (...) @NOR_SPI_EnableTxInt()
ret void
}

LLVM IR (-O2):
define void @NOR_SPI_EnableInt() {
%1 = tail call i32 (...) @NOR_SPI_EnableRxInt()
%2 = tail call i32 (...) @NOR_SPI_EnableTxInt()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int userinput2(void) {
  int a;
  printf("Please enter your second positive integer: ");
  scanf("%d", &a);
  return a;
}


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

x86 assembly (clang, -O2):
<userinput2>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Please enter your second positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @userinput2() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [44 x i8] c"Please enter your second positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @userinput2() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DSENSITIVITY(double);
double __BUILTIN_DAED_DBETWEEN_WITH_ULP(double, double);
int main(void) {
  double t, r;
  t = __BUILTIN_DAED_DBETWEEN_WITH_ULP(0.0, 999.0);
  r = t / (t + 1);
  DSENSITIVITY(r);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
call   1030 <__BUILTIN_DAED_DBETWEEN_WITH_ULP@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <DSENSITIVITY@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm1
xorpd  %xmm0,%xmm0
call   1030 <__BUILTIN_DAED_DBETWEEN_WITH_ULP@plt>
movsd  0xece(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
call   1040 <DSENSITIVITY@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = call double @__BUILTIN_DAED_DBETWEEN_WITH_ULP(double 0.000000e+00, double 9.990000e+02)
store double %3, double* %1
%4 = load double, double* %1
%5 = load double, double* %1
%6 = fadd double %5, 1.000000e+00
%7 = fdiv double %4, %6
store double %7, double* %2
%8 = load double, double* %2
%9 = call i32 @DSENSITIVITY(double %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double @__BUILTIN_DAED_DBETWEEN_WITH_ULP(double 0.000000e+00, double 9.990000e+02)
%2 = fadd double %1, 1.000000e+00
%3 = fdiv double %1, %2
%4 = tail call i32 @DSENSITIVITY(double %3)
ret i32 0
}
__attribute__((no)) void update_conf(const char *source) { (void)source; }


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

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

LLVM IR (-O0):
define void @update_conf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @update_conf(i8* nocapture %0) {
ret void
}
int extract_zoned_decimal_sign(unsigned long dword1, unsigned long dword0) {
  return ((dword1 & 0xf0) >> 4);
}


x86 assembly (clang, -O0):
<extract_zoned_decimal_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xf0,%rax
shr    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_zoned_decimal_sign>:
mov    %rdi,%rax
shr    $0x4,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @extract_zoned_decimal_sign(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = and i64 %5, 240
%7 = lshr i64 %6, 4
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @extract_zoned_decimal_sign(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = lshr i32 %3, 4
%5 = and i32 %4, 15
ret i32 %5
}
int dummy04(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @dummy04(i32 returned %0) {
ret i32 %0
}
int exists(const char *path, int *isdirp) { return (0); }


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

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

LLVM IR (-O0):
define i32 @exists(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @exists(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int find_next_file();
int find_next() {
  int res;
  while ((res = find_next_file()) == 1)
    ;
  return res;
}


x86 assembly (clang, -O0):
<find_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <find_next_file@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x1,%eax
jne    1130 <find_next+0x20>
jmp    1118 <find_next+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_next>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <find_next_file@plt>
cmp    $0x1,%eax
je     1120 <find_next+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @find_next() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @find_next_file()
%3 = icmp eq i32 %2, 1
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *memdup(void const *, size_t);
int /*<<< orphan*/ reverse(char *, size_t);
size_t write_FD(int, char *, size_t);
size_t write_FD_BE(int fd, const void *data, size_t size) {
  char *dup = memdup(data, size);
  reverse(dup, size);
  size_t count = write_FD(fd, dup, size);
  free(dup);
  return count;
}


x86 assembly (clang, -O0):
<write_FD_BE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <memdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <reverse@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <write_FD@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_FD_BE>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %edi,%r14d
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1060 <memdup@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <reverse@plt>
mov    %r14d,%edi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1050 <write_FD@plt>
mov    %rax,%rbx
mov    %rbp,%rdi
call   1040 <free@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i64 @write_FD_BE(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i8* @memdup(i8* %9, i64 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i64, i64* %6
%14 = call i32 @reverse(i8* %12, i64 %13)
%15 = load i32, i32* %4
%16 = load i8*, i8** %7
%17 = load i64, i64* %6
%18 = call i64 @write_FD(i32 %15, i8* %16, i64 %17)
store i64 %18, i64* %8
%19 = load i8*, i8** %7
%20 = call i32 @free(i8* %19)
%21 = load i64, i64* %8
ret i64 %21
}

LLVM IR (-O2):
define i64 @write_FD_BE(i32 %0, i8* %1, i64 %2) {
%4 = tail call i8* @memdup(i8* %1, i64 %2)
%5 = tail call i32 @reverse(i8* %4, i64 %2)
%6 = tail call i64 @write_FD(i32 %0, i8* %4, i64 %2)
%7 = tail call i32 @free(i8* %4)
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ gen_div();
int /*<<< orphan*/ gen_swap();
void gen_mod(void) {
  gen_div();
  gen_swap();
}


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

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

LLVM IR (-O0):
define void @gen_mod() {
%1 = call i32 (...) @gen_div()
%2 = call i32 (...) @gen_swap()
ret void
}

LLVM IR (-O2):
define void @gen_mod() {
%1 = tail call i32 (...) @gen_div()
%2 = tail call i32 (...) @gen_swap()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SIGUSR2;
int kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int restarttimer(pid_t pid) {
  int err;
  if ((err = kill(pid, SIGUSR2)) != 0) {
    printf("Error: Couldn't pause the timer.\n");
  }
  return (0);
}


x86 assembly (clang, -O0):
<restarttimer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     1154 <restarttimer+0x34>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restarttimer>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
call   1040 <kill@plt>
test   %eax,%eax
je     113f <restarttimer+0x1f>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGUSR2 = global i32 0
@.str = [34 x i8] c"Error: Couldn't pause the timer.\0A\00"
define i32 @restarttimer(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @SIGUSR2
%6 = call i32 @kill(i32 %4, i32 %5)
store i32 %6, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 0
}

LLVM IR (-O2):
@SIGUSR2 = global i32 0
@str = [33 x i8] c"Error: Couldn't pause the timer.\00"
define i32 @restarttimer(i32 %0) {
%2 = load i32, i32* @SIGUSR2
%3 = tail call i32 @kill(i32 %0, i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int rtems_shell_ls_namecmp(const FTSENT *a, const FTSENT *b) {
  return (strcmp(a->fts_name, b->fts_name));
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { i32 }
define i32 @rtems_shell_ls_namecmp(%struct.TYPE_4__* %0, %struct.TYPE_4__* %1) {
%3 = alloca %struct.TYPE_4__*
%4 = alloca %struct.TYPE_4__*
store %struct.TYPE_4__* %0, %struct.TYPE_4__** %3
store %struct.TYPE_4__* %1, %struct.TYPE_4__** %4
%5 = load %struct.TYPE_4__*, %struct.TYPE_4__** %3
%6 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.TYPE_4__*, %struct.TYPE_4__** %4
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 @strcmp(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i32 }
define i32 @rtems_shell_ls_namecmp(%struct.TYPE_4__* nocapture %0, %struct.TYPE_4__* nocapture %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @strcmp(i32 %4, i32 %6)
ret i32 %7
}