xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char const *, char);
const char *basename(const char *str) {
  const char *result = str;
  char *t = strrchr(str, '/');
  if (t == 0)
    t = strrchr(str, '\\');
  if (t)
    result = t + 1;
  return result;
}


x86 assembly (clang, -O0):
<basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <basename+0x43>
mov    -0x8(%rbp),%rdi
mov    $0x5c,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116a <basename+0x5a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i8* @basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 92)
br label %6
6: ; preds = %4, %1
%7 = phi i8* [ %5, %4 ], [ %2, %1 ]
%8 = icmp eq i8* %7, null
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = select i1 %8, i8* %0, i8* %9
ret i8* %10
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_message_get_auto_start(void *m) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_message_get_auto_start>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_message_get_auto_start>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_auto_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_message_get_auto_start(i8* nocapture readnone %0) {
%2 = load i32, i32* @EINVAL
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __int_memcpy(void *, void const *, size_t);
void __long_int_memcpy(void *__restrict s1, const void *__restrict s2,
                       size_t n) {
  __int_memcpy(s1, s2, n);
}


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

x86 assembly (clang, -O2):
<__long_int_memcpy>:
jmp    1030 <__int_memcpy@plt>

LLVM IR (-O0):
define void @__long_int_memcpy(i8* noalias %0, i8* noalias %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 i32 @__int_memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @__long_int_memcpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i32 @__int_memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
char ConvertColorFromStorage(char);
void ConvertColorsFromStorage(char *colors, int length) {
  int i;
  for (i = 0; i < length; i++) {
    colors[i] = ConvertColorFromStorage(colors[i]);
  }
}


x86 assembly (clang, -O0):
<ConvertColorsFromStorage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <ConvertColorsFromStorage+0x4e>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ConvertColorFromStorage@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <ConvertColorsFromStorage+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConvertColorsFromStorage>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <ConvertColorsFromStorage+0x37>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <ConvertColorFromStorage@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <ConvertColorsFromStorage+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @ConvertColorsFromStorage(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @ConvertColorFromStorage(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
float remainingAngle(float firstAngle, float secondAngle) {
  float thirdAngle = 180 - (firstAngle + secondAngle);
  return thirdAngle;
}


x86 assembly (clang, -O0):
<remainingAngle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
addss  -0x8(%rbp),%xmm1
movss  0xee0(%rip),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<remainingAngle>:
addss  %xmm1,%xmm0
movss  0xef4(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @remainingAngle(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = fsub float 1.800000e+02, %8
store float %9, float* %5
%10 = load float, float* %5
ret float %10
}

LLVM IR (-O2):
define float @remainingAngle(float %0, float %1) {
%3 = fadd float %0, %1
%4 = fsub float 1.800000e+02, %3
ret float %4
}
void SysCtlReset(void) {
  (*((volatile unsigned long *)(0xE000ED0C))) = 0x05FA0000 | 0x00000004;
  while (1) {
  }
}


x86 assembly (clang, -O0):
<SysCtlReset>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe000ed0c,%eax
movq   $0x5fa0004,(%rax)
jmp    1110 <SysCtlReset+0x10>

x86 assembly (clang, -O2):
<SysCtlReset>:
mov    $0xe000ed0c,%eax
movq   $0x5fa0004,(%rax)
nopl   0x0(%rax)
jmp    1110 <SysCtlReset+0x10>

LLVM IR (-O0):
define void @SysCtlReset() {
store volatile i64 100270084, i64* inttoptr (i64 3758157068 to i64*)
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @SysCtlReset() {
store volatile i64 100270084, i64* inttoptr (i64 3758157068 to i64*)
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *realloc(void *, size_t);
void *REALLOC(void *ptr, size_t size) {
  void *temp = realloc(ptr, size);
  assert(temp);
  return temp;
}


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

x86 assembly (clang, -O2):
<REALLOC>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @REALLOC(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = tail call i32 @assert(i8* %3)
ret i8* %3
}
int main(void) {
  int a;
  int __cil_tmp2;
  {
    a = 6;
    a = 0;
    {
      while (1) {
      while_0_continue:;
        if (a < 6) {
        } else {
          goto while_0_break;
        }
        a = a + 1;
      }
    while_0_break:;
    }
    {
      __cil_tmp2 = a == 6;
      if (!__cil_tmp2) {
      ERROR:
        goto ERROR;
      } else {
      }
    }
    return (1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    111e <main+0x1e>
cmpl   $0x6,-0x8(%rbp)
jge    112d <main+0x2d>
jmp    1132 <main+0x32>
jmp    1140 <main+0x40>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
cmpl   $0x6,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1163 <main+0x63>
jmp    115e <main+0x5e>
jmp    115e <main+0x5e>
jmp    1168 <main+0x68>
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, char *, int, long);
void main() {
  long x, z;
  char *y;
  x = 2 * (3 + 4);
  z = 10 / 3;
  y = "world";
  printf("x: %ld, y: %s, imm: %ld, z: %ld\n", x, y, 5, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0xe,-0x8(%rbp)
movq   $0x3,-0x10(%rbp)
lea    0xed1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%r8
lea    0xec0(%rip),%rdi
mov    $0x5,%ecx
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xeef(%rip),%rdi
lea    0xee2(%rip),%rdx
mov    $0xe,%esi
mov    $0x3,%r8d
mov    $0x5,%ecx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"world\00"
@.str.1 = [33 x i8] c"x: %ld, y: %s, imm: %ld, z: %ld\0A\00"
define void @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i8*
store i64 14, i64* %1
store i64 3, i64* %2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i64, i64* %1
%5 = load i8*, i8** %3
%6 = load i64, i64* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 %4, i8* %5, i32 5, i64 %6)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"world\00"
@.str.1 = [33 x i8] c"x: %ld, y: %s, imm: %ld, z: %ld\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i64 14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5, i64 3)
ret void
}
void testClosureSISrV(void (*closure)(short, int, short), short a1, int a2,
                      short a3) {
  (*closure)(a1, a2, a3);
}


x86 assembly (clang, -O0):
<testClosureSISrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xa(%rbp),%cx
mov    -0x10(%rbp),%esi
movswl %cx,%edi
movswl -0x12(%rbp),%edx
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureSISrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %edx,%esi
mov    %ecx,%edx
jmp    *%rax

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

LLVM IR (-O2):
define void @testClosureSISrV(void (i16, i32, i16)* nocapture %0, i16 signext %1, i32 %2, i16 signext %3) {
tail call void %0(i16 signext %1, i32 %2, i16 signext %3)
ret void
}
void Hal_hook_rd_sgndrecfield_recelema(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_rd_sgndrecfield_recelema() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dreieck(int);
int main(void) {
  dreieck(7);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @dreieck(i32 7)
ret i32 0
}
int compare_for_ivec_sort(const void *v1, const void *v2) {
  int dt;
  dt = *(int *)v1 - *(int *)v2;
  return dt;
}


x86 assembly (clang, -O0):
<compare_for_ivec_sort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_for_ivec_sort>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compare_for_ivec_sort(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
%8 = load i32, i32* %7
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
%11 = load i32, i32* %10
%12 = sub nsw i32 %8, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @compare_for_ivec_sort(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int _XInitImageFuncPtrs() {
  printf("_XInitImageFuncPtrs called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [27 x i8] c"_XInitImageFuncPtrs called\00"
define i32 @_XInitImageFuncPtrs() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ DATA_kin();
int /*<<< orphan*/ FUNC_kin();
int /*<<< orphan*/ LibraryHeader(char *, char *);
int /*<<< orphan*/ STARTUP_kin();
LIBRARY_kin() {
  LibraryHeader("kin", "Sat Feb  1 10:41:35 2014 ");
  DATA_kin();
  FUNC_kin();
  STARTUP_kin();
}


x86 assembly (clang, -O0):
<LIBRARY_kin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeae(%rip),%rsi
call   1040 <LibraryHeader@plt>
mov    $0x0,%al
call   1030 <DATA_kin@plt>
mov    $0x0,%al
call   1060 <FUNC_kin@plt>
mov    $0x0,%al
call   1050 <STARTUP_kin@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LIBRARY_kin>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <LibraryHeader@plt>
xor    %eax,%eax
call   1030 <DATA_kin@plt>
xor    %eax,%eax
call   1060 <FUNC_kin@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <STARTUP_kin@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"kin\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:35 2014 \00"
define i32 @LIBRARY_kin() {
%1 = alloca i32
%2 = call i32 @LibraryHeader(i8* getelementptr inbounds ([4 x i8], [4 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_kin()
%4 = call i32 (...) @FUNC_kin()
%5 = call i32 (...) @STARTUP_kin()
%6 = load i32, i32* %1
ret i32 %6
}

LLVM IR (-O2):
@.str = [4 x i8] c"kin\00"
@.str.1 = [26 x i8] c"Sat Feb 1 10:41:35 2014 \00"
define i32 @LIBRARY_kin() {
%1 = tail call i32 @LibraryHeader(i8* getelementptr inbounds ([4 x i8], [4 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_kin()
%3 = tail call i32 (...) @FUNC_kin()
%4 = tail call i32 (...) @STARTUP_kin()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i = 0;
  for (; i <= 255; i++)
    printf("%c: %d\n", i, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%c: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%c: %d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
char *strcat(char *dst, const char *src) {
  char *tmp = dst;
  while (*tmp != '\0')
    tmp++;
  while (*src != '\0') {
    *tmp = *src;
    tmp++;
    src++;
  }
  return dst;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1135 <strcat+0x35>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcat+0x14>
jmp    113a <strcat+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1173 <strcat+0x73>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113a <strcat+0x3a>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1141 <strcat+0x41>
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %dl,-0x1(%rcx,%rdi,1)
movzbl 0x1(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <strcat+0x30>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %4, %8 ]
%14 = phi i8* [ %16, %11 ], [ %1, %8 ]
store i8 %12, i8* %13
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ clear_buffer();
int /*<<< orphan*/ cube_shape(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, int, int, int);
void init(void) {
  clear_buffer();
  cube_shape(0, 0, 0, 7, 7, 7, ((1 << 12) - 1));
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clear_buffer@plt>
xor    %edx,%edx
mov    $0x7,%r9d
mov    %edx,%edi
mov    %edx,%esi
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0xfff,(%rsp)
call   1030 <cube_shape@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
xor    %eax,%eax
call   1040 <clear_buffer@plt>
movl   $0xfff,(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    $0x7,%r8d
mov    $0x7,%r9d
call   1030 <cube_shape@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @init() {
%1 = call i32 (...) @clear_buffer()
%2 = call i32 @cube_shape(i32 0, i32 0, i32 0, i32 7, i32 7, i32 7, i32 4095)
ret void
}

LLVM IR (-O2):
define void @init() {
%1 = tail call i32 (...) @clear_buffer()
%2 = tail call i32 @cube_shape(i32 0, i32 0, i32 0, i32 7, i32 7, i32 7, i32 4095)
ret void
}
int reverse(int n) {
  int m = 0;
  while (n != 0) {
    m *= 10;
    m += (n % 10);
    n /= 10;
  }
  return m;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1143 <reverse+0x43>
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
je     113f <reverse+0x3f>
cs nopw 0x0(%rax,%rax,1)
lea    (%rax,%rax,4),%eax
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
lea    (%rsi,%rax,2),%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = mul nsw i32 %4, 10
%7 = srem i32 %5, 10
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %5, 10
%10 = add i32 %5, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
/* Type definitions */
typedef int int32_t;
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_store_si128(int /*<<< orphan*/ *, int /*<<< orphan*/);
extern __attribute__((__gnu___, __always___, __artificial__)) int
_MM_EXTRACT_EPI32(__m128i vec, const int LANE) {
  __attribute__((aligned(16))) int32_t tmp[4];
  _mm_store_si128((__m128i *)tmp, vec);
  return tmp[LANE];
}


x86 assembly (clang, -O0):
<_MM_EXTRACT_EPI32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1030 <_mm_store_si128@plt>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_MM_EXTRACT_EPI32>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %edi,%esi
mov    %rsp,%rdi
call   1030 <_mm_store_si128@plt>
movslq %ebx,%rax
mov    (%rsp,%rax,4),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @_MM_EXTRACT_EPI32(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i32]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @_mm_store_si128(i32* %6, i32 %7)
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @_MM_EXTRACT_EPI32(i32 %0, i32 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @_mm_store_si128(i32* %5, i32 %0)
%7 = sext i32 %1 to i64
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __pformat(int, char *, int /*<<< orphan*/, char const *,
              int /*<<< orphan*/);
int __attribute__((__cdecl__))
__vsprintf(char *buf, const char *fmt, va_list argv) {
  register int retval;
  buf[retval = __pformat(0x2000, buf, 0, fmt, argv)] = '\0';
  return retval;
}


x86 assembly (clang, -O0):
<__vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    $0x2000,%edi
xor    %edx,%edx
call   1030 <__pformat@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,-0x18(%rbp)
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__vsprintf>:
push   %rbx
mov    %edx,%r8d
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    $0x2000,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <__pformat@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define i32 @__vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @__pformat(i32 8192, i8* %9, i32 0, i8* %10, i32 %11)
store i32 %12, i32* %7
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %8, i64 %13
store i8 0, i8* %14
%15 = load i32, i32* %7
ret i32 %15
}

LLVM IR (-O2):
define i32 @__vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @__pformat(i32 8192, i8* %0, i32 0, i8* %1, i32 %2)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 0, i8* %6
ret i32 %4
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *getenv(char *);
int /*<<< orphan*/ stat(char *, struct stat *);
void has_network_drive(char *arg1) {
  char *network = getenv("CSIDL_NETWORK");
  if (!network) {
    0;
  }
  0;
  0;
  struct stat stats;
  stat(network, &stats);
  if (S_ISDIR(stats.st_mode)) {
    0;
  } else {
    exit(0);
  }
}


x86 assembly (clang, -O0):
<has_network_drive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <has_network_drive+0x2c>
jmp    116c <has_network_drive+0x2c>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <stat@plt>
mov    -0x18(%rbp),%edi
call   1040 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1190 <has_network_drive+0x50>
jmp    1197 <has_network_drive+0x57>
xor    %edi,%edi
call   1060 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_network_drive>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <getenv@plt>
mov    %rsp,%rsi
mov    %rax,%rdi
call   1050 <stat@plt>
mov    (%rsp),%edi
call   1040 <S_ISDIR@plt>
test   %rax,%rax
je     1167 <has_network_drive+0x27>
pop    %rax
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
@.str = [14 x i8] c"CSIDL_NETWORK\00"
define void @has_network_drive(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %2
%5 = call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %1
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %3
%11 = call i32 @stat(i8* %10, %struct.stat* %4)
%12 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i64 @S_ISDIR(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %9
br label %19
17: ; preds = %9
%18 = call i32 @exit(i32 0)
unreachable
19: ; preds = %16
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@.str = [14 x i8] c"CSIDL_NETWORK\00"
define void @has_network_drive(i8* nocapture readnone %0) {
%2 = alloca %struct.stat
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = bitcast %struct.stat* %2 to i8*
%5 = call i32 @stat(i8* %3, %struct.stat* %2)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i64 @S_ISDIR(i32 %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %1
ret void
}
int dquot_alloc_inode(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @dquot_alloc_inode(%struct.inode* nocapture readnone %0) {
ret i32 0
}
unsigned xrop3_170_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  return (D & S) | (D & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_170_0_1>:
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    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @xrop3_170_0_1(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 = xor i32 %5, 255
%7 = or i32 %6, %3
%8 = xor i32 %4, -1
%9 = and i32 %8, %5
%10 = or i32 %7, %9
ret i32 %10
}
void setval_108(unsigned *p) { *p = 3347662921U; }


x86 assembly (clang, -O0):
<setval_108>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xc7894849,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval_108>:
movl   $0xc7894849,(%rdi)
ret

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

LLVM IR (-O2):
define void @setval_108(i32* nocapture writeonly %0) {
store i32 -947304375, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRA4_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRA4_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

LLVM IR (-O0):
define void @U_WMRA4_swap(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 = call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @U_WMRA4_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ branch(scalar_t__);
scalar_t__ peek16();
void GOTO() { branch(peek16() - 1); }


x86 assembly (clang, -O0):
<GOTO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <peek16@plt>
mov    %rax,%rdi
sub    $0x1,%rdi
call   1040 <branch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GOTO>:
push   %rax
xor    %eax,%eax
call   1030 <peek16@plt>
lea    -0x1(%rax),%rdi
pop    %rax
jmp    1040 <branch@plt>

LLVM IR (-O0):
define void @GOTO() {
%1 = call i64 (...) @peek16()
%2 = sub nsw i64 %1, 1
%3 = call i32 @branch(i64 %2)
ret void
}

LLVM IR (-O2):
define void @GOTO() {
%1 = tail call i64 (...) @peek16()
%2 = add nsw i64 %1, -1
%3 = tail call i32 @branch(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f1(int, int);
int f3(int x, unsigned int y) {
  f1(1, 1);
  return 1;
}


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

x86 assembly (clang, -O2):
<f3>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <f1@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @f1(i32 1, i32 1)
ret i32 1
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = tail call i32 @f1(i32 1, i32 1)
ret i32 1
}
int clip(int x) {
  if (x > 255)
    x = 255;
  if (x < 0)
    x = 0;
  return x;
}


x86 assembly (clang, -O0):
<clip>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jle    111b <clip+0x1b>
movl   $0xff,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    112c <clip+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip>:
cmp    $0xff,%edi
mov    $0xff,%ecx
cmovl  %edi,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @clip(i32 %0) {
%2 = icmp slt i32 %0, 255
%3 = select i1 %2, i32 %0, i32 255
%4 = icmp sgt i32 %3, 0
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Type definitions */
struct stat {
  size_t st_size;
};

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int stat(char const *, struct stat *);
size_t fsize(const char *filename) {
  struct stat stat_buf;
  if (stat(filename, &stat_buf) == -1) {
    perror("stat");
    exit(EXIT_FAILURE);
  }
  return stat_buf.st_size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    116c <fsize+0x3c>
lea    0xea7(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1144 <fsize+0x14>
mov    (%rsp),%rax
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.stat = type { i64 }
@.str = [5 x i8] c"stat\00"
@EXIT_FAILURE = global i32 0
define i64 @fsize(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* @EXIT_FAILURE
%10 = call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%13 = load i64, i64* %12
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
@.str = [5 x i8] c"stat\00"
@EXIT_FAILURE = global i32 0
define i64 @fsize(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%12 = load i64, i64* %11
ret i64 %12
}
unsigned short signum_fun_ushort(unsigned short a) { return (a > 0); }


x86 assembly (clang, -O0):
<signum_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signum_fun_ushort>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define zeroext i16 @signum_fun_ushort(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp sgt i32 %4, 0
%6 = zext i1 %5 to i32
%7 = trunc i32 %6 to i16
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @signum_fun_ushort(i16 zeroext %0) {
%2 = icmp ne i16 %0, 0
%3 = zext i1 %2 to i16
ret i16 %3
}
/* Variables and functions */
scalar_t__ IfFacingWall();
int /*<<< orphan*/ TurnLeft();
int /*<<< orphan*/ TurnRight();
char RightIsWall(void) {
  TurnRight();
  if (IfFacingWall()) {
    TurnLeft();
    return (1);
  } else {
    TurnLeft();
    return (0);
  }
}


x86 assembly (clang, -O0):
<RightIsWall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <TurnRight@plt>
mov    $0x0,%al
call   1050 <IfFacingWall@plt>
cmp    $0x0,%rax
je     1160 <RightIsWall+0x30>
mov    $0x0,%al
call   1040 <TurnLeft@plt>
movb   $0x1,-0x1(%rbp)
jmp    116b <RightIsWall+0x3b>
mov    $0x0,%al
call   1040 <TurnLeft@plt>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RightIsWall>:
push   %rbx
xor    %eax,%eax
call   1030 <TurnRight@plt>
xor    %eax,%eax
call   1050 <IfFacingWall@plt>
test   %rax,%rax
setne  %bl
xor    %eax,%eax
call   1040 <TurnLeft@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @RightIsWall() {
%1 = alloca i8
%2 = call i32 (...) @TurnRight()
%3 = call i64 (...) @IfFacingWall()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 (...) @TurnLeft()
store i8 1, i8* %1
br label %9
7: ; preds = %0
%8 = call i32 (...) @TurnLeft()
store i8 0, i8* %1
br label %9
9: ; preds = %7, %5
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define signext i8 @RightIsWall() {
%1 = tail call i32 (...) @TurnRight()
%2 = tail call i64 (...) @IfFacingWall()
%3 = icmp ne i64 %2, 0
%4 = tail call i32 (...) @TurnLeft()
%5 = zext i1 %3 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x66() {
  Assert_real((isspace(102) == 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",
              515, ("isspace should be 0 for f"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x66>:
push   %rax
mov    $0x66,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x203,%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 = [26 x i8] c"isspace should be 0 for f\00"
define void @t_isspace_0x66() {
%1 = call i64 @isspace(i32 102)
%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 515, i8* getelementptr inbounds ([26 x i8], [26 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 = [26 x i8] c"isspace should be 0 for f\00"
define void @t_isspace_0x66() {
%1 = tail call i64 @isspace(i32 102)
%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 515, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *getwd(char *buf) {
  printf("getwd, buf - %p\n", buf);
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"getwd, buf - %p\0A\00"
define i8* @getwd(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i8* null
}

LLVM IR (-O2):
@.str = [17 x i8] c"getwd, buf - %p\0A\00"
define noalias i8* @getwd(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* null
}