xunge/DecIR huggingface dataset:
int fun1112() { return 1112; }


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

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

LLVM IR (-O0):
define i32 @fun1112() {
ret i32 1112
}

LLVM IR (-O2):
define i32 @fun1112() {
ret i32 1112
}
void func_loopfb(void) {}


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

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

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

LLVM IR (-O2):
define void @func_loopfb() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ log_2_floor(int /*<<< orphan*/);
uint32_t leftmost_1bit_idx(uint64_t x) { return log_2_floor(x); }


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

x86 assembly (clang, -O2):
<leftmost_1bit_idx>:
jmp    1030 <log_2_floor@plt>

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

LLVM IR (-O2):
define i32 @leftmost_1bit_idx(i32 %0) {
%2 = tail call i32 @log_2_floor(i32 %0)
ret i32 %2
}
int dns_v_rel(void) { return 0x20160808; }


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

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

LLVM IR (-O0):
define i32 @dns_v_rel() {
ret i32 538314760
}

LLVM IR (-O2):
define i32 @dns_v_rel() {
ret i32 538314760
}
double saw(double phase) {
  if (phase <= 3.14159265358979323846 / 2)
    return phase * 2 / 3.14159265358979323846;
  else if (phase <= 3.14159265358979323846 * 3 / 2)
    return 2.0 - (phase * 2 / 3.14159265358979323846);
  else
    return -4.0 + phase * 2 / 3.14159265358979323846;
}


