xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x3e() {
  Assert_real((isascii(62)),
              "/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_isascii.c",
              315, ("isascii should be 1 for >"));
}


x86 assembly (clang, -O0):
<t_isascii_0x3e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x13b,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x3e>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x13b,%edx
jmp    1030 <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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for >\00"
define void @t_isascii_0x3e() {
%1 = call i32 @isascii(i32 62)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, 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_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for >\00"
define void @t_isascii_0x3e() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 315, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void const_member() { printf("constmember is under construction"); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"constmember is under construction\00"
define void @const_member() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"constmember is under construction\00"
define void @const_member() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printA(int *a, int n) {
  for (int i = 0; i < n; i++) {
    printf("%d ", a[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printA>:
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    1159 <printA+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printA+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printA>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printA+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printA+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printA(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
int git_path_is_dot_or_dotdot(const char *name) {
  return (name[0] == '.' &&
          (name[1] == '\0' || (name[1] == '.' && name[2] == '\0')));
}


x86 assembly (clang, -O0):
<git_path_is_dot_or_dotdot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0x9(%rbp)
jne    1166 <git_path_is_dot_or_dotdot+0x66>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0xa(%rbp)
je     1160 <git_path_is_dot_or_dotdot+0x60>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x2e,%ecx
mov    %al,-0xb(%rbp)
jne    115a <git_path_is_dot_or_dotdot+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<git_path_is_dot_or_dotdot>:
xor    %eax,%eax
cmpb   $0x2e,(%rdi)
jne    111c <git_path_is_dot_or_dotdot+0x1c>
mov    0x1(%rdi),%cl
test   %cl,%cl
je     111d <git_path_is_dot_or_dotdot+0x1d>
cmp    $0x2e,%cl
jne    111c <git_path_is_dot_or_dotdot+0x1c>
xor    %eax,%eax
cmpb   $0x0,0x2(%rdi)
sete   %al
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @git_path_is_dot_or_dotdot(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 46
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
switch i8 %6, label %12 [
i8 0, label %13
i8 46, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
br label %13
12: ; preds = %4
br label %13
13: ; preds = %4, %12, %7, %1
%14 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %7 ], [ 0, %12 ]
ret i32 %14
}
/* Variables and functions */
int ap_get_single_string_command(int, int, char *, int);
int ap_get_file_path(int session, char *str) {
  return (ap_get_single_string_command(session, 0xcc25, str, 1024));
}


x86 assembly (clang, -O0):
<ap_get_file_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0xcc25,%esi
mov    $0x400,%ecx
call   1030 <ap_get_single_string_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ap_get_file_path>:
mov    %rsi,%rdx
mov    $0xcc25,%esi
mov    $0x400,%ecx
jmp    1030 <ap_get_single_string_command@plt>

LLVM IR (-O0):
define i32 @ap_get_file_path(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 = load i8*, i8** %4
%7 = call i32 @ap_get_single_string_command(i32 %5, i32 52261, i8* %6, i32 1024)
ret i32 %7
}

LLVM IR (-O2):
define i32 @ap_get_file_path(i32 %0, i8* %1) {
%3 = tail call i32 @ap_get_single_string_command(i32 %0, i32 52261, i8* %1, i32 1024)
ret i32 %3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t gcd(uint64_t a, uint64_t b) {
  if (a < b) {
    uint64_t t = a;
    a = b;
    b = t;
  }
  uint64_t r;
  while (r = a % b) {
    a = b;
    b = r;
  }
  return b;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1128 <gcd+0x28>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
cmp    $0x0,%edx
je     1151 <gcd+0x51>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    112d <gcd+0x2d>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
cmp    %esi,%edi
mov    %esi,%edx
cmovl  %edi,%edx
cmovl  %esi,%edi
nopw   0x0(%rax,%rax,1)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
br label %6
6: ; preds = %6, %2
%7 = phi i32 [ %4, %2 ], [ %9, %6 ]
%8 = phi i32 [ %5, %2 ], [ %7, %6 ]
%9 = srem i32 %8, %7
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct bladerf {
  int dummy;
};

/* Variables and functions */
int nios_8x32_write(struct bladerf *, int, int /*<<< orphan*/,
                    int /*<<< orphan*/);
int nios_xb200_synth_write(struct bladerf *dev, uint32_t value) {
  int status = nios_8x32_write(dev, 0x02, 0, value);
  if (status == 0) {
    do {
      do {
      } while (0);
    } while (0);
  }
  return status;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%ecx
mov    $0x2,%esi
xor    %edx,%edx
call   1030 <nios_8x32_write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1158 <nios_xb200_synth_write+0x48>
jmp    1144 <nios_xb200_synth_write+0x34>
jmp    1149 <nios_xb200_synth_write+0x39>
jmp    114e <nios_xb200_synth_write+0x3e>
jmp    1153 <nios_xb200_synth_write+0x43>
jmp    1158 <nios_xb200_synth_write+0x48>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    %esi,%ecx
mov    $0x2,%esi
xor    %edx,%edx
jmp    1030 <nios_8x32_write@plt>

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

LLVM IR (-O2):
%struct.bladerf = type { i32 }
define i32 @nios_xb200_synth_write(%struct.bladerf* %0, i32 %1) {
%3 = tail call i32 @nios_8x32_write(%struct.bladerf* %0, i32 2, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_32054x(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_32054x() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t strlen(char *);
void strcpy_s(char *dest, size_t size, char *src) {
  size_t s = strlen(src);
  if (s > size - 1) {
    s = size - 1;
  }
  memcpy(dest, src, s);
  dest[s] = 0;
}


x86 assembly (clang, -O0):
<strcpy_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    1162 <strcpy_s+0x42>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_s>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rdx,%rdi
call   1030 <strlen@plt>
add    $0xffffffffffffffff,%rbx
cmp    %rbx,%rax
cmovbe %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%r15,%rbx,1)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @strcpy_s(i8* %0, i64 %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = add i64 %1, -1
%6 = icmp ugt i64 %4, %5
%7 = select i1 %6, i64 %5, i64 %4
%8 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %7)
%9 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %9
ret void
}
__attribute__((no)) int fib(int i) {
  if (i == 0)
    return 0;
  if (i == 1)
    return 1;
  return fib(i - 1) + fib(i - 2);
}


x86 assembly (clang, -O0):
<fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <fib+0x21>
movl   $0x0,-0x4(%rbp)
jmp    116a <fib+0x5a>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <fib+0x37>
movl   $0x1,-0x4(%rbp)
jmp    116a <fib+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <fib@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <fib@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fib>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <fib+0x22>
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
call   1030 <fib@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <fib+0x10>
add    %ebp,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @fib(i32 %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i32 [ 0, %1 ], [ %10, %6 ]
%4 = phi i32 [ %0, %1 ], [ %9, %6 ]
%5 = icmp ult i32 %4, 2
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = add nsw i32 %4, -1
%8 = tail call i32 @fib(i32 %7)
%9 = add nsw i32 %4, -2
%10 = add nsw i32 %8, %3
br label %2
11: ; preds = %2
%12 = add nsw i32 %4, %3
ret i32 %12
}
void UserNodeListEmptyCalloutf(void) {}


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

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

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

LLVM IR (-O2):
define void @UserNodeListEmptyCalloutf() {
ret void
}
char *dummy_bindtextdomain(const char *domainname, const char *dirname) {
  return (char *)("/dummy");
}


x86 assembly (clang, -O0):
<dummy_bindtextdomain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeed(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"/dummy\00"
define i8* @dummy_bindtextdomain(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"/dummy\00"
define i8* @dummy_bindtextdomain(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void main() {
  printf("fucking E-mail");
  printf("haha");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"fucking E-mail\00"
@.str.1 = [5 x i8] c"haha\00"
define void @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"fucking E-mail\00"
@.str.1 = [5 x i8] c"haha\00"
define void @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int const);
int main(void) {
  const int ten = 10;
  int *p = (int *)&ten;
  *p = 20;
  printf("var is %d\n", ten);
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"var is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 10, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
store i32 20, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = load i32, i32* @EXIT_SUCCESS
ret i32 %6
}

LLVM IR (-O2):
@.str = [11 x i8] c"var is %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ zcc_asprintf(char **, char *, char *, char *);
void BuildOptions(char **list, char *arg) {
  char *val;
  char *orig = *list;
  zcc_asprintf(&val, "%s%s ", orig ? orig : "", arg);
  free(orig);
  *list = val;
}


x86 assembly (clang, -O0):
<BuildOptions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1153 <BuildOptions+0x33>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
jmp    1163 <BuildOptions+0x43>
lea    0xeab(%rip),%rax
mov    %rax,-0x28(%rbp)
jmp    1163 <BuildOptions+0x43>
mov    -0x28(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    -0x18(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <zcc_asprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BuildOptions>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rcx
mov    %rdi,%r14
mov    (%rdi),%rbx
test   %rbx,%rbx
lea    0xece(%rip),%rdx
cmovne %rbx,%rdx
lea    0xebe(%rip),%rsi
mov    %rsp,%rdi
call   1040 <zcc_asprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    (%rsp),%rax
mov    %rax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s%s \00"
@.str.1 = [1 x i8] zeroinitializer
define void @BuildOptions(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%7 = load i8**, i8*** %3
%8 = load i8*, i8** %7
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i8*, i8** %6
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %11
%15 = phi i8* [ %12, %11 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %13 ]
%16 = load i8*, i8** %4
%17 = call i32 @zcc_asprintf(i8** %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16)
%18 = load i8*, i8** %6
%19 = call i32 @free(i8* %18)
%20 = load i8*, i8** %5
%21 = load i8**, i8*** %3
store i8* %20, i8** %21
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s%s \00"
@.str.1 = [1 x i8] zeroinitializer
define void @BuildOptions(i8** nocapture %0, i8* %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = load i8*, i8** %0
%6 = icmp eq i8* %5, null
%7 = select i1 %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %5
%8 = call i32 @zcc_asprintf(i8** %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %1)
%9 = call i32 @free(i8* %5)
%10 = load i8*, i8** %3
store i8* %10, i8** %0
ret void
}
double dot(double a1, double a2, double a3, double b1, double b2, double b3) {
  return (a1 * b1 + a2 * b2 + a3 * b3);
}


x86 assembly (clang, -O0):
<dot>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot>:
mulsd  %xmm4,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm5,%xmm2
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dot(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %7
%14 = load double, double* %10
%15 = load double, double* %8
%16 = load double, double* %11
%17 = fmul double %15, %16
%18 = call double @llvm.fmuladd.f64(double %13, double %14, double %17)
%19 = load double, double* %9
%20 = load double, double* %12
%21 = call double @llvm.fmuladd.f64(double %19, double %20, double %18)
ret double %21
}

LLVM IR (-O2):
define double @dot(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = fmul double %1, %4
%8 = tail call double @llvm.fmuladd.f64(double %0, double %3, double %7)
%9 = tail call double @llvm.fmuladd.f64(double %2, double %5, double %8)
ret double %9
}
/* Variables and functions */
int any_decrqpsr(char const *, int);
int tst_DECCIR(const char *the_title) { return any_decrqpsr(the_title, 1); }


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

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

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

LLVM IR (-O2):
define i32 @tst_DECCIR(i8* %0) {
%2 = tail call i32 @any_decrqpsr(i8* %0, i32 1)
ret i32 %2
}
void XMemDisable(void) {}


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

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

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

LLVM IR (-O2):
define void @XMemDisable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WAIT_ANY;
int WNOHANG;
int WUNTRACED;
int /*<<< orphan*/ waitpid(int /*<<< orphan*/, int *, int);
void sigchld_handler(int sig) {
  int status;
  waitpid(WAIT_ANY, &status, WNOHANG | WUNTRACED);
}


x86 assembly (clang, -O0):
<sigchld_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%edx
mov    0x2e9c(%rip),%rax
or     (%rax),%edx
lea    -0x8(%rbp),%rsi
call   1030 <waitpid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigchld_handler>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
mov    0x2ec7(%rip),%rax
mov    0x2ea8(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0x4(%rsp),%rsi
call   1030 <waitpid@plt>
pop    %rax
ret

LLVM IR (-O0):
@WAIT_ANY = global i32 0
@WNOHANG = global i32 0
@WUNTRACED = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @WAIT_ANY
%5 = load i32, i32* @WNOHANG
%6 = load i32, i32* @WUNTRACED
%7 = or i32 %5, %6
%8 = call i32 @waitpid(i32 %4, i32* %3, i32 %7)
ret void
}

LLVM IR (-O2):
@WAIT_ANY = global i32 0
@WNOHANG = global i32 0
@WUNTRACED = global i32 0
define void @sigchld_handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WAIT_ANY
%5 = load i32, i32* @WNOHANG
%6 = load i32, i32* @WUNTRACED
%7 = or i32 %6, %5
%8 = call i32 @waitpid(i32 %4, i32* %2, i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void Jump_Ret(void) { Inst_Printf("jmp", "*%%eax"); }


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

x86 assembly (clang, -O2):
<Jump_Ret>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"jmp\00"
@.str.1 = [7 x i8] c"*%%eax\00"
define void @Jump_Ret() {
%1 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void print_to_stdout(void *call_arg, const char *output) {
  printf("%s", output);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_to_stdout(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
void zero4d(int dim1, int dim2, int dim3, int dim4, double *a) {
  int i;
#pragma omp parallel for private(i) schedule(static)
  for (i = 0; i < (dim1 * dim2 * dim3 * dim4); i++)
    a[i] = 0.0;
  return;
}


x86 assembly (clang, -O0):
<zero4d>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    1153 <zero4d+0x53>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111b <zero4d+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero4d>:
imul   %esi,%edi
imul   %ecx,%edx
imul   %edi,%edx
test   %edx,%edx
jle    1132 <zero4d+0x22>
push   %rax
mov    %edx,%edx
shl    $0x3,%rdx
mov    %r8,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @zero4d(i32 %0, i32 %1, i32 %2, i32 %3, double* nocapture writeonly %4) {
%6 = mul nsw i32 %1, %0
%7 = mul nsw i32 %6, %2
%8 = mul i32 %7, %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = bitcast double* %4 to i8*
%12 = zext i32 %8 to i64
%13 = shl nuw nsw i64 %12, 3
br label %14
14: ; preds = %10, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cmd_pchar(int /*<<< orphan*/);
int /*<<< orphan*/ digitToHex(unsigned char);
void cmd_printHexByte(unsigned char byte) {
  cmd_pchar(digitToHex((byte & 0xF0) >> 4));
  cmd_pchar(digitToHex(byte & 0xF));
}


x86 assembly (clang, -O0):
<cmd_printHexByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf0,%eax
sar    $0x4,%eax
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <cmd_pchar@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <cmd_pchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_printHexByte>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
call   1030 <cmd_pchar@plt>
and    $0xf,%ebx
mov    %ebx,%edi
call   1040 <digitToHex@plt>
mov    %eax,%edi
pop    %rbx
jmp    1030 <cmd_pchar@plt>

LLVM IR (-O0):
define void @cmd_printHexByte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 240
%6 = ashr i32 %5, 4
%7 = trunc i32 %6 to i8
%8 = call i32 @digitToHex(i8 zeroext %7)
%9 = call i32 @cmd_pchar(i32 %8)
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = trunc i32 %12 to i8
%14 = call i32 @digitToHex(i8 zeroext %13)
%15 = call i32 @cmd_pchar(i32 %14)
ret void
}

LLVM IR (-O2):
define void @cmd_printHexByte(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @digitToHex(i8 zeroext %2)
%4 = tail call i32 @cmd_pchar(i32 %3)
%5 = and i8 %0, 15
%6 = tail call i32 @digitToHex(i8 zeroext %5)
%7 = tail call i32 @cmd_pchar(i32 %6)
ret void
}
void mystrcpy(char *dst, const char *src) {
  while (*src) {
    *dst = *src;
    src++;
    dst++;
  }
  *dst = 0;
}


x86 assembly (clang, -O0):
<mystrcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1142 <mystrcpy+0x42>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <mystrcpy+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrcpy>:
mov    (%rsi),%al
test   %al,%al
je     1121 <mystrcpy+0x21>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rdi)
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <mystrcpy+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @mystrcpy(i8* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %1, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XConvertCase() {
  printf("XConvertCase called\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [20 x i8] c"XConvertCase called\00"
define i32 @XConvertCase() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int equal_int(void *ip, void *jp) {
  int *i = (int *)ip;
  int *j = (int *)jp;
  printf("equal_int: i:%d, j:%d\n", *i, *j);
  if (*i == *j) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<equal_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    1166 <equal_int+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <equal_int+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_int>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi),%esi
mov    (%r14),%edx
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    (%r14),%ecx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"equal_int: i:%d, j:%d\0A\00"
define i32 @equal_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
struct dthr_semaphore {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dthr_semaphore_take_no_yield(struct dthr_semaphore *);
int /*<<< orphan*/ dthr_thread_yield();
void dthr_semaphore_take(struct dthr_semaphore *sema) {
  ;
  ;
  dthr_thread_yield();
  dthr_semaphore_take_no_yield(sema);
  ;
  ;
}


x86 assembly (clang, -O0):
<dthr_semaphore_take>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <dthr_thread_yield@plt>
mov    -0x8(%rbp),%rdi
call   1030 <dthr_semaphore_take_no_yield@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dthr_semaphore_take>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <dthr_thread_yield@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <dthr_semaphore_take_no_yield@plt>

LLVM IR (-O0):
%struct.dthr_semaphore = type { i32 }
define void @dthr_semaphore_take(%struct.dthr_semaphore* %0) {
%2 = alloca %struct.dthr_semaphore*
store %struct.dthr_semaphore* %0, %struct.dthr_semaphore** %2
%3 = call i32 (...) @dthr_thread_yield()
%4 = load %struct.dthr_semaphore*, %struct.dthr_semaphore** %2
%5 = call i32 @dthr_semaphore_take_no_yield(%struct.dthr_semaphore* %4)
ret void
}

LLVM IR (-O2):
%struct.dthr_semaphore = type { i32 }
define void @dthr_semaphore_take(%struct.dthr_semaphore* %0) {
%2 = tail call i32 (...) @dthr_thread_yield()
%3 = tail call i32 @dthr_semaphore_take_no_yield(%struct.dthr_semaphore* %0)
ret void
}
int bar(int n) {
  int i;
#pragma parallel omp for
  for (i = 0; i < 6; i++) {
    int v[n], w[n * 3 + i];
    v[0] = 1;
    w[0] = 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1188 <bar+0x88>
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edx
mov    %edx,%eax
lea    (%rax,%rax,2),%eax
mov    -0x8(%rbp),%edx
add    %edx,%eax
mov    %eax,%edx
lea    0xf(,%rdx,4),%rsi
and    $0xfffffffffffffff0,%rsi
mov    %rsp,%rax
sub    %rsi,%rax
mov    %rax,%rsp
mov    %rdx,-0x20(%rbp)
movl   $0x1,(%rcx)
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <bar+0x12>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 0
}
int isalnum(int c) {
  return (47 < c && c < 58) || (64 < c && c < 91) || (96 < c && c < 123);
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2f,%eax
cmp    -0x4(%rbp),%eax
jge    1124 <isalnum+0x24>
mov    $0x1,%al
cmpl   $0x3a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1164 <isalnum+0x64>
mov    $0x40,%eax
cmp    -0x4(%rbp),%eax
jge    1141 <isalnum+0x41>
mov    $0x1,%al
cmpl   $0x5b,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1164 <isalnum+0x64>
xor    %eax,%eax
mov    $0x60,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x6(%rbp)
jge    115e <isalnum+0x5e>
cmpl   $0x7b,-0x4(%rbp)
setl   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 47, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 58
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp slt i32 64, %9
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 91
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp slt i32 96, %15
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 123
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Trivial test is working.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Trivial test is working.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Trivial test is working.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void SysCtrlAonSync(void) {
  (*((volatile unsigned long *)(0x40092000 + 0x0000002C)));
}


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

x86 assembly (clang, -O2):
<SysCtrlAonSync>:
mov    0x4009202c,%rax
40
ret

LLVM IR (-O0):
define void @SysCtrlAonSync() {
%1 = load volatile i64, i64* inttoptr (i64 1074339884 to i64*)
ret void
}

LLVM IR (-O2):
define void @SysCtrlAonSync() {
%1 = load volatile i64, i64* inttoptr (i64 1074339884 to i64*)
ret void
}