xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int main() {
  int i;
  int j;
  int z;
  int res;
  res = 0;
  i = 1;
  j = 1;
  if (i) {
    if (j) {
      res = 1;
    } else {
    }
  } else {
    if (z) {
    } else {
    }
  }
  assert(!res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115e <main+0x4e>
cmpl   $0x0,-0xc(%rbp)
je     1154 <main+0x44>
movl   $0x1,-0x14(%rbp)
jmp    1159 <main+0x49>
jmp    1159 <main+0x49>
jmp    1177 <main+0x67>
cmpl   $0x0,-0x10(%rbp)
je     116d <main+0x5d>
jmp    1172 <main+0x62>
jmp    1172 <main+0x62>
jmp    1177 <main+0x67>
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
void __unused_entrypoint(void) {}


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

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

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

LLVM IR (-O2):
define void @__unused_entrypoint() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
void memcpy_len_Good(size_t len) {
  char dst[len];
  char src[len];
  memcpy(dst, src, len);
}


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

x86 assembly (clang, -O2):
<memcpy_len_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,%rdx
mov    %rsp,%rdi
lea    0xf(%rdx),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdi
mov    %rdi,%rsp
mov    %rsp,%rsi
sub    %rax,%rsi
mov    %rsi,%rsp
call   1030 <memcpy@plt>
mov    %rbp,%rsp
pop    %rbp
ret

LLVM IR (-O0):
define void @memcpy_len_Good(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %2
%6 = load i64, i64* %2
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %3
%8 = alloca i8, i64 %6
store i64 %6, i64* %4
%9 = load i64, i64* %2
%10 = alloca i8, i64 %9
store i64 %9, i64* %5
%11 = load i64, i64* %2
%12 = call i32 @memcpy(i8* %8, i8* %10, i64 %11)
%13 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
define void @memcpy_len_Good(i64 %0) {
%2 = alloca i8, i64 %0
%3 = alloca i8, i64 %0
%4 = call i32 @memcpy(i8* %2, i8* %3, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ console_move_cursor(int, int);
int /*<<< orphan*/ putchar(unsigned char);
void console_plot(int x, int y, unsigned char code) {
  console_move_cursor(x, y);
  if (code < 32) {
    putchar(0x10);
  }
  putchar(code);
}


x86 assembly (clang, -O0):
<console_plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <console_move_cursor@plt>
movzbl -0x9(%rbp),%eax
cmp    $0x20,%eax
jge    1155 <console_plot+0x35>
mov    $0x10,%edi
call   1030 <putchar@plt>
movzbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_plot>:
push   %rbx
mov    %edx,%ebx
call   1040 <console_move_cursor@plt>
cmp    $0x1f,%bl
ja     1137 <console_plot+0x17>
mov    $0x10,%edi
call   1030 <putchar@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @console_plot(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = call i32 @console_move_cursor(i32 %7, i32 %8)
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @putchar(i8 zeroext 16)
br label %15
15: ; preds = %13, %3
%16 = load i8, i8* %6
%17 = call i32 @putchar(i8 zeroext %16)
ret void
}

LLVM IR (-O2):
define void @console_plot(i32 %0, i32 %1, i8 zeroext %2) {
%4 = tail call i32 @console_move_cursor(i32 %0, i32 %1)
%5 = icmp ult i8 %2, 32
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @putchar(i8 zeroext 16)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @putchar(i8 zeroext %2)
ret void
}
/* Type definitions */
struct sys_reg_params {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_sys_reg_msg(struct sys_reg_params const *, char *,
                                     char *);
void print_sys_reg_instr(const struct sys_reg_params *p) {
  print_sys_reg_msg(p, "%s", "");
}


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

x86 assembly (clang, -O2):
<print_sys_reg_instr>:
lea    0xee9(%rip),%rsi
lea    0xee4(%rip),%rdx
jmp    1030 <print_sys_reg_msg@plt>

LLVM IR (-O0):
%struct.sys_reg_params = type { i32 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @print_sys_reg_instr(%struct.sys_reg_params* %0) {
%2 = alloca %struct.sys_reg_params*
store %struct.sys_reg_params* %0, %struct.sys_reg_params** %2
%3 = load %struct.sys_reg_params*, %struct.sys_reg_params** %2
%4 = call i32 @print_sys_reg_msg(%struct.sys_reg_params* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.sys_reg_params = type { i32 }
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @print_sys_reg_instr(%struct.sys_reg_params* %0) {
%2 = tail call i32 @print_sys_reg_msg(%struct.sys_reg_params* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float Vector3Dot(const float v1[3], const float v2[3]) {
  return v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2];
}


x86 assembly (clang, -O0):
<Vector3Dot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Vector3Dot>:
movss  0x4(%rdi),%xmm0
mulss  0x4(%rsi),%xmm0
movss  (%rdi),%xmm1
mulss  (%rsi),%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  0x8(%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @Vector3Dot(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
%19 = load float*, float** %3
%20 = getelementptr inbounds float, float* %19, i64 2
%21 = load float, float* %20
%22 = load float*, float** %4
%23 = getelementptr inbounds float, float* %22, i64 2
%24 = load float, float* %23
%25 = call float @llvm.fmuladd.f32(float %21, float %24, float %18)
ret float %25
}

LLVM IR (-O2):
define float @Vector3Dot(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = tail call float @llvm.fmuladd.f32(float %12, float %14, float %10)
ret float %15
}
char *lower_str(char *str) {
  for (char *c = str; *c; ++c) {
    if (*c >= 'A' && *c <= 'Z')
      *c = *c - 'A' + 'a';
  }
  return str;
}


x86 assembly (clang, -O0):
<lower_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <lower_str+0x68>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1152 <lower_str+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1152 <lower_str+0x52>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
jmp    1157 <lower_str+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <lower_str+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower_str>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <lower_str+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <lower_str+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <lower_str+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <lower_str+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <lower_str+0x10>
ret

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

LLVM IR (-O2):
define i8* @lower_str(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %12, %1
ret i8* %0
5: ; preds = %1, %12
%6 = phi i8 [ %14, %12 ], [ %2, %1 ]
%7 = phi i8* [ %13, %12 ], [ %0, %1 ]
%8 = add i8 %6, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %5
%11 = add nuw nsw i8 %6, 32
store i8 %11, i8* %7
br label %12
12: ; preds = %5, %10
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %4, label %5
}
int donothing(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @donothing() {
ret i32 0
}
/* Variables and functions */
int PAPI_ipc(float *, float *, long long *, float *);
void papif_ipc(float *rtime, float *ptime, long long *ins, float *ipc,
               int *check) {
  *check = PAPI_ipc(rtime, ptime, ins, ipc);
}


x86 assembly (clang, -O0):
<papif_ipc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <PAPI_ipc@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_ipc>:
push   %rbx
mov    %r8,%rbx
call   1030 <PAPI_ipc@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_ipc(float* %0, float* %1, i64* %2, float* %3, i32* %4) {
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64*
%9 = alloca float*
%10 = alloca i32*
store float* %0, float** %6
store float* %1, float** %7
store i64* %2, i64** %8
store float* %3, float** %9
store i32* %4, i32** %10
%11 = load float*, float** %6
%12 = load float*, float** %7
%13 = load i64*, i64** %8
%14 = load float*, float** %9
%15 = call i32 @PAPI_ipc(float* %11, float* %12, i64* %13, float* %14)
%16 = load i32*, i32** %10
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @papif_ipc(float* %0, float* %1, i64* %2, float* %3, i32* nocapture writeonly %4) {
%6 = tail call i32 @PAPI_ipc(float* %0, float* %1, i64* %2, float* %3)
store i32 %6, i32* %4
ret void
}
void foo816(int p) {}


x86 assembly (clang, -O0):
<foo816>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo816(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_map();
int /*<<< orphan*/ test_utils();
int /*<<< orphan*/ test_vector();
int main(void) {
  test_utils();
  test_vector();
  test_map();
  printf("All tests passed!\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_utils@plt>
xor    %eax,%eax
call   1050 <test_vector@plt>
xor    %eax,%eax
call   1060 <test_map@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"All tests passed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_utils()
%3 = call i32 (...) @test_vector()
%4 = call i32 (...) @test_map()
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"All tests passed!\00"
define i32 @main() {
%1 = tail call i32 (...) @test_utils()
%2 = tail call i32 (...) @test_vector()
%3 = tail call i32 (...) @test_map()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;

/* Variables and functions */
int /*<<< orphan*/ errn_exit(int, char *);
int pthread_join(int /*<<< orphan*/, void **);
void _join(pthread_t t, void **a) {
  int n = pthread_join(t, a);
  if (n)
    errn_exit(n, "_join");
}


x86 assembly (clang, -O0):
<_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <pthread_join@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1157 <_join+0x37>
mov    -0x14(%rbp),%edi
lea    0xeae(%rip),%rsi
call   1030 <errn_exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_join>:
push   %rax
call   1040 <pthread_join@plt>
test   %eax,%eax
je     1139 <_join+0x19>
lea    0xecf(%rip),%rsi
mov    %eax,%edi
pop    %rax
jmp    1030 <errn_exit@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"_join\00"
define void @_join(i32 %0, i8** %1) {
%3 = tail call i32 @pthread_join(i32 %0, i8** %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @errn_exit(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ strcpy(char *, char *);
void report(char *string) {
  char buf[80];
  int len;
  strcpy(buf, string);
  fprintf(stdout, "Hello world from %s!\n%n", buf, &len);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    -0x60(%rbp),%rdx
lea    0xeb3(%rip),%rsi
lea    -0x64(%rbp),%rcx
call   1040 <fprintf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rbx
sub    $0x60,%rsp
mov    %rdi,%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xebb(%rip),%rsi
lea    0xc(%rsp),%rcx
mov    %rbx,%rdx
call   1040 <fprintf@plt>
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [24 x i8] c"Hello world from %s!\0A%n\00"
define void @report(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i32, i32* @stdout
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9, i32* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [24 x i8] c"Hello world from %s!\0A%n\00"
define void @report(i8* %0) {
%2 = alloca [80 x i8]
%3 = alloca i32
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = call i32 @strcpy(i8* %4, i8* %0)
%7 = load i32, i32* @stdout
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %4, i32* %3)
ret void
}
float rsqrt(float x) {
  union {
    int i;
    float f;
  } u;
  u.f = x;
  u.i = 0x5f37624f - (u.i >> 1);
  return u.f;
}


x86 assembly (clang, -O0):
<rsqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f37624f,%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f37624f,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @rsqrt(float %0) {
%2 = alloca float
%3 = alloca %union.anon
store float %0, float* %2
%4 = load float, float* %2
%5 = bitcast %union.anon* %3 to float*
store float %4, float* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 1
%9 = sub nsw i32 1597465167, %8
%10 = bitcast %union.anon* %3 to i32*
store i32 %9, i32* %10
%11 = bitcast %union.anon* %3 to float*
%12 = load float, float* %11
ret float %12
}

LLVM IR (-O2):
define float @rsqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597465167, %3
%5 = bitcast i32 %4 to float
ret float %5
}
void SecondaryRPMISR() {}


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

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

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

LLVM IR (-O2):
define void @SecondaryRPMISR() {
ret void
}
int ileRozwZdelt(float delta) {
  if (delta < 0)
    return 0;
  else if (delta == 0)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<ileRozwZdelt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1122 <ileRozwZdelt+0x22>
movl   $0x0,-0x4(%rbp)
jmp    114c <ileRozwZdelt+0x4c>
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1145 <ileRozwZdelt+0x45>
jp     1145 <ileRozwZdelt+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <ileRozwZdelt+0x4c>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ileRozwZdelt>:
xorps  %xmm1,%xmm1
movaps %xmm0,%xmm2
cmpeqss %xmm1,%xmm2
movd   %xmm2,%ecx
add    $0x2,%ecx
xor    %eax,%eax
ucomiss %xmm0,%xmm1
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ileRozwZdelt(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load float, float* %3
%9 = fcmp oeq float %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 1, i32* %2
br label %12
11: ; preds = %7
store i32 2, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @ileRozwZdelt(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fcmp oeq float %0, 0.000000e+00
%4 = select i1 %3, i32 1, i32 2
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Variables and functions */
scalar_t__ fabs(float);
float f_max(float x, float a) {
  x -= a;
  x += fabs(x);
  x *= 0.5;
  x += a;
  return x;
}


x86 assembly (clang, -O0):
<f_max>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <fabs@plt>
cvtsi2ss %rax,%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea1(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_max>:
push   %rax
movss  %xmm1,0x4(%rsp)
subss  %xmm1,%xmm0
movss  %xmm0,(%rsp)
call   1030 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
addss  (%rsp),%xmm0
mulss  0xec6(%rip),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f_max(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load float, float* %3
%7 = fsub float %6, %5
store float %7, float* %3
%8 = load float, float* %3
%9 = call i64 @fabs(float %8)
%10 = sitofp i64 %9 to float
%11 = load float, float* %3
%12 = fadd float %11, %10
store float %12, float* %3
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = fmul double %14, 5.000000e-01
%16 = fptrunc double %15 to float
store float %16, float* %3
%17 = load float, float* %4
%18 = load float, float* %3
%19 = fadd float %18, %17
store float %19, float* %3
%20 = load float, float* %3
ret float %20
}

LLVM IR (-O2):
define float @f_max(float %0, float %1) {
%3 = fsub float %0, %1
%4 = tail call i64 @fabs(float %3)
%5 = sitofp i64 %4 to float
%6 = fadd float %3, %5
%7 = fmul float %6, 5.000000e-01
%8 = fadd float %7, %1
ret float %8
}
/* Variables and functions */
int gcd(long, long);
long getrelprime(long num) {
  for (long i = 2; i < num; i++) {
    if (gcd(i, num) == 1) {
      return i;
    }
  }
}


x86 assembly (clang, -O0):
<getrelprime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    116b <getrelprime+0x5b>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <gcd@plt>
cmp    $0x1,%eax
jne    1155 <getrelprime+0x45>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116b <getrelprime+0x5b>
jmp    115a <getrelprime+0x4a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1124 <getrelprime+0x14>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getrelprime>:
push   %r14
push   %rbx
push   %rax
mov    $0x2,%ebx
cmp    $0x3,%rdi
jl     114c <getrelprime+0x3c>
mov    %rdi,%r14
mov    $0x2,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <gcd@plt>
cmp    $0x1,%eax
je     114c <getrelprime+0x3c>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <getrelprime+0x20>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @getrelprime(i64 %0) {
%2 = icmp sgt i64 %0, 2
br i1 %2, label %3, label %10
3: ; preds = %1, %7
%4 = phi i64 [ %8, %7 ], [ 2, %1 ]
%5 = tail call i32 @gcd(i64 %4, i64 %0)
%6 = icmp eq i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = add nuw nsw i64 %4, 1
%9 = icmp eq i64 %8, %0
br i1 %9, label %10, label %3
10: ; preds = %7, %3, %1
%11 = phi i64 [ 2, %1 ], [ %4, %3 ], [ %0, %7 ]
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ high_target();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int main(int argc, char *argv[]) {
  char *buffer;
  buffer = (char *)malloc(64);
  strcpy(buffer, "abc");
  printf("%s\n", buffer);
  high_target();
  printf("returned from high_target.\n");
  free(buffer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe81(%rip),%rsi
call   1050 <strcpy@plt>
mov    -0x18(%rbp),%rsi
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   1030 <high_target@plt>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x40,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   1030 <high_target@plt>
lea    0xe81(%rip),%rdi
call   1060 <puts@plt>
mov    %rbx,%rdi
call   1040 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [28 x i8] c"returned from high_target.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i64 @malloc(i32 64)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @strcpy(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = load i8*, i8** %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 (...) @high_target()
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@str = [27 x i8] c"returned from high_target.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 64)
%4 = inttoptr i64 %3 to i8*
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
%7 = tail call i32 (...) @high_target()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%9 = tail call i32 @free(i8* %4)
ret i32 0
}
void ClearBitString(void *vTheBitMap, unsigned length) {
  char *theBitMap = (char *)vTheBitMap;
  unsigned i;
  for (i = 0; i < length; i++)
    theBitMap[i] = '\0';
}


x86 assembly (clang, -O0):
<ClearBitString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    113f <ClearBitString+0x3f>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    111a <ClearBitString+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClearBitString>:
test   %esi,%esi
je     1122 <ClearBitString+0x12>
push   %rax
mov    %esi,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @ClearBitString(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %2
ret void
}
int __dberr() { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @__dberr() {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr,
          "\nUsage: postabq [options] output.fil\nConverts an ABAQUS output "
          "file (.fil) into a Python script.\nThe output goes to "
          "stdout.\n\nOptions:\n  -v : Be verbose (mostly for debugging)\n  -e "
          ": Force EXPLICIT from the start (default is to autodetect)\n  -n : "
          "Dry run: run through the file but do not produce conversion\n  -h : "
          "Print this help text\n  -V : Print version and exit\n\n");
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [366 x i8] c"\0AUsage: postabq [options] output.fil\0AConverts an ABAQUS output file (.fil) into a Python script.\0AThe output goes to stdout.\0A\0AOptions:\0A -v : Be verbose (mostly for debugging)\0A -e : Force EXPLICIT from the start (default is to autodetect)\0A -n : Dry run: run through the file but do not produce conversion\0A -h : Print this help text\0A -V : Print version and exit\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([366 x i8], [366 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [366 x i8] c"\0AUsage: postabq [options] output.fil\0AConverts an ABAQUS output file (.fil) into a Python script.\0AThe output goes to stdout.\0A\0AOptions:\0A -v : Be verbose (mostly for debugging)\0A -e : Force EXPLICIT from the start (default is to autodetect)\0A -n : Dry run: run through the file but do not produce conversion\0A -h : Print this help text\0A -V : Print version and exit\0A\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([366 x i8], [366 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lua_error(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void lua_arg_check(int cond, char *funcname) {
  if (!cond) {
    char buff[100];
    sprintf(buff, "incorrect argument to function `%s'", funcname);
    lua_error(buff);
  }
}


x86 assembly (clang, -O0):
<lua_arg_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1159 <lua_arg_check+0x39>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <lua_error@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lua_arg_check>:
test   %edi,%edi
je     1125 <lua_arg_check+0x5>
ret
push   %rbx
sub    $0x70,%rsp
mov    %rsi,%rdx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <lua_error@plt>
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"incorrect argument to function `%s'\00"
define void @lua_arg_check(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [100 x i8]
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%10 = load i8*, i8** %4
%11 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = call i32 @lua_error(i8* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"incorrect argument to function `%s'\00"
define void @lua_arg_check(i32 %0, i8* %1) {
%3 = alloca [100 x i8]
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %1)
%8 = call i32 @lua_error(i8* %6)
br label %9
9: ; preds = %5, %2
ret void
}
int readline(char s[], int max_chars) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @readline(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct json_string_s {
  int dummy;
};

/* Variables and functions */
int json_write_minified_get_string_size(struct json_string_s const *, size_t *);
int json_write_pretty_get_string_size(const struct json_string_s *string,
                                      size_t *size) {
  return json_write_minified_get_string_size(string, size);
}


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

x86 assembly (clang, -O2):
<json_write_pretty_get_string_size>:
jmp    1030 <json_write_minified_get_string_size@plt>

LLVM IR (-O0):
%struct.json_string_s = type { i32 }
define i32 @json_write_pretty_get_string_size(%struct.json_string_s* %0, i64* %1) {
%3 = alloca %struct.json_string_s*
%4 = alloca i64*
store %struct.json_string_s* %0, %struct.json_string_s** %3
store i64* %1, i64** %4
%5 = load %struct.json_string_s*, %struct.json_string_s** %3
%6 = load i64*, i64** %4
%7 = call i32 @json_write_minified_get_string_size(%struct.json_string_s* %5, i64* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.json_string_s = type { i32 }
define i32 @json_write_pretty_get_string_size(%struct.json_string_s* %0, i64* %1) {
%3 = tail call i32 @json_write_minified_get_string_size(%struct.json_string_s* %0, i64* %1)
ret i32 %3
}
const char *pathconN_nm2_name_out(int i) {
  switch (i) {
  case 0:
    return "o0";
  case 1:
    return "o1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<pathconN_nm2_name_out>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <pathconN_nm2_name_out+0x2b>
jmp    111a <pathconN_nm2_name_out+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <pathconN_nm2_name_out+0x3b>
jmp    114b <pathconN_nm2_name_out+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm2_name_out+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <pathconN_nm2_name_out+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathconN_nm2_name_out>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm2_name_out(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"o0\00"
@.str.1 = [3 x i8] c"o1\00"
define i8* @pathconN_nm2_name_out(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ srand(unsigned int);
void seedrand(int number) { srand((unsigned)number); }


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

x86 assembly (clang, -O2):
<seedrand>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @seedrand(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned long);
void *realloc(void *, unsigned int);
void f1() {
  int i;
  unsigned long j;
  i = j = 10;
  void *ptr = malloc(j);
  ptr = realloc(ptr, (unsigned)i);
  free(ptr);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0xa,-0x10(%rbp)
movl   $0xa,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rax
mov    $0xa,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    $0xa,%esi
call   1050 <realloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f1() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i8*
store i64 10, i64* %2
store i32 10, i32* %1
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %1
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @f1() {
%1 = tail call dereferenceable_or_null(10) i8* @malloc(i64 10)
%2 = tail call i8* @realloc(i8* %1, i32 10)
%3 = tail call i32 @free(i8* %2)
ret void
}
int ffs(mask)
register int mask;
{
  register int bit;
  if (mask == 0)
    return (0);
  for (bit = 1; !(mask & 1); bit++)
    mask >>= 1;
  return (bit);
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    115c <ffs+0x5c>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113f <ffs+0x3f>
jmp    1156 <ffs+0x56>
mov    -0x8(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <ffs+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112e <ffs+0x2e>
mov    $0x1,%eax
test   $0x1,%dil
jne    112d <ffs+0x2d>
mov    $0x1,%eax
mov    %edi,%ecx
cs nopw 0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
test   $0x2,%dil
mov    %ecx,%edi
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ %0, %3 ]
%9 = ashr i32 %8, 1
%10 = add nuw nsw i32 %7, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %10, %6 ]
ret i32 %14
}
/* Variables and functions */
int fn_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(
    char const *);
int fn_al_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(i8* %0) {
%2 = tail call i32 @fn_sq_ch_83_ch_97_ch_109_ch_101_ch_73_ch_110_ch_100_ch_105_ch_118_ch_105_ch_100_ch_117_ch_97_ch_108(i8* %0)
ret i32 %2
}
/* Variables and functions */
int close(void *);
int mtv_drv_close(void *hDevice) {
  int res = 1;
  res = close(hDevice);
  return 0;
}


x86 assembly (clang, -O0):
<mtv_drv_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mtv_drv_close(i8* %0) {
%2 = tail call i32 @close(i8* %0)
ret i32 0
}