x86 assembly (clang, -O0):
<saw>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     113f <saw+0x3f>
movsd  0xefc(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xee7(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ab <saw+0xab>
movsd  0xec1(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     1181 <saw+0x81>
movsd  0xec6(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xeb1(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xead(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    11ab <saw+0xab>
movsd  0xe97(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xe82(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe6e(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<saw>:
movsd  0xef8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jae    1131 <saw+0x31>
movsd  0xefa(%rip),%xmm1
ucomisd %xmm0,%xmm1
addsd  %xmm0,%xmm0
divsd  0xee2(%rip),%xmm0
jae    113e <saw+0x3e>
addsd  0xef0(%rip),%xmm0
ret
addsd  %xmm0,%xmm0
divsd  0xecb(%rip),%xmm0
ret
movsd  0xed2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @saw(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ole double %4, 0x3FF921FB54442D18
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = fmul double %7, 2.000000e+00
%9 = fdiv double %8, 0x400921FB54442D18
store double %9, double* %2
br label %23
10: ; preds = %1
%11 = load double, double* %3
%12 = fcmp ole double %11, 0x4012D97C7F3321D2
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load double, double* %3
%15 = fmul double %14, 2.000000e+00
%16 = fdiv double %15, 0x400921FB54442D18
%17 = fsub double 2.000000e+00, %16
store double %17, double* %2
br label %23
18: ; preds = %10
%19 = load double, double* %3
%20 = fmul double %19, 2.000000e+00
%21 = fdiv double %20, 0x400921FB54442D18
%22 = fadd double -4.000000e+00, %21
store double %22, double* %2
br label %23
23: ; preds = %18, %13, %6
%24 = load double, double* %2
ret double %24
}

LLVM IR (-O2):
define double @saw(double %0) {
%2 = fcmp ugt double %0, 0x3FF921FB54442D18
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = fmul double %0, 2.000000e+00
%5 = fdiv double %4, 0x400921FB54442D18
br label %14
6: ; preds = %1
%7 = fcmp ugt double %0, 0x4012D97C7F3321D2
%8 = fmul double %0, 2.000000e+00
%9 = fdiv double %8, 0x400921FB54442D18
br i1 %7, label %12, label %10
10: ; preds = %6
%11 = fsub double 2.000000e+00, %9
br label %14
12: ; preds = %6
%13 = fadd double %9, -4.000000e+00
br label %14
14: ; preds = %12, %10, %3
%15 = phi double [ %5, %3 ], [ %11, %10 ], [ %13, %12 ]
ret double %15
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ write_array_i32(int /*<<< orphan*/ *, int const *,
                                   unsigned int const);
void write_named_array_i32(FILE *f, const char *name, const int *x,
                           const unsigned int len) {
  fprintf(f, "\"%s\":[", name);
  write_array_i32(f, x, len);
  fprintf(f, "]");
}


x86 assembly (clang, -O0):
<write_named_array_i32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <write_array_i32@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_named_array_i32>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rdx
mov    %rdi,%rbp
lea    0xeb9(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <write_array_i32@plt>
mov    $0x5d,%edi
mov    %rbp,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\22%s\22:[\00"
@.str.1 = [2 x i8] c"]\00"
define void @write_named_array_i32(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %5
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @write_array_i32(i32* %12, i32* %13, i32 %14)
%16 = load i32*, i32** %5
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\22%s\22:[\00"
define void @write_named_array_i32(i32* %0, i8* %1, i32* %2, i32 %3) {
%5 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = tail call i32 @write_array_i32(i32* %0, i32* %2, i32 %3)
%7 = tail call i32 @fputc(i32 93, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SetDOFSTDAF(unsigned char);
int /*<<< orphan*/ WitTim(int);
void SetDOFSTDAF_WT(unsigned char ucSetDat) {
  SetDOFSTDAF(ucSetDat);
  WitTim(250);
}


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

x86 assembly (clang, -O2):
<SetDOFSTDAF_WT>:
push   %rax
call   1030 <SetDOFSTDAF@plt>
mov    $0xfa,%edi
pop    %rax
jmp    1040 <WitTim@plt>

LLVM IR (-O0):
define void @SetDOFSTDAF_WT(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @SetDOFSTDAF(i8 zeroext %3)
%5 = call i32 @WitTim(i32 250)
ret void
}

LLVM IR (-O2):
define void @SetDOFSTDAF_WT(i8 zeroext %0) {
%2 = tail call i32 @SetDOFSTDAF(i8 zeroext %0)
%3 = tail call i32 @WitTim(i32 250)
ret void
}
int stringlength(char *s) {
  int n;
  for (n = 0; *s != '\0'; s++)
    n++;
  return n;
}


x86 assembly (clang, -O0):
<stringlength>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <stringlength+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <stringlength+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringlength>:
cmpb   $0x0,(%rdi)
je     111c <stringlength+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <stringlength+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stringlength(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int isbigendian(void) {
  union {
    char c[2];
    short s;
  } u;
  u.s = 0x1;
  return u.c[1] == '\1';
}


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

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

LLVM IR (-O0):
%union.anon = type { i16 }
define i32 @isbigendian() {
%1 = alloca %union.anon
%2 = bitcast %union.anon* %1 to i16*
store i16 1, i16* %2
%3 = bitcast %union.anon* %1 to [2 x i8]*
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @isbigendian() {
ret i32 0
}
int op_ldcc(void) { return (4); }


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

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

LLVM IR (-O0):
define i32 @op_ldcc() {
ret i32 4
}

LLVM IR (-O2):
define i32 @op_ldcc() {
ret i32 4
}
void CRYPTOAesCbcFinish(void) {
  (*((volatile unsigned long *)(0x40024000 + 0x00000700))) = 0x00000000;
  (*((volatile unsigned long *)(0x40024000 + 0x00000550))) = 0x00000000;
}


x86 assembly (clang, -O0):
<CRYPTOAesCbcFinish>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40024700,%eax
movq   $0x0,(%rax)
mov    $0x40024550,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTOAesCbcFinish>:
movq   $0x0,0x40024700
movq   $0x0,0x40024550
ret

LLVM IR (-O0):
define void @CRYPTOAesCbcFinish() {
store volatile i64 0, i64* inttoptr (i64 1073891072 to i64*)
store volatile i64 0, i64* inttoptr (i64 1073890640 to i64*)
ret void
}

LLVM IR (-O2):
define void @CRYPTOAesCbcFinish() {
store volatile i64 0, i64* inttoptr (i64 1073891072 to i64*)
store volatile i64 0, i64* inttoptr (i64 1073890640 to i64*)
ret void
}
/* Variables and functions */
long long divmodti4(int, unsigned long long, unsigned long long);
long long __umodti3(unsigned long long numerator,
                    unsigned long long denominator) {
  long long dividend;
  long long modul;
  modul = divmodti4(1, numerator, denominator);
  return modul;
}


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

x86 assembly (clang, -O2):
<__umodti3>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <divmodti4@plt>

LLVM IR (-O0):
define i64 @__umodti3(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = call i64 @divmodti4(i32 1, i64 %7, i64 %8)
store i64 %9, i64* %6
%10 = load i64, i64* %6
ret i64 %10
}

LLVM IR (-O2):
define i64 @__umodti3(i64 %0, i64 %1) {
%3 = tail call i64 @divmodti4(i32 1, i64 %0, i64 %1)
ret i64 %3
}
char *strerror(int n) {
  extern int sys_nerr;
  extern char *sys_errlist[];
  if (n < 0 || n >= sys_nerr)
    return (char *)0;
  return sys_errlist[n];
}


x86 assembly (clang, -O0):
<strerror>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     1123 <strerror+0x23>
mov    -0xc(%rbp),%eax
mov    0x2ecd(%rip),%rcx
cmp    (%rcx),%eax
jl     1130 <strerror+0x30>
movq   $0x0,-0x8(%rbp)
jmp    1143 <strerror+0x43>
movslq -0xc(%rbp),%rcx
mov    0x2ebd(%rip),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strerror>:
xor    %eax,%eax
test   %edi,%edi
js     111e <strerror+0x1e>
mov    0x2edb(%rip),%rcx
cmp    %edi,(%rcx)
jle    111e <strerror+0x1e>
mov    %edi,%eax
mov    0x2ede(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
define i8* @strerror(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = load i32, i32* @sys_nerr
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* null, i8** %2
br label %16
11: ; preds = %6
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %13
%15 = load i8*, i8** %14
store i8* %15, i8** %2
br label %16
16: ; preds = %11, %10
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@sys_nerr = external global i32
@sys_errlist = external global [0 x i8*]
define i8* @strerror(i32 %0) {
%2 = icmp sgt i32 %0, -1
%3 = load i32, i32* @sys_nerr
%4 = icmp sgt i32 %3, %0
%5 = select i1 %2, i1 %4, i1 false
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %0 to i64
%8 = getelementptr inbounds [0 x i8*], [0 x i8*]* @sys_errlist, i64 0, i64 %7
%9 = load i8*, i8** %8
br label %10
10: ; preds = %1, %6
%11 = phi i8* [ %9, %6 ], [ null, %1 ]
ret i8* %11
}
/* Variables and functions */
unsigned int bswap32(unsigned int);
unsigned int be32_to_cpu(unsigned int x) { return bswap32(x); }


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

x86 assembly (clang, -O2):
<be32_to_cpu>:
jmp    1030 <bswap32@plt>

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

LLVM IR (-O2):
define i32 @be32_to_cpu(i32 %0) {
%2 = tail call i32 @bswap32(i32 %0)
ret i32 %2
}
void foo430(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo430(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fatal_util(char *, size_t);
void *malloc(size_t);
void *malloc_util(size_t numbytes) {
  void *ret;
  if ((ret = malloc(numbytes)) == NULL)
    fatal_util("malloc_util: out of memory when requesting %d bytes", numbytes);
  return ret;
}


x86 assembly (clang, -O0):
<malloc_util>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <malloc_util+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1030 <fatal_util@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_util>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <malloc_util+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <fatal_util@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [52 x i8] c"malloc_util: out of memory when requesting %d bytes\00"
define i8* @malloc_util(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @fatal_util(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [52 x i8] c"malloc_util: out of memory when requesting %d bytes\00"
define noalias i8* @malloc_util(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_util(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ RamWrite32A(int, int);
void SetSinWavGenInt(void) {
  RamWrite32A(0x0000 + 0x00c4, 0x00000000);
  RamWrite32A(0x0004 + 0x0000 + 0x00c4, 0x00000000);
  RamWrite32A(0x0004 + 0x0004 + 0x0000 + 0x00c4, 0x00000000);
  RamWrite32A(0x0000 + 0x00d8, 0x00000000);
  RamWrite32A(0x0004 + 0x0000 + 0x00d8, 0x20000000);
  RamWrite32A(0x0004 + 0x0004 + 0x0000 + 0x00d8, 0x00000000);
  RamWrite32A(0x0004 + 0x0000 + 0x00b8, 0x00000000);
}


x86 assembly (clang, -O0):
<SetSinWavGenInt>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc4,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xc8,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xcc,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xd8,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xdc,%edi
mov    $0x20000000,%esi
call   1030 <RamWrite32A@plt>
mov    $0xe0,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xbc,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetSinWavGenInt>:
push   %rax
mov    $0xc4,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xc8,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xcc,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xd8,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xdc,%edi
mov    $0x20000000,%esi
call   1030 <RamWrite32A@plt>
mov    $0xe0,%edi
xor    %esi,%esi
call   1030 <RamWrite32A@plt>
mov    $0xbc,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <RamWrite32A@plt>

LLVM IR (-O0):
define void @SetSinWavGenInt() {
%1 = call i32 @RamWrite32A(i32 196, i32 0)
%2 = call i32 @RamWrite32A(i32 200, i32 0)
%3 = call i32 @RamWrite32A(i32 204, i32 0)
%4 = call i32 @RamWrite32A(i32 216, i32 0)
%5 = call i32 @RamWrite32A(i32 220, i32 536870912)
%6 = call i32 @RamWrite32A(i32 224, i32 0)
%7 = call i32 @RamWrite32A(i32 188, i32 0)
ret void
}

LLVM IR (-O2):
define void @SetSinWavGenInt() {
%1 = tail call i32 @RamWrite32A(i32 196, i32 0)
%2 = tail call i32 @RamWrite32A(i32 200, i32 0)
%3 = tail call i32 @RamWrite32A(i32 204, i32 0)
%4 = tail call i32 @RamWrite32A(i32 216, i32 0)
%5 = tail call i32 @RamWrite32A(i32 220, i32 536870912)
%6 = tail call i32 @RamWrite32A(i32 224, i32 0)
%7 = tail call i32 @RamWrite32A(i32 188, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_mul(char *str) { sprintf(str, "MUL   AB                        "); }


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

x86 assembly (clang, -O2):
<sprint_mul>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"MUL AB \00"
define void @sprint_mul(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"MUL AB \00"
define void @sprint_mul(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
int rt_mutex_check_prio(struct task_struct *task, int newprio) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_struct = type opaque
define i32 @rt_mutex_check_prio(%struct.task_struct* %0, i32 %1) {
%3 = alloca %struct.task_struct*
%4 = alloca i32
store %struct.task_struct* %0, %struct.task_struct** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @rt_mutex_check_prio(%struct.task_struct* nocapture readnone %0, i32 %1) {
ret i32 0
}
double f4_sum_pre_int_int_short(int v0, int v1, short v) {
  return (double)v0 + (double)v1 + ((double)(v));
}


x86 assembly (clang, -O0):
<f4_sum_pre_int_int_short>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm0
movswl -0xa(%rbp),%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_sum_pre_int_int_short>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @f4_sum_pre_int_int_short(i32 %0, i32 %1, i16 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
store i32 %0, i32* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%7 = load i32, i32* %4
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to double
%11 = fadd double %8, %10
%12 = load i16, i16* %6
%13 = sitofp i16 %12 to double
%14 = fadd double %11, %13
ret double %14
}

LLVM IR (-O2):
define double @f4_sum_pre_int_int_short(i32 %0, i32 %1, i16 signext %2) {
%4 = sitofp i32 %0 to double
%5 = sitofp i32 %1 to double
%6 = fadd double %4, %5
%7 = sitofp i16 %2 to double
%8 = fadd double %6, %7
ret double %8
}
void CHECK_DIV(void) { (void)0; }


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

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

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

LLVM IR (-O2):
define void @CHECK_DIV() {
ret void
}
int test_imm_A7uint16_mem(unsigned short *val) {
  return ((*val) & (-0xA7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A7uint16_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, -167
%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_A7uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -167
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int aaa(void) {
  int x = 0x66;
  return x;
}


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

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

LLVM IR (-O0):
define i32 @aaa() {
%1 = alloca i32
store i32 102, i32* %1
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @aaa() {
ret i32 102
}
/* Variables and functions */
double soundio_double_max(int /*<<< orphan*/, double);
int /*<<< orphan*/ soundio_double_min(double, double);
double soundio_double_clamp(double min_value, double value, double max_value) {
  return soundio_double_max(soundio_double_min(value, max_value), min_value);
}


x86 assembly (clang, -O0):
<soundio_double_clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1030 <soundio_double_min@plt>
mov    %eax,%edi
movsd  -0x8(%rbp),%xmm0
call   1040 <soundio_double_max@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soundio_double_clamp>:
push   %rax
movsd  %xmm0,(%rsp)
movaps %xmm1,%xmm0
movaps %xmm2,%xmm1
call   1030 <soundio_double_min@plt>
mov    %eax,%edi
movsd  (%rsp),%xmm0
pop    %rax
jmp    1040 <soundio_double_max@plt>

LLVM IR (-O0):
define double @soundio_double_clamp(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %5
%8 = load double, double* %6
%9 = call i32 @soundio_double_min(double %7, double %8)
%10 = load double, double* %4
%11 = call double @soundio_double_max(i32 %9, double %10)
ret double %11
}

LLVM IR (-O2):
define double @soundio_double_clamp(double %0, double %1, double %2) {
%4 = tail call i32 @soundio_double_min(double %1, double %2)
%5 = tail call double @soundio_double_max(i32 %4, double %0)
ret double %5
}
int power(int x, unsigned int y, int p) {
  int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1)
      res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    1161 <power+0x61>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1145 <power+0x45>
mov    -0x10(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x4(%rbp)
jmp    111e <power+0x1e>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
test   %esi,%esi
je     113c <power+0x3c>
mov    %edx,%r8d
mov    $0x1,%ecx
jmp    111e <power+0x1e>
xchg   %ax,%ax
mov    %esi,%eax
shr    %eax
imul   %edi,%edi
cmp    $0x1,%esi
mov    %eax,%esi
jbe    1139 <power+0x39>
mov    %edi,%eax
cltd
idiv   %r8d
mov    %edx,%edi
test   $0x1,%sil
je     1110 <power+0x10>
imul   %edi,%ecx
mov    %ecx,%eax
cltd
idiv   %r8d
mov    %edx,%ecx
jmp    1110 <power+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @power(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 1, i32* %7
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = srem i32 %8, %9
store i32 %10, i32* %4
br label %11
11: ; preds = %24, %3
%12 = load i32, i32* %5
%13 = icmp ugt i32 %12, 0
br i1 %13, label %14, label %32
14: ; preds = %11
%15 = load i32, i32* %5
%16 = and i32 %15, 1
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i32, i32* %7
%20 = load i32, i32* %4
%21 = mul nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = srem i32 %21, %22
store i32 %23, i32* %7
br label %24
24: ; preds = %18, %14
%25 = load i32, i32* %5
%26 = lshr i32 %25, 1
store i32 %26, i32* %5
%27 = load i32, i32* %4
%28 = load i32, i32* %4
%29 = mul nsw i32 %27, %28
%30 = load i32, i32* %6
%31 = srem i32 %29, %30
store i32 %31, i32* %4
br label %11
32: ; preds = %11
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %20, label %5
5: ; preds = %3, %15
%6 = phi i32 [ %18, %15 ], [ %0, %3 ]
%7 = phi i32 [ %16, %15 ], [ 1, %3 ]
%8 = phi i32 [ %17, %15 ], [ %1, %3 ]
%9 = srem i32 %6, %2
%10 = and i32 %8, 1
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %5
%13 = mul nsw i32 %9, %7
%14 = srem i32 %13, %2
br label %15
15: ; preds = %12, %5
%16 = phi i32 [ %14, %12 ], [ %7, %5 ]
%17 = lshr i32 %8, 1
%18 = mul nsw i32 %9, %9
%19 = icmp ult i32 %8, 2
br i1 %19, label %20, label %5
20: ; preds = %15, %3
%21 = phi i32 [ 1, %3 ], [ %16, %15 ]
ret i32 %21
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ snprintf(char *, int, char *, int /*<<< orphan*/);
char *file_size_to_str(off_t file_size) {
  char *str = malloc(32);
  snprintf(str, 32, "%lld", file_size);
  return str;
}


x86 assembly (clang, -O0):
<file_size_to_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x20,%esi
lea    0xeb4(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size_to_str>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x20,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xec7(%rip),%rdx
mov    %rax,%rdi
mov    $0x20,%esi
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
define i8* @file_size_to_str(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @malloc(i32 32)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* %2
%7 = call i32 @snprintf(i8* %5, i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i8*, i8** %3
ret i8* %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
define i8* @file_size_to_str(i32 %0) {
%2 = tail call dereferenceable_or_null(32) i8* @malloc(i32 32)
%3 = tail call i32 @snprintf(i8* %2, i32 32, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
/* Variables and functions */
char EOF;
char getchar();
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ putchar_repeat(char, int);
int main(void) {
  char c;
  while ((c = getchar()) != EOF) {
    if (c == '\t') {
      putchar_repeat(' ', 4);
    } else {
      putchar(c);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     118d <main+0x5d>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
jne    117f <main+0x4f>
mov    $0x20,%edi
mov    $0x4,%esi
call   1050 <putchar_repeat@plt>
jmp    1188 <main+0x58>
movsbl -0x5(%rbp),%edi
call   1030 <putchar@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea9(%rip),%rbx
jmp    115f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%rbx),%al
je     1178 <main+0x48>
cmp    $0x9,%al
jne    1150 <main+0x20>
mov    $0x20,%edi
mov    $0x4,%esi
call   1050 <putchar_repeat@plt>
jmp    1158 <main+0x28>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@EOF = global i8 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = load i8, i8* @EOF
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %5, %7
br i1 %8, label %9, label %19
9: ; preds = %3
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 9
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @putchar_repeat(i8 signext 32, i32 4)
br label %18
15: ; preds = %9
%16 = load i8, i8* %2
%17 = call i32 @putchar(i8 signext %16)
br label %18
18: ; preds = %15, %13
br label %3
19: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %15, label %4
4: ; preds = %0, %11
%5 = phi i8 [ %12, %11 ], [ %1, %0 ]
%6 = icmp eq i8 %5, 9
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @putchar_repeat(i8 signext 32, i32 4)
br label %11
9: ; preds = %4
%10 = tail call i32 @putchar(i8 signext %5)
br label %11
11: ; preds = %9, %7
%12 = tail call signext i8 (...) @getchar()
%13 = load i8, i8* @EOF
%14 = icmp eq i8 %12, %13
br i1 %14, label %15, label %4
15: ; preds = %11, %0
ret i32 0
}
/* Variables and functions */
bool regions_overlap(const size_t x, const size_t xlen, const size_t y,
                     const size_t ylen) {
  const size_t x_end = x + xlen;
  const size_t y_end = y + ylen;
  return ((y < x_end) && (x < y_end));
}


x86 assembly (clang, -O0):
<regions_overlap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x28(%rbp),%rcx
mov    %al,-0x31(%rbp)
jae    114d <regions_overlap+0x4d>
mov    -0x8(%rbp),%rax
cmp    -0x30(%rbp),%rax
setb   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<regions_overlap>:
add    %rdi,%rsi
add    %rdx,%rcx
cmp    %rdx,%rsi
seta   %al
cmp    %rdi,%rcx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @regions_overlap(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i64, i64* %5
%12 = load i64, i64* %6
%13 = add i64 %11, %12
store i64 %13, i64* %9
%14 = load i64, i64* %7
%15 = load i64, i64* %8
%16 = add i64 %14, %15
store i64 %16, i64* %10
%17 = load i64, i64* %7
%18 = load i64, i64* %9
%19 = icmp ult i64 %17, %18
br i1 %19, label %20, label %24
20: ; preds = %4
%21 = load i64, i64* %5
%22 = load i64, i64* %10
%23 = icmp ult i64 %21, %22
br label %24
24: ; preds = %20, %4
%25 = phi i1 [ false, %4 ], [ %23, %20 ]
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @regions_overlap(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = add i64 %1, %0
%6 = add i64 %3, %2
%7 = icmp ugt i64 %5, %2
%8 = icmp ugt i64 %6, %0
%9 = and i1 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
void foo631(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo631(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t dbj2(uint8_t c1, uint8_t c2, int size_bf) {
  unsigned long h = 177573 + c1;
  h = ((h << 5) + h) + c2;
  return ((uint16_t)h) % size_bf;
}


x86 assembly (clang, -O0):
<dbj2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2b5a5,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbj2>:
mov    %edx,%ecx
mov    %edi,%eax
shl    $0x5,%eax
add    %edi,%eax
add    %esi,%eax
add    $0x596a45,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @dbj2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = add nsw i32 177573, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %7
%11 = load i64, i64* %7
%12 = shl i64 %11, 5
%13 = load i64, i64* %7
%14 = add i64 %12, %13
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = add i64 %14, %16
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = trunc i64 %18 to i32
%20 = load i32, i32* %6
%21 = srem i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @dbj2(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %0, 33
%5 = add i32 %4, 5859909
%6 = add i32 %5, %1
%7 = srem i32 %6, %2
ret i32 %7
}
/* Variables and functions */
double cdfgev_(double *, double *);
double ccdfgev(double *x, double *para) { return cdfgev_(x, para); }


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

x86 assembly (clang, -O2):
<ccdfgev>:
jmp    1030 <cdfgev_@plt>

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

LLVM IR (-O2):
define double @ccdfgev(double* %0, double* %1) {
%3 = tail call double @cdfgev_(double* %0, double* %1)
ret double %3
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int pthread_equal(pthread_t p1, pthread_t p2) { return (p1 == p2); }


x86 assembly (clang, -O0):
<pthread_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @pthread_equal(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 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pthread_equal(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ matNd_copy(double *, double const *, int);
void mat3d_copy(double dest[9], const double src[9]) {
  matNd_copy(dest, src, 3);
}


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

x86 assembly (clang, -O2):
<mat3d_copy>:
mov    $0x3,%edx
jmp    1030 <matNd_copy@plt>

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

LLVM IR (-O2):
define void @mat3d_copy(double* %0, double* %1) {
%3 = tail call i32 @matNd_copy(double* %0, double* %1, i32 3)
ret void
}
__attribute__((always_)) void flush_anon_page(struct vm_area_struct *vma,
                                              struct page *page,
                                              unsigned long vmaddr) {}


x86 assembly (clang, -O0):
<flush_anon_page>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @flush_anon_page(%struct.vm_area_struct* %0, %struct.page* %1, i64 %2) {
%4 = alloca %struct.vm_area_struct*
%5 = alloca %struct.page*
%6 = alloca i64
store %struct.vm_area_struct* %0, %struct.vm_area_struct** %4
store %struct.page* %1, %struct.page** %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
%struct.vm_area_struct = type opaque
%struct.page = type opaque
define void @flush_anon_page(%struct.vm_area_struct* nocapture %0, %struct.page* nocapture %1, i64 %2) {
ret void
}
double pdf_Uniform(double x) { return 1.0; }


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

x86 assembly (clang, -O2):
<pdf_Uniform>:
movsd  0xef8(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @pdf_Uniform(double %0) {
ret double 1.000000e+00
}
/* Variables and functions */
char *memcpy(char *src, char *dst, int len) {
  __asm__("rep movsb " ::"S"(src), "D"(dst), "c"(len) :);
  return dst;
}


x86 assembly (clang, -O0):
<memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%ecx
rep movsb %ds:(%rsi),%es:(%rdi)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memcpy>:
mov    %edx,%ecx
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
rep movsb %ds:(%rsi),%es:(%rdi)
ret

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

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* returned %1, i32 %2) {
tail call void asm sideeffect "rep movsb ", "{si},{di},{cx},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1, i32 %2)
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int ucprot(int);
void uc_info() {
  printf("Protocol:\t%s\n", ucprot(-1) == 1 ? "XModem" : "RAW");
}


x86 assembly (clang, -O0):
<uc_info>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
call   1030 <ucprot@plt>
mov    %eax,%ecx
lea    0xede(%rip),%rsi
lea    0xed0(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rsi
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc_info>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <ucprot@plt>
cmp    $0x1,%eax
lea    0xed9(%rip),%rax
lea    0xed9(%rip),%rsi
cmove  %rax,%rsi
lea    0xeb9(%rip),%rdi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Protocol:\09%s\0A\00"
@.str.1 = [7 x i8] c"XModem\00"
@.str.2 = [4 x i8] c"RAW\00"
define void @uc_info() {
%1 = call i32 @ucprot(i32 -1)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i64
%4 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"Protocol:\09%s\0A\00"
@.str.1 = [7 x i8] c"XModem\00"
@.str.2 = [4 x i8] c"RAW\00"
define void @uc_info() {
%1 = tail call i32 @ucprot(i32 -1)
%2 = icmp eq i32 %1, 1
%3 = select i1 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char a[1000];
  char b[1000];
  int i;
  for (i = 0; i < 100; i++) {
    a[i] = 'c';
    b[i] = 'd';
  }
  printf("%c\n", b[10000]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x7f0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x7e4(%rbp)
cmpl   $0x64,-0x7e4(%rbp)
jge    116b <main+0x5b>
movslq -0x7e4(%rbp),%rax
movb   $0x63,-0x3f0(%rbp,%rax,1)
63
movslq -0x7e4(%rbp),%rax
movb   $0x64,-0x7e0(%rbp,%rax,1)
64
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
jmp    112c <main+0x1c>
lea    0xe8e(%rip),%rdi
movsbl 0x1f30(%rbp),%esi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x7f0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1000 x i8]
%3 = alloca [1000 x i8]
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %15, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 100
br i1 %7, label %8, label %18
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %10
store i8 99, i8* %11
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %13
store i8 100, i8* %14
br label %15
15: ; preds = %8
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %5
18: ; preds = %5
%19 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 10000
%20 = load i8, i8* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %20)
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext poison)
ret i32 0
}
/* Type definitions */
struct gg_search_request {
  int dummy;
};
struct gg_http {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ gg_debug(int, char *);
struct gg_http *gg_search(const struct gg_search_request *r, int async) {
  gg_debug(16, "// gg_search() is obsolete. use gg_search50() instead!\n");
  errno = EINVAL;
  return NULL;
}


x86 assembly (clang, -O0):
<gg_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x10,%edi
lea    0xed5(%rip),%rsi
call   1030 <gg_debug@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gg_search>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x10,%edi
call   1030 <gg_debug@plt>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
mov    0x2eae(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.gg_http = type { i32 }
%struct.gg_search_request = type { i32 }
@.str = [56 x i8] c"// gg_search() is obsolete. use gg_search50() instead!\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define %struct.gg_http* @gg_search(%struct.gg_search_request* %0, i32 %1) {
%3 = alloca %struct.gg_search_request*
%4 = alloca i32
store %struct.gg_search_request* %0, %struct.gg_search_request** %3
store i32 %1, i32* %4
%5 = call i32 @gg_debug(i32 16, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EINVAL
store i32 %6, i32* @errno
ret %struct.gg_http* null
}

LLVM IR (-O2):
%struct.gg_http = type { i32 }
%struct.gg_search_request = type { i32 }
@.str = [56 x i8] c"// gg_search() is obsolete. use gg_search50() instead!\0A\00"
@EINVAL = global i32 0
@errno = global i32 0
define noalias %struct.gg_http* @gg_search(%struct.gg_search_request* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @gg_debug(i32 16, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @EINVAL
store i32 %4, i32* @errno
ret %struct.gg_http* null
}