xunge/DecIR huggingface dataset:
AR0I1(r0, r1, x0, x1, p0, p1) char r0, r1;
char *p0, *p1;
{ (p0[10000000]) = 33; }


x86 assembly (clang, -O0):
<AR0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x21,0x989680(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0I1>:
movb   $0x21,0x989680(%r8)
21
ret

LLVM IR (-O0):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8
%9 = alloca i8
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = trunc i32 %0 to i8
%15 = trunc i32 %1 to i8
store i8 %14, i8* %8
store i8 %15, i8* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%16 = load i8*, i8** %12
%17 = getelementptr inbounds i8, i8* %16, i64 10000000
store i8 33, i8* %17
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @AR0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture writeonly %4, i8* nocapture readnone %5) {
%7 = getelementptr inbounds i8, i8* %4, i64 10000000
store i8 33, i8* %7
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0xa8() {
  Assert_real((isspace(168) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isspace.c",
              845, ("isspace should be 0 for 0xa8"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0xa8>:
push   %rax
mov    $0xa8,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x34d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xa8\00"
define void @t_isspace_0xa8() {
%1 = call i64 @isspace(i32 168)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 845, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0xa8\00"
define void @t_isspace_0xa8() {
%1 = tail call i64 @isspace(i32 168)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 845, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_imm(int);
int /*<<< orphan*/ write_instr(int);
int bksp_handler(char **save) {
  write_instr(0x00);
  write_imm(0x2A);
  write_instr(0x28);
  return 0;
}


x86 assembly (clang, -O0):
<bksp_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x2a,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bksp_handler>:
push   %rax
xor    %edi,%edi
call   1040 <write_instr@plt>
mov    $0x2a,%edi
call   1030 <write_imm@plt>
mov    $0x28,%edi
call   1040 <write_instr@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bksp_handler(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @write_instr(i32 0)
%4 = call i32 @write_imm(i32 42)
%5 = call i32 @write_instr(i32 40)
ret i32 0
}

LLVM IR (-O2):
define i32 @bksp_handler(i8** nocapture readnone %0) {
%2 = tail call i32 @write_instr(i32 0)
%3 = tail call i32 @write_imm(i32 42)
%4 = tail call i32 @write_instr(i32 40)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EBADF;
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __dup2(int fd, int fd2) {
  if (fd < 0 || fd2 < 0) {
    __set_errno(EBADF);
    return -1;
  }
  if (fd == fd2)
    return fd2;
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__dup2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1132 <__dup2+0x22>
cmpl   $0x0,-0xc(%rbp)
jge    114c <__dup2+0x3c>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <__dup2+0x68>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1163 <__dup2+0x53>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <__dup2+0x68>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dup2>:
push   %rax
mov    %esi,%ecx
or     %edi,%ecx
js     1126 <__dup2+0x16>
mov    %esi,%eax
cmp    %esi,%edi
je     1139 <__dup2+0x29>
mov    0x2ec4(%rip),%rax
jmp    112d <__dup2+0x1d>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @__dup2(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 = icmp slt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8, %2
%12 = load i32, i32* @EBADF
%13 = call i32 @__set_errno(i32 %12)
store i32 -1, i32* %3
br label %23
14: ; preds = %8
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = icmp eq i32 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %14
%19 = load i32, i32* %5
store i32 %19, i32* %3
br label %23
20: ; preds = %14
%21 = load i32, i32* @ENOSYS
%22 = call i32 @__set_errno(i32 %21)
store i32 -1, i32* %3
br label %23
23: ; preds = %20, %18, %11
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@EBADF = global i32 0
@ENOSYS = global i32 0
define i32 @__dup2(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = icmp eq i32 %0, %1
br i1 %6, label %11, label %7
7: ; preds = %5, %2
%8 = phi i32* [ @EBADF, %2 ], [ @ENOSYS, %5 ]
%9 = load i32, i32* %8
%10 = tail call i32 @__set_errno(i32 %9)
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ %1, %5 ], [ -1, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ SetHighlights(int, int, int, int);
void ClearHighlights() { SetHighlights(-1, -1, -1, -1); }


x86 assembly (clang, -O0):
<ClearHighlights>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
call   1030 <SetHighlights@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearHighlights>:
mov    $0xffffffff,%edi
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
mov    $0xffffffff,%ecx
jmp    1030 <SetHighlights@plt>

LLVM IR (-O0):
define void @ClearHighlights() {
%1 = call i32 @SetHighlights(i32 -1, i32 -1, i32 -1, i32 -1)
ret void
}

LLVM IR (-O2):
define void @ClearHighlights() {
%1 = tail call i32 @SetHighlights(i32 -1, i32 -1, i32 -1, i32 -1)
ret void
}
float wy2u01(unsigned r) {
  const float _wynorm = 1.0f / (1ull << 23);
  return (r >> 9) * _wynorm;
}


x86 assembly (clang, -O0):
<wy2u01>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x34000000,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x9,%eax
cvtsi2ss %eax,%xmm0
movss  0xee0(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<wy2u01>:
shr    $0x9,%edi
cvtsi2ss %edi,%xmm0
mulss  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define float @wy2u01(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
store float 0x3E80000000000000, float* %3
%4 = load i32, i32* %2
%5 = lshr i32 %4, 9
%6 = uitofp i32 %5 to float
%7 = fmul float %6, 0x3E80000000000000
ret float %7
}

LLVM IR (-O2):
define float @wy2u01(i32 %0) {
%2 = lshr i32 %0, 9
%3 = uitofp i32 %2 to float
%4 = fmul float %3, 0x3E80000000000000
ret float %4
}
void USB_EnableSofInt(void) {}


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

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

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

LLVM IR (-O2):
define void @USB_EnableSofInt() {
ret void
}
int str_tolower(char *src) {
  int i, c;
  for (i = 0; (c = src[i]) != '\0'; i++) {
    if (c >= 'A' && c <= 'Z')
      src[i] = c + 'a' - 'A';
  }
  return i;
}


x86 assembly (clang, -O0):
<str_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1164 <str_tolower+0x64>
cmpl   $0x41,-0x10(%rbp)
jl     1151 <str_tolower+0x51>
cmpl   $0x5a,-0x10(%rbp)
jg     1151 <str_tolower+0x51>
mov    -0x10(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    1156 <str_tolower+0x56>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <str_tolower+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_tolower>:
mov    (%rdi),%cl
xor    %eax,%eax
jmp    1119 <str_tolower+0x19>
cs nopw 0x0(%rax,%rax,1)
movzbl 0x1(%rdi,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
je     112d <str_tolower+0x2d>
lea    -0x41(%rcx),%edx
cmp    $0x19,%dl
ja     1110 <str_tolower+0x10>
add    $0x20,%cl
mov    %cl,(%rdi,%rax,1)
jmp    1110 <str_tolower+0x10>
ret

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

LLVM IR (-O2):
define i32 @str_tolower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %12
%5 = phi i64 [ %13, %12 ], [ 0, %1 ]
%6 = phi i8 [ %15, %12 ], [ %2, %1 ]
%7 = phi i8* [ %14, %12 ], [ %0, %1 ]
%8 = add i8 %6, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add nuw nsw i8 %6, 32
store i8 %11, i8* %7
br label %12
12: ; preds = %4, %10
%13 = add nuw i64 %5, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12
%18 = trunc i64 %13 to i32
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 0, %1 ], [ %18, %17 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void setdefaultcolor(void) {
  printf("\x1b["
         "0m");
}


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
define void @setdefaultcolor() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
int scaleColor(int color, int numColorsIn, int numColorsOut) {
  return (color * (numColorsOut - 1) + (numColorsIn - 1) / 2) /
         (numColorsIn - 1);
}


x86 assembly (clang, -O0):
<scaleColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
imul   %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<scaleColor>:
lea    -0x1(%rdx),%ecx
imul   %edi,%ecx
mov    %esi,%edi
add    $0xffffffff,%edi
mov    %edi,%eax
shr    $0x1f,%eax
add    %esi,%eax
add    $0xffffffff,%eax
sar    %eax
add    %ecx,%eax
cltd
idiv   %edi
ret

LLVM IR (-O0):
define i32 @scaleColor(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* %6
%9 = sub nsw i32 %8, 1
%10 = mul nsw i32 %7, %9
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %12, 2
%14 = add nsw i32 %10, %13
%15 = load i32, i32* %5
%16 = sub nsw i32 %15, 1
%17 = sdiv i32 %14, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @scaleColor(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = mul nsw i32 %4, %0
%6 = add nsw i32 %1, -1
%7 = sdiv i32 %6, 2
%8 = add nsw i32 %5, %7
%9 = sdiv i32 %8, %6
ret i32 %9
}
__attribute__((no, noclone)) void fn3(void *x, unsigned y, const struct S *z,
                                      unsigned w) {
  __asm__ volatile("" : : "r"(x), "r"(y), "r"(z), "r"(w) : "memory");
}


x86 assembly (clang, -O0):
<fn3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%esi
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type opaque
define void @fn3(i8* %0, i32 %1, %struct.S* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca %struct.S*
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store %struct.S* %2, %struct.S** %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load %struct.S*, %struct.S** %7
%12 = load i32, i32* %8
ret void
}

LLVM IR (-O2):
%struct.S = type opaque
define void @fn3(i8* %0, i32 %1, %struct.S* %2, i32 %3) {
tail call void asm sideeffect "", "r,r,r,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i32 %1, %struct.S* %2, i32 %3)
ret void
}
char cutStrFrom(char *str, int ind) {
  if (ind <= strlen(str)) {
    return substr(str, ind, strlen(str) - 1);
  }
  return "_" + str[0];
}


x86 assembly (clang, -O0):
<cutStrFrom>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
ja     1184 <cutStrFrom+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    %rax,%rdx
sub    $0x1,%rdx
mov    $0x0,%al
call   1040 <substr@plt>
mov    %al,-0x1(%rbp)
jmp    119b <cutStrFrom+0x7b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movslq %eax,%rcx
lea    0xe6b(%rip),%rax
add    %rcx,%rax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutStrFrom>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
movslq %esi,%rbp
call   1030 <strlen@plt>
cmp    %rbp,%rax
jae    1145 <cutStrFrom+0x25>
movzbl (%rbx),%ecx
lea    0xebf(%rip),%rax
add    %ecx,%eax
jmp    1159 <cutStrFrom+0x39>
add    $0xffffffffffffffff,%rax
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1040 <substr@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"_\00"
define signext i8 @cutStrFrom(i8* %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = icmp ule i64 %7, %9
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = load i8*, i8** %4
%15 = call i64 @strlen(i8* %14)
%16 = sub i64 %15, 1
%17 = call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @substr to i32 (i8*, i32, i64, ...)*)(i8* %12, i32 %13, i64 %16)
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
br label %27
19: ; preds = %2
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i64 %24
%26 = ptrtoint i8* %25 to i8
store i8 %26, i8* %3
br label %27
27: ; preds = %19, %11
%28 = load i8, i8* %3
ret i8 %28
}

LLVM IR (-O2):
@.str = [2 x i8] c"_\00"
define signext i8 @cutStrFrom(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = icmp ult i64 %4, %3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = add i64 %4, -1
%8 = tail call i32 (i8*, i32, i64, ...) bitcast (i32 (...)* @substr to i32 (i8*, i32, i64, ...)*)(i8* %0, i32 %1, i64 %7)
%9 = trunc i32 %8 to i8
br label %16
10: ; preds = %2
%11 = load i8, i8* %0
%12 = sext i8 %11 to i64
%13 = getelementptr inbounds [2 x i8], [2 x i8]* @.str, i64 0, i64 %12
%14 = ptrtoint i8* %13 to i64
%15 = trunc i64 %14 to i8
br label %16
16: ; preds = %10, %6
%17 = phi i8 [ %9, %6 ], [ %15, %10 ]
ret i8 %17
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main() {
  FILE *fp;
  fp = fopen("test.txt", "a");
  fprintf(fp, "Testing...\n");
  int b;
  if (b)
    return 1;
  fclose(fp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaa(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x14(%rbp)
je     117c <main+0x4c>
movl   $0x1,-0x4(%rbp)
jmp    118c <main+0x5c>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xeca(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %13
10: ; preds = %0
%11 = load i32*, i32** %2
%12 = call i32 @fclose(i32* %11)
store i32 0, i32* %1
br label %13
13: ; preds = %10, %9
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@.str.1 = [2 x i8] c"a\00"
@.str.2 = [12 x i8] c"Testing...\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i64 11, i64 1, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void lily_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<lily_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @lily_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Mon "
         "Oct 15 16:23:54 KST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 "
         "USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Mon Oct 15 16:23:54 KST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Mon Oct 15 16:23:54 KST 2012 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
int fun449() { return 449; }


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

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

LLVM IR (-O0):
define i32 @fun449() {
ret i32 449
}

LLVM IR (-O2):
define i32 @fun449() {
ret i32 449
}
int op(a, b) { return a / b; }


x86 assembly (clang, -O0):
<op>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<op>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @op(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* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @op(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
char ms_max(unsigned n) {}


x86 assembly (clang, -O0):
<ms_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define signext i8 @ms_max(i32 %0) {
ret i8 undef
}
int test_imm_FBuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xFB << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_FBuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 251
%6 = icmp ne i64 %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_FBuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 251
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ DATA_output();
int /*<<< orphan*/ LibraryHeader(char *, char *);
int /*<<< orphan*/ STARTUP_output();
LIBRARY_output() {
  LibraryHeader("output", "Sat Feb  1 10:41:19 2014 ");
  DATA_output();
  STARTUP_output();
}


x86 assembly (clang, -O0):
<LIBRARY_output>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xec1(%rip),%rsi
call   1050 <LibraryHeader@plt>
mov    $0x0,%al
call   1030 <DATA_output@plt>
mov    $0x0,%al
call   1040 <STARTUP_output@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBRARY_output>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <LibraryHeader@plt>
xor    %eax,%eax
call   1030 <DATA_output@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <STARTUP_output@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"output\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:19 2014 \00"
define i32 @LIBRARY_output() {
%1 = alloca i32
%2 = call i32 @LibraryHeader(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 (...) @DATA_output()
%4 = call i32 (...) @STARTUP_output()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str = [7 x i8] c"output\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:19 2014 \00"
define i32 @LIBRARY_output() {
%1 = tail call i32 @LibraryHeader(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @DATA_output()
%3 = tail call i32 (...) @STARTUP_output()
ret i32 undef
}
int __libc_current_sigrtmin() { return 35; }


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

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

LLVM IR (-O0):
define i32 @__libc_current_sigrtmin() {
ret i32 35
}

LLVM IR (-O2):
define i32 @__libc_current_sigrtmin() {
ret i32 35
}
void test12(void) { __builtin_trap(); }


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

x86 assembly (clang, -O2):
<test12>:
ud2

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

LLVM IR (-O2):
define void @test12() {
tail call void @llvm.trap()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int, int);
void version(char *name) { printf("%s version %d.%d.%d\n", name, 0, 1, 13); }


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

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0xd,%r8d
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 1, i32 13)
ret void
}
unsigned xrop3_88_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S | T;
  stk2 = D & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_88_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_88_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %edi,%esi
xor    %esi,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_88_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %5
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = and i32 %36, %37
%39 = or i32 %35, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @xrop3_88_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i8 %1, %0
%8 = zext i8 %7 to i32
%9 = xor i32 %6, %8
%10 = xor i32 %4, -1
%11 = and i32 %9, %10
%12 = or i32 %11, %3
ret i32 %12
}
/* Variables and functions */
int check_arg_count(int, int);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_error(char *);
void cmd_wadd_wchnstr(int nargs, char **args) {
  if (check_arg_count(nargs, 1) == 1)
    return;
  report_count(1);
  report_error("UNSUPPORTED");
}


x86 assembly (clang, -O0):
<cmd_wadd_wchnstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    115a <cmd_wadd_wchnstr+0x2a>
jmp    1170 <cmd_wadd_wchnstr+0x40>
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xe95(%rip),%rdi
call   1050 <report_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_wadd_wchnstr>:
push   %rax
mov    $0x1,%esi
call   1030 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1142 <cmd_wadd_wchnstr+0x12>
pop    %rax
ret
mov    $0x1,%edi
call   1040 <report_count@plt>
lea    0xead(%rip),%rdi
pop    %rax
jmp    1050 <report_error@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wadd_wchnstr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @check_arg_count(i32 %5, i32 1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %2
br label %12
9: ; preds = %2
%10 = call i32 @report_count(i32 1)
%11 = call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"UNSUPPORTED\00"
define void @cmd_wadd_wchnstr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @check_arg_count(i32 %0, i32 1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @report_count(i32 1)
%7 = tail call i32 @report_error(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %5
ret void
}
void do_list(int argc, char *argv[], int start) {
  (void)argc;
  (void)argv;
  (void)start;
}


x86 assembly (clang, -O0):
<do_list>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @do_list(i32 %0, i8** nocapture %1, i32 %2) {
ret void
}
int numa_preferred(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @numa_preferred() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  while (1)
    sleep(60);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x3c,%edi
call   1030 <sleep@plt>
jmp    1126 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3c,%edi
call   1030 <sleep@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2, %6
%7 = call i32 @sleep(i32 60)
br label %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = tail call i32 @sleep(i32 60)
br label %3
}
void acc_vadd(int *sI1, int *sI2, int *mO1) {
#pragma HLS INTERFACE ap_ctrl_none port = return
#pragma empty_line
#pragma HLS INTERFACE axis depth = 16 port = sI1
#pragma HLS INTERFACE axis depth = 16 port = sI2
#pragma HLS INTERFACE axis depth = 16 port = mO1
#pragma empty_line
  *mO1 = *sI1 + *sI2;
#pragma empty_line
}


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

x86 assembly (clang, -O2):
<acc_vadd>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @acc_vadd(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* %7
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
%12 = load i32*, i32** %6
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @acc_vadd(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
store i32 %6, i32* %2
ret void
}
int dec(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<dec>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @dec(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Type definitions */
struct vec3i {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ vec3i_multiply(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *);
__attribute__((always_)) struct vec3i *
psvec3i_multiply(struct vec3i *result, struct vec3i *a, struct vec3i *b) {
  vec3i_multiply((int32_t *)result, (int32_t *)a, (int32_t *)b);
  return result;
}


x86 assembly (clang, -O0):
<psvec3i_multiply>:
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 <vec3i_multiply@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3i_multiply>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3i_multiply@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_multiply(%struct.vec3i* %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = alloca %struct.vec3i*
%5 = alloca %struct.vec3i*
%6 = alloca %struct.vec3i*
store %struct.vec3i* %0, %struct.vec3i** %4
store %struct.vec3i* %1, %struct.vec3i** %5
store %struct.vec3i* %2, %struct.vec3i** %6
%7 = load %struct.vec3i*, %struct.vec3i** %4
%8 = bitcast %struct.vec3i* %7 to i32*
%9 = load %struct.vec3i*, %struct.vec3i** %5
%10 = bitcast %struct.vec3i* %9 to i32*
%11 = load %struct.vec3i*, %struct.vec3i** %6
%12 = bitcast %struct.vec3i* %11 to i32*
%13 = call i32 @vec3i_multiply(i32* %8, i32* %10, i32* %12)
%14 = load %struct.vec3i*, %struct.vec3i** %4
ret %struct.vec3i* %14
}

LLVM IR (-O2):
%struct.vec3i = type { i32 }
define %struct.vec3i* @psvec3i_multiply(%struct.vec3i* returned %0, %struct.vec3i* %1, %struct.vec3i* %2) {
%4 = getelementptr %struct.vec3i, %struct.vec3i* %0, i64 0, i32 0
%5 = getelementptr %struct.vec3i, %struct.vec3i* %1, i64 0, i32 0
%6 = getelementptr %struct.vec3i, %struct.vec3i* %2, i64 0, i32 0
%7 = tail call i32 @vec3i_multiply(i32* %4, i32* %5, i32* %6)
ret %struct.vec3i* %0
}
/* Variables and functions */
int /*<<< orphan*/ slarnv_(int *, int *, int *, float *);
void aa_cla_slarnv(int idist, int iseed[4], int n, float *X) {
  slarnv_(&idist, iseed, &n, X);
}


x86 assembly (clang, -O0):
<aa_cla_slarnv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
call   1030 <slarnv_@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aa_cla_slarnv>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rdi
mov    %rsp,%rdx
call   1030 <slarnv_@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @aa_cla_slarnv(i32 %0, i32* %1, i32 %2, float* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca float*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store float* %3, float** %8
%9 = load i32*, i32** %6
%10 = load float*, float** %8
%11 = call i32 @slarnv_(i32* %5, i32* %9, i32* %7, float* %10)
ret void
}

LLVM IR (-O2):
define void @aa_cla_slarnv(i32 %0, i32* %1, i32 %2, float* %3) {
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %5
store i32 %2, i32* %6
%7 = call i32 @slarnv_(i32* %5, i32* %1, i32* %6, float* %3)
ret void
}
void output_accumulated_spaces(int *prv_spaces, char **dst) {
  for (; *prv_spaces > 0; (*prv_spaces)--)
    *((*dst)++) = ' ';
}


x86 assembly (clang, -O0):
<output_accumulated_spaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,(%rax)
jle    113d <output_accumulated_spaces+0x3d>
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0xffffffff,%ecx
mov    %ecx,(%rax)
jmp    110c <output_accumulated_spaces+0xc>
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_accumulated_spaces>:
cmpl   $0x0,(%rdi)
jle    1129 <output_accumulated_spaces+0x29>
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rsi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rsi)
movb   $0x20,(%rax)
mov    (%rdi),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,(%rdi)
cmp    $0x1,%eax
jg     1110 <output_accumulated_spaces+0x10>
ret

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

LLVM IR (-O2):
define void @output_accumulated_spaces(i32* nocapture %0, i8** nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2, %5
%6 = load i8*, i8** %1
%7 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %7, i8** %1
store i8 32, i8* %6
%8 = load i32, i32* %0
%9 = add nsw i32 %8, -1
store i32 %9, i32* %0
%10 = icmp sgt i32 %8, 1
br i1 %10, label %5, label %11
11: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void printArr(char *a, int end, int start) {
  int i;
  for (i = end; i >= start; i--) {
    printf("%d", a[i]);
  }
}


x86 assembly (clang, -O0):
<printArr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     115a <printArr+0x4a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xebd(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1128 <printArr+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    %edx,%esi
jl     1147 <printArr+0x37>
mov    %rdi,%r15
movslq %esi,%rbx
movslq %edx,%r12
add    $0x1,%rbx
lea    0xed0(%rip),%r14
movsbl -0x1(%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%rbx
cmp    %r12,%rbx
jg     1130 <printArr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printArr(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %15, label %5
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %6, %5 ], [ %13, %8 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = add nsw i64 %9, -1
%14 = icmp sgt i64 %9, %7
br i1 %14, label %8, label %15
15: ; preds = %8, %3
ret void
}
int dlm_debug_init(struct dlm_ctxt *dlm) { return 0; }


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

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

LLVM IR (-O0):
%struct.dlm_ctxt = type opaque
define i32 @dlm_debug_init(%struct.dlm_ctxt* %0) {
%2 = alloca %struct.dlm_ctxt*
store %struct.dlm_ctxt* %0, %struct.dlm_ctxt** %2
ret i32 0
}

LLVM IR (-O2):
%struct.dlm_ctxt = type opaque
define i32 @dlm_debug_init(%struct.dlm_ctxt* nocapture readnone %0) {
ret i32 0
}
int string_length(char *s) {
  int c = 0;
  while (0 != s[0]) {
    c = c + 1;
    s = s + 1;
  }
  c = (c | 0x3) + 1;
  return c;
}


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     113a <string_length+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <string_length+0xf>
mov    -0xc(%rbp),%eax
or     $0x3,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
cmpb   $0x0,(%rdi)
je     1122 <string_length+0x22>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <string_length+0x10>
or     $0x3,%eax
add    $0x1,%eax
ret
mov    $0x4,%eax
ret

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

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