xunge/DecIR huggingface dataset:
char *ReverseStringInPlace(char *start, char *end) {
  char *p1 = start;
  char *p2 = end - 1;
  while (p1 < p2) {
    char tmp = *p1;
    *p1++ = *p2;
    *p2-- = tmp;
  }
  return start;
}


x86 assembly (clang, -O0):
<ReverseStringInPlace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1167 <ReverseStringInPlace+0x67>
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x21(%rbp),%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
jmp    1120 <ReverseStringInPlace+0x20>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReverseStringInPlace>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rsi
cmp    %rdi,%rsi
jbe    112d <ReverseStringInPlace+0x2d>
lea    0x1(%rax),%rcx
movzbl -0x1(%rcx),%edi
movzbl (%rsi),%edx
mov    %dl,-0x1(%rcx)
mov    %dil,(%rsi)
add    $0xffffffffffffffff,%rsi
lea    0x1(%rcx),%rdx
cmp    %rsi,%rcx
mov    %rdx,%rcx
jb     1110 <ReverseStringInPlace+0x10>
ret

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

LLVM IR (-O2):
define i8* @ReverseStringInPlace(i8* returned %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 -1
%4 = icmp ugt i8* %3, %0
br i1 %4, label %5, label %13
5: ; preds = %2, %5
%6 = phi i8* [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = load i8, i8* %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %9, i8* %7
store i8 %8, i8* %6
%11 = getelementptr inbounds i8, i8* %6, i64 -1
%12 = icmp ult i8* %10, %11
br i1 %12, label %5, label %13
13: ; preds = %5, %2
ret i8* %0
}
int main(int argc, char *argv[]) {
  int i = 42;
  i += 25;
  char foo = "Welcome to a jmp-less program!\n";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2a,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x19,%eax
mov    %eax,-0x14(%rbp)
lea    0xede(%rip),%rax
mov    %al,-0x15(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [32 x i8] c"Welcome to a jmp-less program!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 42, i32* %5
%7 = load i32, i32* %5
%8 = add nsw i32 %7, 25
store i32 %8, i32* %5
store i8 ptrtoint ([32 x i8]* @.str to i8), i8* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(char const *progname) {
  printf("usage: %s [-p #padding] [-v] [-x xres ] [-y yres] [-d bitdepth] "
         "bootblock payload outfile\n",
         progname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [91 x i8] c"usage: %s [-p #padding] [-v] [-x xres ] [-y yres] [-d bitdepth] bootblock payload outfile\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [91 x i8] c"usage: %s [-p #padding] [-v] [-x xres ] [-y yres] [-d bitdepth] bootblock payload outfile\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: demo <options> sample_rate channel filename\n"
                  "options:\n"
                  "	play\n"
                  "	rec\n");
  return;
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [72 x i8] c"usage: demo <options> sample_rate channel filename\0Aoptions:\0A\09play\0A\09rec\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [72 x i8] c"usage: demo <options> sample_rate channel filename\0Aoptions:\0A\09play\0A\09rec\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CNRFBRead1();
void CNRFBDump(int i) {
  while (i--)
    CNRFBRead1();
}


x86 assembly (clang, -O0):
<CNRFBDump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     113b <CNRFBDump+0x2b>
mov    $0x0,%al
call   1030 <CNRFBRead1@plt>
jmp    111b <CNRFBDump+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CNRFBDump>:
push   %rbx
test   %edi,%edi
je     112c <CNRFBDump+0x1c>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <CNRFBRead1@plt>
add    $0xffffffff,%ebx
jne    1120 <CNRFBDump+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @CNRFBDump(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ %0, %1 ]
%5 = add nsw i32 %4, -1
%6 = tail call i32 (...) @CNRFBRead1()
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
float LerpAngle(float from, float to, float frac) {
  if (to - from > 180) {
    to -= 360;
  }
  if (to - from < -180) {
    to += 360;
  }
  return (from + frac * (to - from));
}


x86 assembly (clang, -O0):
<LerpAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  0xedb(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    1144 <LerpAngle+0x44>
movss  -0x8(%rbp),%xmm0
movss  0xec9(%rip),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
movss  0xeb2(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1171 <LerpAngle+0x71>
movss  0xe9d(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LerpAngle>:
movaps %xmm1,%xmm3
subss  %xmm0,%xmm3
movss  0xef1(%rip),%xmm4
addss  %xmm1,%xmm4
movss  0xee9(%rip),%xmm5
cmpltss %xmm3,%xmm5
andps  %xmm5,%xmm4
andnps %xmm1,%xmm5
orps   %xmm4,%xmm5
movaps %xmm5,%xmm1
subss  %xmm0,%xmm1
movaps %xmm5,%xmm3
addss  0xecd(%rip),%xmm3
cmpltss 0xec8(%rip),%xmm1
andps  %xmm1,%xmm3
andnps %xmm5,%xmm1
orps   %xmm3,%xmm1
subss  %xmm0,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @LerpAngle(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %4
%9 = fsub float %7, %8
%10 = fcmp ogt float %9, 1.800000e+02
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load float, float* %5
%13 = fsub float %12, 3.600000e+02
store float %13, float* %5
br label %14
14: ; preds = %11, %3
%15 = load float, float* %5
%16 = load float, float* %4
%17 = fsub float %15, %16
%18 = fcmp olt float %17, -1.800000e+02
br i1 %18, label %19, label %22
19: ; preds = %14
%20 = load float, float* %5
%21 = fadd float %20, 3.600000e+02
store float %21, float* %5
br label %22
22: ; preds = %19, %14
%23 = load float, float* %4
%24 = load float, float* %6
%25 = load float, float* %5
%26 = load float, float* %4
%27 = fsub float %25, %26
%28 = call float @llvm.fmuladd.f32(float %24, float %27, float %23)
ret float %28
}

LLVM IR (-O2):
define float @LerpAngle(float %0, float %1, float %2) {
%4 = fsub float %1, %0
%5 = fcmp ogt float %4, 1.800000e+02
%6 = fadd float %1, -3.600000e+02
%7 = select i1 %5, float %6, float %1
%8 = fsub float %7, %0
%9 = fcmp olt float %8, -1.800000e+02
%10 = fadd float %7, 3.600000e+02
%11 = select i1 %9, float %10, float %7
%12 = fsub float %11, %0
%13 = tail call float @llvm.fmuladd.f32(float %2, float %12, float %0)
ret float %13
}
/* Variables and functions */
int /*<<< orphan*/ fac(int);
int getint();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ putint(int /*<<< orphan*/);
int main() {
  int a;
  a = getint();
  putint(fac(a));
  putchar(10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <getint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <fac@plt>
mov    %eax,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <getint@plt>
mov    %eax,%edi
call   1050 <fac@plt>
mov    %eax,%edi
call   1040 <putint@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getint()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @fac(i32 %4)
%6 = call i32 @putint(i32 %5)
%7 = call i32 @putchar(i32 10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getint()
%2 = tail call i32 @fac(i32 %1)
%3 = tail call i32 @putint(i32 %2)
%4 = tail call i32 @putchar(i32 10)
ret i32 0
}
void copy_edid(void) {}


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

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

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

LLVM IR (-O2):
define void @copy_edid() {
ret void
}
int __attribute__((weak)) wdt_feed(void) { return 0; }


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

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

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

LLVM IR (-O2):
define weak i32 @wdt_feed() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void swap(char dest_str[], char src_str[]) {
  char temp[12 + 69];
  strcpy(temp, dest_str);
  strcpy(dest_str, src_str);
  strcpy(src_str, temp);
}


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

x86 assembly (clang, -O2):
<swap>:
push   %r15
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [81 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [81 x i8], [81 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcpy(i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = alloca [81 x i8]
%4 = getelementptr inbounds [81 x i8], [81 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strcpy(i8* %0, i8* %1)
%7 = call i32 @strcpy(i8* %1, i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gameMain();
int main(void) {
  gameMain();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gameMain()
ret i32 0
}
/* Type definitions */
struct DynArr {
  int dummy;
};

/* Variables and functions */
scalar_t__ getDynArr(struct DynArr *, int);
int indexSmallest(struct DynArr *v, int i, int j) {
  if (((getDynArr(v, i)) < (getDynArr(v, j))))
    return i;
  return j;
}


x86 assembly (clang, -O0):
<indexSmallest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <getDynArr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <getDynArr@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jge    1159 <indexSmallest+0x49>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <indexSmallest+0x4f>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indexSmallest>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1030 <getDynArr@plt>
mov    %rax,%r15
mov    %rbp,%rdi
mov    %ebx,%esi
call   1030 <getDynArr@plt>
cmp    %rax,%r15
cmovl  %r14d,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define i32 @indexSmallest(%struct.DynArr* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.DynArr*
%6 = alloca i32
%7 = alloca i32
store %struct.DynArr* %0, %struct.DynArr** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load %struct.DynArr*, %struct.DynArr** %5
%9 = load i32, i32* %6
%10 = call i64 @getDynArr(%struct.DynArr* %8, i32 %9)
%11 = load %struct.DynArr*, %struct.DynArr** %5
%12 = load i32, i32* %7
%13 = call i64 @getDynArr(%struct.DynArr* %11, i32 %12)
%14 = icmp slt i64 %10, %13
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = load i32, i32* %6
store i32 %16, i32* %4
br label %19
17: ; preds = %3
%18 = load i32, i32* %7
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define i32 @indexSmallest(%struct.DynArr* %0, i32 %1, i32 %2) {
%4 = tail call i64 @getDynArr(%struct.DynArr* %0, i32 %1)
%5 = tail call i64 @getDynArr(%struct.DynArr* %0, i32 %2)
%6 = icmp slt i64 %4, %5
%7 = select i1 %6, i32 %1, i32 %2
ret i32 %7
}
void *dlopen(const char *filename, int flags) {
  POSIXCOMPAT_DEBUG("dlopen(%s)\n", filename);
  return (dlopen);
}


x86 assembly (clang, -O0):
<dlopen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <POSIXCOMPAT_DEBUG@plt>
mov    0x2ea0(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dlopen>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <POSIXCOMPAT_DEBUG@plt>
mov    0x2eaf(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"dlopen(%s)\0A\00"
define i8* @dlopen(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @POSIXCOMPAT_DEBUG to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i8* bitcast (i8* (i8*, i32)* @dlopen to i8*)
}

LLVM IR (-O2):
@.str = [12 x i8] c"dlopen(%s)\0A\00"
define i8* @dlopen(i8* %0, i32 %1) {
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @POSIXCOMPAT_DEBUG to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* bitcast (i8* (i8*, i32)* @dlopen to i8*)
}
int test_imm_E9uint32_mem(unsigned int *val) {
  return ((*val) & (0xE9 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E9uint32_mem>:
testb  $0xe9,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E9uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 233
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *s) {
  int counter;
  counter = 0;
  while (s[counter] != '\0') {
    ft_putchar(s[counter]);
    counter++;
  }
}


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

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

LLVM IR (-O0):
define void @ft_putstr(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 i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %4
%13 = load i8*, i8** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = call i32 @ft_putchar(i8 signext %17)
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
void *__memmove_down(void *, void const *, size_t);
void *(memcpy)(void *__dest, __const void *__src, size_t __n) {
  return __memmove_down(__dest, __src, __n);
}


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

x86 assembly (clang, -O2):
<memcpy>:
jmp    1030 <__memmove_down@plt>

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

LLVM IR (-O2):
define i8* @memcpy(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @__memmove_down(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
void __attribute__((weak, noreturn)) abort(void) { _exit(1); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define weak void @abort() {
%1 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define weak void @abort() {
%1 = tail call i32 @_exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ foo();
int /*<<< orphan*/ g();
void main() {
  g();
  foo();
  g();
  foo();
}


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

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

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @g()
%2 = call i32 (...) @foo()
%3 = call i32 (...) @g()
%4 = call i32 (...) @foo()
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @g()
%2 = tail call i32 (...) @foo()
%3 = tail call i32 (...) @g()
%4 = tail call i32 (...) @foo()
ret void
}
void strcpy_1(char *s, char *t) {
  int i = 0;
  while ((s[i] = t[i]) != '\0') {
    i++;
  }
}


x86 assembly (clang, -O0):
<strcpy_1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     1143 <strcpy_1+0x43>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <strcpy_1+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_1>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcpy_1+0x10>
ret

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

LLVM IR (-O2):
define void @strcpy_1(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %9, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add nuw i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  printf("국어 90\n수학 80\n영어 100\n합계 %d\n평균 %d\n", 90 + 80 + 100,
         (90 + 80 + 100) / 3);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"\EA\B5\AD\EC\96\B4 90\0A\EC\88\98\ED\95\99 80\0A\EC\98\81\EC\96\B4 100\0A\ED\95\A9\EA\B3\84 %d\0A\ED\8F\89\EA\B7\A0 %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 270, i32 90)
ret i32 0
}

LLVM IR (-O2):
@.str = [52 x i8] c"\EA\B5\AD\EC\96\B4 90\0A\EC\88\98\ED\95\99 80\0A\EC\98\81\EC\96\B4 100\0A\ED\95\A9\EA\B3\84 %d\0A\ED\8F\89\EA\B7\A0 %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i32 270, i32 90)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Msp430TimerCapComP__2__Compare__default__fired();
void Msp430TimerCapComP__2__Compare__fired(void) {
  Msp430TimerCapComP__2__Compare__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @Msp430TimerCapComP__2__Compare__fired() {
%1 = tail call i32 (...) @Msp430TimerCapComP__2__Compare__default__fired()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rotateRecur(int);
void rotateLogs() { rotateRecur(1); }


x86 assembly (clang, -O0):
<rotateLogs>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <rotateRecur@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rotateLogs() {
%1 = call i32 @rotateRecur(i32 1)
ret void
}

LLVM IR (-O2):
define void @rotateLogs() {
%1 = tail call i32 @rotateRecur(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ firefly_irqservice_init();
int /*<<< orphan*/ firefly_mem_map_init();
void init_main() {
  firefly_mem_map_init();
  firefly_irqservice_init();
}


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

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

LLVM IR (-O0):
define void @init_main() {
%1 = call i32 (...) @firefly_mem_map_init()
%2 = call i32 (...) @firefly_irqservice_init()
ret void
}

LLVM IR (-O2):
define void @init_main() {
%1 = tail call i32 (...) @firefly_mem_map_init()
%2 = tail call i32 (...) @firefly_irqservice_init()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ atomic_postsub_uint16_t(int /*<<< orphan*/ *, int);
uint16_t atomic_postdec_uint16_t(uint16_t *var) {
  return atomic_postsub_uint16_t(var, 1);
}


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

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

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

LLVM IR (-O2):
define i32 @atomic_postdec_uint16_t(i32* %0) {
%2 = tail call i32 @atomic_postsub_uint16_t(i32* %0, i32 1)
ret i32 %2
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dnansumors(int, double *, int);
int main() {
  double x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  double v = stdlib_strided_dnansumors(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x54(%rbp)
movl   $0x2,-0x58(%rbp)
mov    -0x54(%rbp),%edi
lea    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%edx
call   1040 <stdlib_strided_dnansumors@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dnansumors@plt>
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 0x7FF8000000000000, double 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [10 x double]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dnansumors(i32 %6, double* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 0x7FF8000000000000, double 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x double]
%2 = bitcast [10 x double]* %1 to i8*
%3 = getelementptr inbounds [10 x double], [10 x double]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dnansumors(i32 5, double* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ mystrncpy(char *, char const *, int);
char *cropnick(const char *nick, int nicklen) {
  static char nickbuf[128];
  mystrncpy(nickbuf, nick, nicklen + 1);
  return nickbuf;
}


x86 assembly (clang, -O0):
<cropnick>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0x2f10(%rip),%rdi
call   1030 <mystrncpy@plt>
lea    0x2f04(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cropnick>:
push   %rbx
mov    %rdi,%rax
lea    0x1(%rsi),%edx
lea    0x2f22(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <mystrncpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cropnick.nickbuf = internal global [128 x i8] zeroinitializer
define i8* @cropnick(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = call i32 @mystrncpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @cropnick.nickbuf, i64 0, i64 0), i8* %5, i32 %7)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @cropnick.nickbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@cropnick.nickbuf = internal global [128 x i8] zeroinitializer
define i8* @cropnick(i8* %0, i32 %1) {
%3 = add nsw i32 %1, 1
%4 = tail call i32 @mystrncpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @cropnick.nickbuf, i64 0, i64 0), i8* %0, i32 %3)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @cropnick.nickbuf, i64 0, i64 0)
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  char *decimal_point;
};

/* Variables and functions */
TYPE_1__ *localeconv();
char *strchr(char *, char);
void to_locale(char *str) {
  const char *point;
  char *pos;
  point = localeconv()->decimal_point;
  if (*point == '.') {
    return;
  }
  pos = strchr(str, '.');
  if (pos)
    *pos = *point;
}


x86 assembly (clang, -O0):
<to_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <localeconv@plt>
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    114f <to_locale+0x2f>
jmp    1178 <to_locale+0x58>
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1178 <to_locale+0x58>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_locale>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1030 <localeconv@plt>
mov    (%rax),%rax
mov    (%rax),%bl
cmp    $0x2e,%bl
je     114c <to_locale+0x2c>
mov    %r14,%rdi
mov    $0x2e,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     114c <to_locale+0x2c>
mov    %bl,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @to_locale(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = call %struct.TYPE_2__* (...) @localeconv()
%6 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %5, i32 0, i32 0
%7 = load i8*, i8** %6
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 46
br i1 %11, label %12, label %13
12: ; preds = %1
br label %22
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i8* @strchr(i8* %14, i8 signext 46)
store i8* %15, i8** %4
%16 = load i8*, i8** %4
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
%21 = load i8*, i8** %4
store i8 %20, i8* %21
br label %22
22: ; preds = %12, %18, %13
ret void
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i8* }
define void @to_locale(i8* %0) {
%2 = tail call %struct.TYPE_2__* (...) @localeconv()
%3 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %2, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 46
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 46)
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %7
store i8 %5, i8* %8
br label %11
11: ; preds = %7, %10, %1
ret void
}
int main() {
  int a;
  &a;
  return 3;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
void just_a_wild_function_never_called(int32_t x) {
  int32_t check_param = 0;
  if (0 != x) {
    check_param = check_param / 0;
  }
}


x86 assembly (clang, -O0):
<just_a_wild_function_never_called>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     112b <just_a_wild_function_never_called+0x2b>
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @just_a_wild_function_never_called(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = icmp ne i64 0, %4
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %3
%8 = sdiv i64 %7, 0
store i64 %8, i64* %3
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @just_a_wild_function_never_called(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteBlockHDMITX_CAT(int, int, unsigned char *);
void CAT_Set_Interrupt_Masks(unsigned char *data) {
  WriteBlockHDMITX_CAT(0x09, 3, data);
}


x86 assembly (clang, -O0):
<CAT_Set_Interrupt_Masks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x9,%edi
mov    $0x3,%esi
call   1030 <WriteBlockHDMITX_CAT@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CAT_Set_Interrupt_Masks>:
mov    %rdi,%rdx
mov    $0x9,%edi
mov    $0x3,%esi
jmp    1030 <WriteBlockHDMITX_CAT@plt>

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

LLVM IR (-O2):
define void @CAT_Set_Interrupt_Masks(i8* %0) {
%2 = tail call i32 @WriteBlockHDMITX_CAT(i32 9, i32 3, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func2() { printf("func2\n"); }


x86 assembly (clang, -O0):
<func2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"func2\0A\00"
define void @func2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"func2\00"
define void @func2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char const *getenv(char *);
const char *IoTHubAccount_GetSharedAccessSignature(void) {
  return getenv("IOTHUB_SHARED_ACCESS_SIGNATURE");
}


x86 assembly (clang, -O0):
<IoTHubAccount_GetSharedAccessSignature>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <getenv@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [31 x i8] c"IOTHUB_SHARED_ACCESS_SIGNATURE\00"
define i8* @IoTHubAccount_GetSharedAccessSignature() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [31 x i8] c"IOTHUB_SHARED_ACCESS_SIGNATURE\00"
define i8* @IoTHubAccount_GetSharedAccessSignature() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void shift(int x[], int d, int steps) {
  x[d] = (x[d] + steps + 2) % 2;
  return;
}


x86 assembly (clang, -O0):
<shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
add    $0x2,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
lea    (%rdx,%rcx,1),%esi
add    $0x2,%esi
add    %ecx,%edx
mov    %esi,%ecx
shr    $0x1f,%ecx
add    %edx,%ecx
add    $0x2,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%esi
mov    %esi,(%rdi,%rax,4)
ret

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

LLVM IR (-O2):
define void @shift(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = add i32 %2, 2
%8 = add i32 %7, %6
%9 = srem i32 %8, 2
store i32 %9, i32* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VT_Transmit(char);
void VT_SendChar(char c) { VT_Transmit(c); }


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

x86 assembly (clang, -O2):
<VT_SendChar>:
jmp    1030 <VT_Transmit@plt>

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

LLVM IR (-O2):
define void @VT_SendChar(i8 signext %0) {
%2 = tail call i32 @VT_Transmit(i8 signext %0)
ret void
}
/* Type definitions */
struct nodod {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int i;
  struct nodod *ldeInicio = NULL;
  struct nodod *ldeFim = NULL;
  srand(time(NULL));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.nodod = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.nodod*
%4 = alloca %struct.nodod*
store i32 0, i32* %1
store %struct.nodod* null, %struct.nodod** %3
store %struct.nodod* null, %struct.nodod** %4
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
ret i32 0
}

LLVM IR (-O2):
%struct.nodod = type { i32 }
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret i32 0
}
/* Variables and functions */
int exp(double);
int sqrt(int);
double PDFNormal(double x, double mu, double sigma2) {
  return 1 / sqrt(2 * 3.1415926535897932384626433832795 * sigma2) *
         exp(-.5 / sigma2 * (x - mu) * (x - mu));
}


x86 assembly (clang, -O0):
<PDFNormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xec9(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
movsd  0xe9e(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PDFNormal>:
push   %rbx
sub    $0x20,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,0x18(%rsp)
movsd  %xmm0,0x10(%rsp)
movsd  0xec1(%rip),%xmm0
mulsd  %xmm2,%xmm0
cvttsd2si %xmm0,%edi
call   1040 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %ebx,%ebx
cmp    $0x3,%ecx
cmovb  %eax,%ebx
movsd  0xea9(%rip),%xmm0
divsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  0x18(%rsp),%xmm1
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
call   1030 <exp@plt>
imul   %ebx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @PDFNormal(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* %6
%8 = fmul double 0x401921FB54442D18, %7
%9 = fptosi double %8 to i32
%10 = call i32 @sqrt(i32 %9)
%11 = sdiv i32 1, %10
%12 = load double, double* %6
%13 = fdiv double -5.000000e-01, %12
%14 = load double, double* %4
%15 = load double, double* %5
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %4
%19 = load double, double* %5
%20 = fsub double %18, %19
%21 = fmul double %17, %20
%22 = call i32 @exp(double %21)
%23 = mul nsw i32 %11, %22
%24 = sitofp i32 %23 to double
ret double %24
}

LLVM IR (-O2):
define double @PDFNormal(double %0, double %1, double %2) {
%4 = fmul double %2, 0x401921FB54442D18
%5 = fptosi double %4 to i32
%6 = tail call i32 @sqrt(i32 %5)
%7 = add i32 %6, 1
%8 = icmp ult i32 %7, 3
%9 = select i1 %8, i32 %6, i32 0
%10 = fdiv double -5.000000e-01, %2
%11 = fsub double %0, %1
%12 = fmul double %11, %10
%13 = fmul double %11, %12
%14 = tail call i32 @exp(double %13)
%15 = mul nsw i32 %9, %14
%16 = sitofp i32 %15 to double
ret double %16
}
/* Variables and functions */
int system(char *);
int main() {
  int retval = system("ls -al ~");
  return retval;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [9 x i8] c"ls -al ~\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
store i32 %3, i32* %2
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
@.str = [9 x i8] c"ls -al ~\00"
define i32 @main() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}