xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
char *skip_nonwhitespace(char *s) {
  while (*s && !isspace(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_nonwhitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1148 <skip_nonwhitespace+0x38>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1158 <skip_nonwhitespace+0x48>
jmp    1169 <skip_nonwhitespace+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_nonwhitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_nonwhitespace>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1138 <skip_nonwhitespace+0x28>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
jne    1138 <skip_nonwhitespace+0x28>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_nonwhitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_nonwhitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %16, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i32 @isspace(i8 signext %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
br label %14
14: ; preds = %8, %3
%15 = phi i1 [ false, %3 ], [ %13, %8 ]
br i1 %15, label %16, label %19
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
br label %3
19: ; preds = %14
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @skip_nonwhitespace(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i32 @isspace(i8 signext %5)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
double fabs(double);
double pow(double, int);
double f5(double x, double y) {
  return fabs(x * (-15. + x * x * (10. - x * x))) / pow(y, 5.);
}


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
movsd  0xeba(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xea2(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movaps 0xe83(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x5,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
sub    $0x18,%rsp
movapd %xmm0,%xmm3
mulsd  %xmm0,%xmm0
movsd  0xedc(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  0xed4(%rip),%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm3
andpd  0xecc(%rip),%xmm3
movapd %xmm3,(%rsp)
mov    $0x5,%edi
call   1030 <pow@plt>
movapd (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @f5(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* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fneg double %9
%12 = call double @llvm.fmuladd.f64(double %11, double %10, double 1.000000e+01)
%13 = call double @llvm.fmuladd.f64(double %8, double %12, double -1.500000e+01)
%14 = fmul double %5, %13
%15 = call double @llvm.fabs.f64(double %14)
%16 = load double, double* %4
%17 = call double @pow(double %16, i32 5)
%18 = fdiv double %15, %17
ret double %18
}

LLVM IR (-O2):
define double @f5(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fneg double %0
%5 = tail call double @llvm.fmuladd.f64(double %4, double %0, double 1.000000e+01)
%6 = tail call double @llvm.fmuladd.f64(double %3, double %5, double -1.500000e+01)
%7 = fmul double %6, %0
%8 = tail call double @llvm.fabs.f64(double %7)
%9 = tail call double @pow(double %1, i32 5)
%10 = fdiv double %8, %9
ret double %10
}
void set_up() {}


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

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

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

LLVM IR (-O2):
define void @set_up() {
ret void
}
/* Variables and functions */
double pow(double, double);
double earth_orbit_eccentricity(double tm) {
  return pow(-0.0000001267 * tm, 2.0) - 0.000042037 * tm + 0.016708634;
}


x86 assembly (clang, -O0):
<earth_orbit_eccentricity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xef3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xede(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<earth_orbit_eccentricity>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @earth_orbit_eccentricity(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double -1.267000e-07, %3
%5 = call double @pow(double %4, double 2.000000e+00)
%6 = load double, double* %2
%7 = call double @llvm.fmuladd.f64(double -4.203700e-05, double %6, double %5)
%8 = fadd double %7, 0x3F911C11725D0380
ret double %8
}

LLVM IR (-O2):
define double @earth_orbit_eccentricity(double %0) {
%2 = fmul double %0, -1.267000e-07
%3 = fmul double %2, %2
%4 = tail call double @llvm.fmuladd.f64(double %0, double -4.203700e-05, double %3)
%5 = fadd double %4, 0x3F911C11725D0380
ret double %5
}
int compare(int numA, int numB) {
  if (numA > numB) {
    return 1;
  } else if (numA < numB) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <compare+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1146 <compare+0x46>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <compare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1146 <compare+0x46>
jmp    113f <compare+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %ecx,%ecx
cmp    %esi,%edi
setl   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char const *, size_t);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
size_t strnlen(char const *, size_t);
char *stpnmove(char *whither, const char *whence, size_t maxlen) {
  size_t n = strnlen(whence, maxlen);
  memmove(whither, whence, n);
  memset(whither + n, 0, maxlen - n);
  return whither + n;
}


x86 assembly (clang, -O0):
<stpnmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strnlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1050 <memmove@plt>
mov    -0x8(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
sub    -0x20(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
add    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpnmove>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <strnlen@plt>
mov    %rax,%r12
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
call   1050 <memmove@plt>
add    %r12,%rbx
sub    %r12,%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
call   1030 <memset@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @stpnmove(i8* %0, i8* %1, i64 %2) {
%4 = tail call i64 @strnlen(i8* %1, i64 %2)
%5 = tail call i32 @memmove(i8* %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 %4
%7 = sub i64 %2, %4
%8 = tail call i32 @memset(i8* %6, i32 0, i64 %7)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ SCOTCH_errorPrint(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stratParserRemain();
int scotchyyerror(const char *const errstr) {
  SCOTCH_errorPrint("stratParserParse: invalid strategy string, before \"%s\"",
                    stratParserRemain());
  return (1);
}


x86 assembly (clang, -O0):
<scotchyyerror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <stratParserRemain@plt>
mov    %eax,%esi
lea    0xec4(%rip),%rdi
call   1030 <SCOTCH_errorPrint@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scotchyyerror>:
push   %rax
xor    %eax,%eax
call   1040 <stratParserRemain@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <SCOTCH_errorPrint@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"stratParserParse: invalid strategy string, before \22%s\22\00"
define i32 @scotchyyerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @stratParserRemain()
%4 = call i32 @SCOTCH_errorPrint(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [55 x i8] c"stratParserParse: invalid strategy string, before \22%s\22\00"
define i32 @scotchyyerror(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @stratParserRemain()
%3 = tail call i32 @SCOTCH_errorPrint(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 1
}
/* Variables and functions */
char *strdup(char *);
char *strtok(char *, char *);
char *parser_get_ident(char *data) {
  char *buf;
  char *delimit = "~@";
  char *buf1 = strdup(data);
  buf = strtok(buf1, ":!");
  buf = strtok(NULL, delimit);
  return (char *)buf;
}


x86 assembly (clang, -O0):
<parser_get_ident>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parser_get_ident>:
push   %rax
call   1040 <strdup@plt>
lea    0xed6(%rip),%rsi
mov    %rax,%rdi
call   1030 <strtok@plt>
lea    0xec4(%rip),%rsi
xor    %edi,%edi
pop    %rax
jmp    1030 <strtok@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"~@\00"
@.str.1 = [3 x i8] c":!\00"
define i8* @parser_get_ident(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %2
%7 = call i8* @strdup(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = call i8* @strtok(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i8* %9, i8** %3
%10 = load i8*, i8** %4
%11 = call i8* @strtok(i8* null, i8* %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [3 x i8] c"~@\00"
@.str.1 = [3 x i8] c":!\00"
define i8* @parser_get_ident(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = tail call i8* @strtok(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %4
}
/* Variables and functions */
scalar_t__ getValueFromFile(char *);
int getGpuFreq(void) {
  int result;
  result =
      (int)(getValueFromFile("/sys/module/pvrsrvkm/parameters/sgx_gpu_clk"));
  return result;
}


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

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

LLVM IR (-O0):
@.str = [44 x i8] c"/sys/module/pvrsrvkm/parameters/sgx_gpu_clk\00"
define i32 @getGpuFreq() {
%1 = alloca i32
%2 = call i64 @getValueFromFile(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [44 x i8] c"/sys/module/pvrsrvkm/parameters/sgx_gpu_clk\00"
define i32 @getGpuFreq() {
%1 = tail call i64 @getValueFromFile(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%2 = trunc i64 %1 to i32
ret i32 %2
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  {
    state[0UL] = (input[0UL] + 51238316UL) + 274866410UL;
    if ((state[0UL] >> 4UL) & 1UL) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] + 707305405UL) - 2147156991UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x30dd5ac,%rax
add    $0x106220ea,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x4,%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     114a <RandomFunc+0x4a>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1156 <RandomFunc+0x56>
mov    -0x18(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
add    $0x2a289fbd,%rcx
sub    $0x7ffb03ff,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
add    %rax,%rax
add    $0xffffffffd10d88ea,%rax
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca [1 x i64]
store i64* %0, i64** %3
store i64* %1, i64** %4
%6 = load i64*, i64** %3
%7 = getelementptr inbounds i64, i64* %6, i64 0
%8 = load i64, i64* %7
%9 = add i64 %8, 51238316
%10 = add i64 %9, 274866410
%11 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
store i64 %10, i64* %11
%12 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%13 = load i64, i64* %12
%14 = lshr i64 %13, 4
%15 = and i64 %14, 1
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%19 = load i64, i64* %18
%20 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%21 = load i64, i64* %20
%22 = add i64 %21, %19
store i64 %22, i64* %20
br label %29
23: ; preds = %2
%24 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%25 = load i64, i64* %24
%26 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%27 = load i64, i64* %26
%28 = add i64 %27, %25
store i64 %28, i64* %26
br label %29
29: ; preds = %23, %17
%30 = getelementptr inbounds [1 x i64], [1 x i64]* %5, i64 0, i64 0
%31 = load i64, i64* %30
%32 = add i64 %31, 707305405
%33 = sub i64 %32, 2147156991
%34 = load i64*, i64** %4
%35 = getelementptr inbounds i64, i64* %34, i64 0
store i64 %33, i64* %35
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, -787642134
store i64 %5, i64* %1
ret void
}
void do_two_times2_Good(int n) {
  char a[1];
  int k = n;
  for (int i = 0; i < k; i++) {
    k = 1;
    a[i] = 3;
  }
}


x86 assembly (clang, -O0):
<do_two_times2_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113e <do_two_times2_Good+0x3e>
movl   $0x1,-0xc(%rbp)
movslq -0x10(%rbp),%rax
movb   $0x3,-0x5(%rbp,%rax,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <do_two_times2_Good+0x14>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_two_times2_Good(i32 %0) {
ret void
}
float min(float value, float minium) {
  return (value < minium) ? minium : value;
}


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

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

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

LLVM IR (-O2):
define float @min(float %0, float %1) {
%3 = fcmp olt float %0, %1
%4 = select i1 %3, float %1, float %0
ret float %4
}
char *extGetEtherAdd(void) { return ((char *)0); }


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

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

LLVM IR (-O0):
define i8* @extGetEtherAdd() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @extGetEtherAdd() {
ret i8* null
}
void XtAppGetExitFlag() {}


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

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

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

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

/* Variables and functions */
int __infer_nondet_int();
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *type) {
  if (attr == 0)
    while (1)
      ;
  *type = __infer_nondet_int();
  return __infer_nondet_int();
}


x86 assembly (clang, -O0):
<pthread_mutexattr_gettype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1135 <pthread_mutexattr_gettype+0x25>
jmp    1130 <pthread_mutexattr_gettype+0x20>
jmp    1130 <pthread_mutexattr_gettype+0x20>
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_mutexattr_gettype>:
test   %rdi,%rdi
je     1130 <pthread_mutexattr_gettype+0x20>
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
pop    %rbx
jmp    1030 <__infer_nondet_int@plt>
nopw   0x0(%rax,%rax,1)
jmp    1130 <pthread_mutexattr_gettype+0x20>

LLVM IR (-O0):
define i32 @pthread_mutexattr_gettype(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
br label %8
8: ; preds = %7, %8
br label %8
9: ; preds = %2
%10 = call i32 (...) @__infer_nondet_int()
%11 = load i32*, i32** %4
store i32 %10, i32* %11
%12 = call i32 (...) @__infer_nondet_int()
ret i32 %12
}

LLVM IR (-O2):
define i32 @pthread_mutexattr_gettype(i32* readnone %0, i32* nocapture writeonly %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %5
4: ; preds = %2, %4
br label %4
5: ; preds = %2
%6 = tail call i32 (...) @__infer_nondet_int()
store i32 %6, i32* %1
%7 = tail call i32 (...) @__infer_nondet_int()
ret i32 %7
}
int main() {
  int x = 10;
  while (x > 0) {
    x++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ pB(char *, char const *, char const *);
void write_mem_pB(const char *regname_data, const char *regname_address) {
  pB("PASMEM0(%s, T_SINT32, mem_ptr, %s);", regname_data, regname_address);
}


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

x86 assembly (clang, -O2):
<write_mem_pB>:
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
jmp    1030 <pB@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"PASMEM0(%s, T_SINT32, mem_ptr, %s);\00"
define void @write_mem_pB(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @pB(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"PASMEM0(%s, T_SINT32, mem_ptr, %s);\00"
define void @write_mem_pB(i8* %0, i8* %1) {
%3 = tail call i32 @pB(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
int barGood() { return 1; }


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

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

LLVM IR (-O0):
define i32 @barGood() {
ret i32 1
}

LLVM IR (-O2):
define i32 @barGood() {
ret i32 1
}
void fc67(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
  a:
    goto a;
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc67>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc67+0x7>

x86 assembly (clang, -O2):
<fc67>:
jmp    1100 <fc67>

LLVM IR (-O0):
define void @fc67(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %1
br label %7
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc67(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
double erffc(double x) {
  double gammp(double a, double x);
  double gammq(double a, double x);
  return x < 0.0 ? 1.0 + gammp(0.5, x * x) : gammq(0.5, x * x);
}


x86 assembly (clang, -O0):
<erffc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    116b <erffc+0x4b>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xeb3(%rip),%xmm0
call   1040 <gammp@plt>
movaps %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1187 <erffc+0x67>
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  0xe83(%rip),%xmm0
call   1030 <gammq@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erffc>:
push   %rax
movapd %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
mulsd  %xmm1,%xmm1
movsd  0xec7(%rip),%xmm0
jbe    114a <erffc+0x2a>
call   1040 <gammp@plt>
addsd  0xec0(%rip),%xmm0
pop    %rax
ret
pop    %rax
jmp    1030 <gammq@plt>

LLVM IR (-O0):
define double @erffc(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load double, double* %2
%7 = load double, double* %2
%8 = fmul double %6, %7
%9 = call double @gammp(double 5.000000e-01, double %8)
%10 = fadd double 1.000000e+00, %9
br label %16
11: ; preds = %1
%12 = load double, double* %2
%13 = load double, double* %2
%14 = fmul double %12, %13
%15 = call double @gammq(double 5.000000e-01, double %14)
br label %16
16: ; preds = %11, %5
%17 = phi double [ %10, %5 ], [ %15, %11 ]
ret double %17
}

LLVM IR (-O2):
define double @erffc(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fmul double %0, %0
br i1 %2, label %4, label %7
4: ; preds = %1
%5 = tail call double @gammp(double 5.000000e-01, double %3)
%6 = fadd double %5, 1.000000e+00
br label %9
7: ; preds = %1
%8 = tail call double @gammq(double 5.000000e-01, double %3)
br label %9
9: ; preds = %7, %4
%10 = phi double [ %6, %4 ], [ %8, %7 ]
ret double %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void f1() {
  register int i = 0;
  auto int j = 1;
  printf("\n %d %d", i, j);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"\0A %d %d\00"
define void @f1() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret void
}
void ff_hevc_put_hevc_uni_epel_h32_8_avx2() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_h32_8_avx2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ uart_write(char);
void putchar(char c) {
  if (c == '\n')
    uart_write('\r');
  uart_write(c);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    1135 <putchar+0x25>
mov    $0xd,%edi
call   1030 <uart_write@plt>
movsbl -0x1(%rbp),%edi
call   1030 <uart_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1122 <putchar+0x12>
mov    $0xd,%edi
call   1030 <uart_write@plt>
movsbl %bl,%edi
pop    %rbx
jmp    1030 <uart_write@plt>

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @uart_write(i8 signext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @uart_write(i8 signext %9)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @uart_write(i8 signext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @uart_write(i8 signext %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int ntohs(int const);
uint16_t stun_get_msg_type_str(const unsigned char *buf, size_t len) {
  if (!buf || len < 2)
    return (uint16_t)-1;
  return ((ntohs(((const uint16_t *)buf)[0])) & 0x3FFF);
}


x86 assembly (clang, -O0):
<stun_get_msg_type_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1136 <stun_get_msg_type_str+0x26>
cmpq   $0x2,-0x18(%rbp)
jae    1142 <stun_get_msg_type_str+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <stun_get_msg_type_str+0x45>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
and    $0x3fff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stun_get_msg_type_str>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     1131 <stun_get_msg_type_str+0x21>
cmp    $0x2,%rsi
jb     1131 <stun_get_msg_type_str+0x21>
push   %rax
mov    (%rdi),%edi
call   1030 <ntohs@plt>
and    $0x3fff,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @stun_get_msg_type_str(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i64, i64* %5
%10 = icmp ult i64 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %8, %2
store i32 -1, i32* %3
br label %19
12: ; preds = %8
%13 = load i8*, i8** %4
%14 = bitcast i8* %13 to i32*
%15 = getelementptr inbounds i32, i32* %14, i64 0
%16 = load i32, i32* %15
%17 = call i32 @ntohs(i32 %16)
%18 = and i32 %17, 16383
store i32 %18, i32* %3
br label %19
19: ; preds = %12, %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @stun_get_msg_type_str(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
%4 = icmp ult i64 %1, 2
%5 = or i1 %3, %4
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
%9 = tail call i32 @ntohs(i32 %8)
%10 = and i32 %9, 16383
br label %11
11: ; preds = %2, %6
%12 = phi i32 [ %10, %6 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
unsigned int __udivsi3(unsigned int, unsigned int);
unsigned __umodsi3(unsigned a, unsigned b) { return a - __udivsi3(a, b) * b; }


x86 assembly (clang, -O0):
<__umodsi3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__udivsi3@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__umodsi3>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <__udivsi3@plt>
imul   %ebx,%eax
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @__umodsi3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @__udivsi3(i32 %6, i32 %7)
%9 = load i32, i32* %4
%10 = mul i32 %8, %9
%11 = sub i32 %5, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__umodsi3(i32 %0, i32 %1) {
%3 = tail call i32 @__udivsi3(i32 %0, i32 %1)
%4 = mul i32 %3, %1
%5 = sub i32 %0, %4
ret i32 %5
}
void single_V() {}


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

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

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

LLVM IR (-O2):
define void @single_V() {
ret void
}
/* Type definitions */
struct imgsrc {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct imgsrc *);
void memsrc_free(struct imgsrc *img) {
  if (!img) {
    return;
  }
  free(img);
}


x86 assembly (clang, -O0):
<memsrc_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <memsrc_free+0x1c>
jmp    1135 <memsrc_free+0x25>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memsrc_free>:
test   %rdi,%rdi
je     111a <memsrc_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
%struct.imgsrc = type { i32 }
define void @memsrc_free(%struct.imgsrc* %0) {
%2 = alloca %struct.imgsrc*
store %struct.imgsrc* %0, %struct.imgsrc** %2
%3 = load %struct.imgsrc*, %struct.imgsrc** %2
%4 = icmp ne %struct.imgsrc* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load %struct.imgsrc*, %struct.imgsrc** %2
%8 = call i32 @free(%struct.imgsrc* %7)
br label %9
9: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
%struct.imgsrc = type { i32 }
define void @memsrc_free(%struct.imgsrc* %0) {
%2 = icmp eq %struct.imgsrc* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.imgsrc* %0)
br label %5
5: ; preds = %1, %3
ret void
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_cancel(unsigned char const *, struct stream *);
int decode_cancel_format_2(const unsigned char *pkt, struct stream *stream) {
  return decode_cancel(pkt, stream);
}


x86 assembly (clang, -O0):
<decode_cancel_format_2>:
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 <decode_cancel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_cancel_format_2>:
jmp    1030 <decode_cancel@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_cancel_format_2(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_cancel(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_cancel_format_2(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_cancel(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Variables and functions */
double ceil(double);
double floor(double);
double round(double r) { return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); }


x86 assembly (clang, -O0):
<round>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115b <round+0x3b>
movsd  0xeb9(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
call   1040 <floor@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1176 <round+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xe98(%rip),%xmm1
subsd  %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1137 <round+0x17>
addsd  0xed6(%rip),%xmm0
jmp    1040 <floor@plt>
addsd  0xec1(%rip),%xmm0
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define double @round(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load double, double* %2
%7 = fadd double %6, 5.000000e-01
%8 = call double @llvm.floor.f64(double %7)
br label %13
9: ; preds = %1
%10 = load double, double* %2
%11 = fsub double %10, 5.000000e-01
%12 = call double @llvm.ceil.f64(double %11)
br label %13
13: ; preds = %9, %5
%14 = phi double [ %8, %5 ], [ %12, %9 ]
ret double %14
}

LLVM IR (-O2):
define double @round(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fadd double %0, 5.000000e-01
%5 = tail call double @llvm.floor.f64(double %4)
br label %9
6: ; preds = %1
%7 = fadd double %0, -5.000000e-01
%8 = tail call double @llvm.ceil.f64(double %7)
br label %9
9: ; preds = %6, %3
%10 = phi double [ %5, %3 ], [ %8, %6 ]
ret double %10
}
void x54x_log(const char *fmt, ...) {}


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

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

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

LLVM IR (-O2):
define void @x54x_log(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ utf8_get_next(char const *, int /*<<< orphan*/ *);
size_t utf8_strlen(const char *s) {
  size_t count = 0;
  while (*s) {
    s += utf8_get_next(s, NULL);
    count++;
  }
  return count;
}


x86 assembly (clang, -O0):
<utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <utf8_strlen+0x4f>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <utf8_get_next@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <utf8_strlen+0x14>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_strlen>:
push   %r14
push   %rbx
push   %rax
cmpb   $0x0,(%rdi)
je     113c <utf8_strlen+0x2c>
mov    %rdi,%rbx
xor    %r14d,%r14d
nop
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <utf8_get_next@plt>
cltq
add    $0x1,%r14
cmpb   $0x0,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rbx
jne    1120 <utf8_strlen+0x10>
jmp    113f <utf8_strlen+0x2f>
xor    %r14d,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @utf8_strlen(i8* %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 [ %10, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = tail call i32 @utf8_get_next(i8* %6, i32* null)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = add i64 %5, 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i64 [ 0, %1 ], [ %10, %4 ]
ret i64 %14
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int ZwClose(int Handle) {
  {
    int tmp_ndt_12;
    tmp_ndt_12 = __VERIFIER_nondet_int();
    if (tmp_ndt_12 == 0) {
      goto switch_12_0;
    } else {
      goto switch_12_default;
      if (0) {
      switch_12_0:
        return (0);
      switch_12_default:;
        return (-1073741823);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<ZwClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <ZwClose+0x24>
jmp    1139 <ZwClose+0x29>
jmp    1145 <ZwClose+0x35>
movl   $0x0,-0x4(%rbp)
jmp    114c <ZwClose+0x3c>
movl   $0xc0000001,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ZwClose>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
mov    $0xc0000001,%ecx
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ZwClose(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %12
9: ; preds = %1
br label %13
10: ; No predecessors!
br i1 false, label %11, label %14
11: ; preds = %10
br label %12
12: ; preds = %11, %8
store i32 0, i32* %2
br label %16
13: ; preds = %9
store i32 -1073741823, i32* %2
br label %16
14: ; preds = %10
br label %15
15: ; preds = %14
br label %16
16: ; preds = %12, %13, %15
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @ZwClose(i32 %0) {
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 0, i32 -1073741823
ret i32 %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_00_arraySum();
int /*<<< orphan*/ test_01_arrayCountNegative();
int main(int argc, char **argv) {
  printf("Welcome to ECE264, we are working on PA01.\n\n");
  test_00_arraySum();
  test_01_arrayCountNegative();
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_00_arraySum@plt>
mov    $0x0,%al
call   1040 <test_01_arrayCountNegative@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <test_00_arraySum@plt>
xor    %eax,%eax
call   1040 <test_01_arrayCountNegative@plt>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Welcome to ECE264, we are working on PA01.\0A\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @test_00_arraySum()
%8 = call i32 (...) @test_01_arrayCountNegative()
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [44 x i8] c"Welcome to ECE264, we are working on PA01.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @test_00_arraySum()
%5 = tail call i32 (...) @test_01_arrayCountNegative()
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void finish_trace_file(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<finish_trace_file>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @finish_trace_file(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void game_over(int **map, int length) {
  int i;
  for (i = 0; i < length; i++) {
    free(*(map + i));
  }
  free(map);
}


x86 assembly (clang, -O0):
<game_over>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <game_over+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <game_over+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_over>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <game_over+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <game_over+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @game_over(i32** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32*, i32** %0, i64 %7
%9 = bitcast i32** %8 to i8**
%10 = load i8*, i8** %9
tail call void @free(i8* %10)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = bitcast i32** %0 to i8*
tail call void @free(i8* %14)
ret void
}