xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ *write_uint16(int /*<<< orphan*/, int /*<<< orphan*/ *);
uint8_t *write_data_item(uint8_t *msg, uint16_t type, uint16_t length) {
  uint8_t *p = write_uint16(type, msg);
  return write_uint16(length, p);
}


x86 assembly (clang, -O0):
<write_data_item>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <write_uint16@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1030 <write_uint16@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_data_item>:
push   %rbx
mov    %edx,%ebx
mov    %rdi,%rax
mov    %esi,%edi
mov    %rax,%rsi
call   1030 <write_uint16@plt>
mov    %ebx,%edi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <write_uint16@plt>

LLVM IR (-O0):
define i32* @write_data_item(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32*, i32** %4
%10 = call i32* @write_uint16(i32 %8, i32* %9)
store i32* %10, i32** %7
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
%13 = call i32* @write_uint16(i32 %11, i32* %12)
ret i32* %13
}

LLVM IR (-O2):
define i32* @write_data_item(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32* @write_uint16(i32 %1, i32* %0)
%5 = tail call i32* @write_uint16(i32 %2, i32* %4)
ret i32* %5
}
long main() {
  long g;
  g = 6 / 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ humdev(float const, float const, float, float, float, float);
float humdev_dkdx(const float x, const float y) {
  float k, l, dkdx, dkdy;
  humdev(x, y, k, l, dkdx, dkdy);
  return dkdx;
}


x86 assembly (clang, -O0):
<humdev_dkdx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
call   1030 <humdev@plt>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define float @humdev_dkdx(float %0, float %1) {
%3 = tail call i32 @humdev(float %0, float %1, float undef, float undef, float undef, float undef)
ret float undef
}
/* Type definitions */
struct strarray {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sa_push(struct strarray *, char *);
void sa_push_c(struct strarray *p, int c) {
  char s[2] = {c, '\0'};
  sa_push(p, s);
}


x86 assembly (clang, -O0):
<sa_push_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xe(%rbp)
movb   $0x0,-0xd(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1030 <sa_push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sa_push_c>:
push   %rax
mov    %sil,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rsi
call   1030 <sa_push@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.strarray = type { i32 }
define void @sa_push_c(%struct.strarray* %0, i32 %1) {
%3 = alloca %struct.strarray*
%4 = alloca i32
%5 = alloca [2 x i8]
store %struct.strarray* %0, %struct.strarray** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %4
%8 = trunc i32 %7 to i8
store i8 %8, i8* %6
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8 0, i8* %9
%10 = load %struct.strarray*, %struct.strarray** %3
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %5, i64 0, i64 0
%12 = call i32 @sa_push(%struct.strarray* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.strarray = type { i32 }
define void @sa_push_c(%struct.strarray* %0, i32 %1) {
%3 = alloca [2 x i8]
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = trunc i32 %1 to i8
store i8 %5, i8* %4
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 0, i8* %6
%7 = call i32 @sa_push(%struct.strarray* %0, i8* %4)
ret void
}
void sec_gaf_supply_rqinfo(unsigned short curr_offset,
                           unsigned short rq_offset) {}


x86 assembly (clang, -O0):
<sec_gaf_supply_rqinfo>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sec_gaf_supply_rqinfo(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
ret void
}

LLVM IR (-O2):
define void @sec_gaf_supply_rqinfo(i16 zeroext %0, i16 zeroext %1) {
ret void
}
int jw_int_compare(const void *key1, const void *key2) {
  long i1 = (long)key1;
  long i2 = (long)key2;
  if (i1 < i2) {
    return -1;
  }
  return (i1 == i2 ? 0 : 1);
}


x86 assembly (clang, -O0):
<jw_int_compare>:
push   %rbp
mov    %rsp,%rbp
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
cmp    -0x28(%rbp),%rax
jge    1136 <jw_int_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <jw_int_compare+0x4e>
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rsi
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jw_int_compare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @jw_int_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp slt i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[], char *envp[]) {
  char **p = envp;
  for (int i = 0; p[i] != NULL; ++p) {
    printf("%s\n", p[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1175 <main+0x65>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
jmp    1139 <main+0x29>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    (%rdx),%rsi
test   %rsi,%rsi
je     1144 <main+0x34>
mov    %rdx,%rbx
add    $0x8,%rbx
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %7
6: ; preds = %7, %3
ret i32 0
7: ; preds = %3, %7
%8 = phi i8* [ %12, %7 ], [ %4, %3 ]
%9 = phi i8** [ %11, %7 ], [ %2, %3 ]
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
int fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int truncate_file(const char *path) {
  assert(path);
  FILE *f = fopen(path, "w");
  if (f) {
    return (fclose(f));
  }
  return (-1);
}


x86 assembly (clang, -O0):
<truncate_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
lea    0xeb0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1175 <truncate_file+0x45>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <truncate_file+0x4c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<truncate_file>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
test   %rax,%rax
je     1156 <truncate_file+0x26>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @truncate_file(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @fclose(i32* %3)
br label %7
7: ; preds = %1, %5
%8 = phi i32 [ %6, %5 ], [ -1, %1 ]
ret i32 %8
}
long foo(long n, long m) { return n - (n / m) * m; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1118 <foo+0x18>
cqto
idiv   %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @foo(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sdiv i64 %6, %7
%9 = load i64, i64* %4
%10 = mul nsw i64 %8, %9
%11 = sub nsw i64 %5, %10
ret i64 %11
}

LLVM IR (-O2):
define i64 @foo(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
ret i64 %3
}
void *test_anti_range_68(long n) {
  extern void *alloc_anti_range_68(long) __attribute__((alloc_size(1)));
  if (0 <= n && n <= 0)
    n = 0 - 1;
  return alloc_anti_range_68(n);
}


x86 assembly (clang, -O0):
<test_anti_range_68>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jg     113b <test_anti_range_68+0x2b>
cmpq   $0x0,-0x8(%rbp)
jg     113b <test_anti_range_68+0x2b>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rdi
call   1030 <alloc_anti_range_68@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_68>:
cmp    $0x1,%rdi
sbb    %rax,%rax
or     %rax,%rdi
jmp    1030 <alloc_anti_range_68@plt>

LLVM IR (-O0):
define i8* @test_anti_range_68(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sle i64 0, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = icmp sle i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
store i64 -1, i64* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i64, i64* %2
%11 = call i8* @alloc_anti_range_68(i64 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_68(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 -1, i64 %0
%4 = tail call i8* @alloc_anti_range_68(i64 %3)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
void clr4(int *x) { memset(x, 0, 4); }


x86 assembly (clang, -O0):
<clr4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr4>:
xor    %esi,%esi
mov    $0x4,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clr4(i32* %0) {
%2 = tail call i32 @memset(i32* %0, i32 0, i32 4)
ret void
}
void run() {}


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

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

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

LLVM IR (-O2):
define void @run() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_attr_init(int /*<<< orphan*/ *);
int pthread_attr_setaffinity_np(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                int /*<<< orphan*/ *);
int main(void) {
  int ret = 0;
  pthread_attr_t thread_attr;
  pthread_attr_init(&thread_attr);
  ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <pthread_attr_init@plt>
lea    -0xc(%rbp),%rdi
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <pthread_attr_setaffinity_np@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pthread_attr_init@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <pthread_attr_setaffinity_np@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 @pthread_attr_init(i32* %3)
%5 = call i32 @pthread_attr_setaffinity_np(i32* %3, i32 0, i32* null)
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pthread_attr_init(i32* %1)
%4 = call i32 @pthread_attr_setaffinity_np(i32* %1, i32 0, i32* null)
ret i32 %4
}
/* Variables and functions */
void callback_null_arg(void (*callback)(void *)) { callback(NULL); }


x86 assembly (clang, -O0):
<callback_null_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   *-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback_null_arg>:
mov    %rdi,%rax
xor    %edi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define void @callback_null_arg(void (i8*)* nocapture %0) {
tail call void %0(i8* null)
ret void
}
char const *_Locale_extract_ctype_name(const char *__DUMMY_PAR1,
                                       char *__DUMMY_PAR,
                                       struct _Locale_name_hint *hint) {
  return 0;
}


x86 assembly (clang, -O0):
<_Locale_extract_ctype_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._Locale_name_hint = type opaque
define i8* @_Locale_extract_ctype_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca %struct._Locale_name_hint*
store i8* %0, i8** %4
store i8* %1, i8** %5
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %6
ret i8* null
}

LLVM IR (-O2):
%struct._Locale_name_hint = type opaque
define noalias i8* @_Locale_extract_ctype_name(i8* nocapture readnone %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2) {
ret i8* null
}
int autoscan_init(struct wpa_supplicant *wpa_s, int req_scan) { return 0; }


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define i32 @autoscan_init(%struct.wpa_supplicant* %0, i32 %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca i32
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @autoscan_init(%struct.wpa_supplicant* nocapture readnone %0, i32 %1) {
ret i32 0
}
char *io_log(s, plen, inst)
char *s;
int *plen;
int inst;
{
  write(inst, s, *plen);
  return (s);
}


x86 assembly (clang, -O0):
<io_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_log>:
push   %rbx
mov    %edx,%eax
mov    %rdi,%rbx
mov    (%rsi),%edx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <write@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @io_log(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %7, i8* %8, i32 %10)
%12 = load i8*, i8** %4
ret i8* %12
}

LLVM IR (-O2):
define i8* @io_log(i8* returned %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %1
%5 = tail call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i32, ...)*)(i32 %2, i8* %0, i32 %4)
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ __sh_and(int *, int /*<<< orphan*/);
void a_and_64(volatile uint64_t *p, uint64_t v) {
  union {
    uint64_t v;
    uint32_t r[2];
  } u = {v};
  __sh_and((int *)p, u.r[0]);
  __sh_and((int *)p + 1, u.r[1]);
}


x86 assembly (clang, -O0):
<a_and_64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <__sh_and@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    -0x14(%rbp),%esi
call   1030 <__sh_and@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_and_64>:
push   %rbx
mov    %rdi,%rbx
call   1030 <__sh_and@plt>
add    $0x4,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <__sh_and@plt>

LLVM IR (-O0):
%union.anon = type { [2 x i32] }
define void @a_and_64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %union.anon
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = bitcast %union.anon* %5 to i32*
%7 = load i32, i32* %4
store i32 %7, i32* %6
%8 = load i32*, i32** %3
%9 = bitcast %union.anon* %5 to [2 x i32]*
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %9, i64 0, i64 0
%11 = load i32, i32* %10
%12 = call i32 @__sh_and(i32* %8, i32 %11)
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = bitcast %union.anon* %5 to [2 x i32]*
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %15, i64 0, i64 1
%17 = load i32, i32* %16
%18 = call i32 @__sh_and(i32* %14, i32 %17)
ret void
}

LLVM IR (-O2):
define void @a_and_64(i32* %0, i32 %1) {
%3 = tail call i32 @__sh_and(i32* %0, i32 %1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = tail call i32 @__sh_and(i32* %4, i32 undef)
ret void
}
void f2(void *para) {}


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

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

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

LLVM IR (-O2):
define void @f2(i8* nocapture %0) {
ret void
}
int main() {
  unsigned int arg = 0x1;
  unsigned int out = 0;
  __asm__("rorl $1, %%eax;" : "=a"(out) : "a"(arg));
  return (out == 0x80000000);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
ror    %eax
mov    %eax,-0xc(%rbp)
cmpl   $0x80000000,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
ror    %eax
xor    %ecx,%ecx
cmp    $0x80000000,%eax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = call i32 asm "rorl $$1, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -2147483648
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 asm "rorl $$1, %eax;", "={ax},{ax},~{dirflag},~{fpsr},~{flags}"(i32 1)
%2 = icmp eq i32 %1, -2147483648
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
double CumSum(double *, int);
double scalCumSum(double *xa, int n) { return CumSum(xa, n); }


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

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

LLVM IR (-O0):
define double @scalCumSum(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = call double @CumSum(double* %5, i32 %6)
ret double %7
}

LLVM IR (-O2):
define double @scalCumSum(double* %0, i32 %1) {
%3 = tail call double @CumSum(double* %0, i32 %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0x7a() {
  Assert_real((iscntrl(122) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_iscntrl.c",
              615, ("iscntrl should be 0 for z"));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for z\00"
define void @t_iscntrl_0x7a() {
%1 = call i64 @iscntrl(i32 122)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, 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_iscntrl.c\00"
@.str.1 = [26 x i8] c"iscntrl should be 0 for z\00"
define void @t_iscntrl_0x7a() {
%1 = tail call i64 @iscntrl(i32 122)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 615, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int hex_degree(int step) {
  int i = 0;
  int j = 0;
  int res = 1;
  for (i = 0; i < step; ++i) {
    res = res * 16;
  }
  return res;
}


x86 assembly (clang, -O0):
<hex_degree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1146 <hex_degree+0x46>
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1123 <hex_degree+0x23>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hex_degree>:
test   %edi,%edi
jle    1139 <hex_degree+0x39>
lea    -0x1(%rdi),%edx
mov    %edi,%ecx
and    $0x7,%ecx
mov    $0x1,%eax
cmp    $0x7,%edx
jb     1127 <hex_degree+0x27>
and    $0xfffffff8,%edi
nopl   0x0(%rax)
add    $0xfffffff8,%edi
jne    1120 <hex_degree+0x20>
xor    %eax,%eax
test   %ecx,%ecx
je     113f <hex_degree+0x3f>
nopl   0x0(%rax,%rax,1)
shl    $0x4,%eax
add    $0xffffffff,%ecx
jne    1130 <hex_degree+0x30>
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hex_degree(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %22
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %13, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 0, %7 ], [ %11, %9 ]
%11 = add i32 %10, 8
%12 = icmp eq i32 %11, %8
br i1 %12, label %13, label %9
13: ; preds = %9, %3
%14 = phi i32 [ 1, %3 ], [ 0, %9 ]
%15 = icmp eq i32 %5, 0
br i1 %15, label %22, label %16
16: ; preds = %13, %16
%17 = phi i32 [ %19, %16 ], [ %14, %13 ]
%18 = phi i32 [ %20, %16 ], [ 0, %13 ]
%19 = shl nsw i32 %17, 4
%20 = add i32 %18, 1
%21 = icmp eq i32 %20, %5
br i1 %21, label %22, label %16
22: ; preds = %13, %16, %1
%23 = phi i32 [ 1, %1 ], [ 0, %13 ], [ %19, %16 ]
ret i32 %23
}
/* Variables and functions */
int fi(unsigned int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  unsigned int n = 10;
  printf("sum of fibonacci = %d\n", fi(n));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"sum of fibonacci = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @fi(i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"sum of fibonacci = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @fi(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void EXTI0_IRQHandler(void) {}


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

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

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

LLVM IR (-O2):
define void @EXTI0_IRQHandler() {
ret void
}
int request_module(const char *name, ...) { return -38; }


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

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

LLVM IR (-O0):
define i32 @request_module(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 -38
}

LLVM IR (-O2):
define i32 @request_module(i8* nocapture readnone %0, ...) {
ret i32 -38
}
unsigned int lendianReadInt(unsigned char b[]) {
  unsigned int i;
  i = (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0];
  return i;
}


x86 assembly (clang, -O0):
<lendianReadInt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lendianReadInt(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @lendianReadInt(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
/* Variables and functions */
scalar_t__ COND_NE();
int /*<<< orphan*/ EA_A7_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_sne_8_pi7(void) {
  m68ki_write_8(EA_A7_PI_8(), COND_NE() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_sne_8_pi7>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <EA_A7_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <COND_NE@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_sne_8_pi7>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <EA_A7_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <COND_NE@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_sne_8_pi7() {
%1 = call i32 (...) @EA_A7_PI_8()
%2 = call i64 (...) @COND_NE()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_sne_8_pi7() {
%1 = tail call i32 (...) @EA_A7_PI_8()
%2 = tail call i64 (...) @COND_NE()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compute(int);
int example_add_var(int *array, int array_size) {
  compute(10);
  return 0;
}


x86 assembly (clang, -O0):
<example_add_var>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xa,%edi
call   1030 <compute@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @example_add_var(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @compute(i32 10)
ret i32 0
}
int ft_strbeginwith(char *a, char *b) {
  while (*b && *a == *b) {
    a++;
    b++;
  }
  if (!*a)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<ft_strbeginwith>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x19(%rbp)
je     1137 <ft_strbeginwith+0x37>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1147 <ft_strbeginwith+0x47>
jmp    1164 <ft_strbeginwith+0x64>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <ft_strbeginwith+0xc>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    117d <ft_strbeginwith+0x7d>
movl   $0x1,-0x4(%rbp)
jmp    1184 <ft_strbeginwith+0x84>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strbeginwith>:
mov    (%rsi),%al
test   %al,%al
je     1123 <ft_strbeginwith+0x23>
add    $0x1,%rsi
nopw   0x0(%rax,%rax,1)
cmp    %al,(%rdi)
jne    1123 <ft_strbeginwith+0x23>
add    $0x1,%rdi
movzbl (%rsi),%eax
add    $0x1,%rsi
test   %al,%al
jne    1110 <ft_strbeginwith+0x10>
xor    %eax,%eax
cmpb   $0x0,(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @ft_strbeginwith(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, %6
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %0, %2 ], [ %12, %11 ], [ %8, %5 ]
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
%20 = zext i1 %19 to i32
ret i32 %20
}
/* Variables and functions */
int exp(float);
float expdist(float x, float power) {
  return (exp(x * power) - 1) / (exp(power) - 1);
}


x86 assembly (clang, -O0):
<expdist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
sub    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expdist>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
mulss  %xmm1,%xmm0
call   1030 <exp@plt>
mov    %eax,%ebx
add    $0xffffffff,%ebx
movss  0xc(%rsp),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @expdist(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 = load float, float* %4
%7 = fmul float %5, %6
%8 = call i32 @exp(float %7)
%9 = sub nsw i32 %8, 1
%10 = load float, float* %4
%11 = call i32 @exp(float %10)
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %9, %12
%14 = sitofp i32 %13 to float
ret float %14
}

LLVM IR (-O2):
define float @expdist(float %0, float %1) {
%3 = fmul float %0, %1
%4 = tail call i32 @exp(float %3)
%5 = add nsw i32 %4, -1
%6 = tail call i32 @exp(float %1)
%7 = add nsw i32 %6, -1
%8 = sdiv i32 %5, %7
%9 = sitofp i32 %8 to float
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  while (*argv != NULL) {
    fputs(*argv, stdout);
    fputc('\n', stdout);
    ++argv;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     117d <main+0x5d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%rdi
test   %rdi,%rdi
je     1161 <main+0x41>
mov    %rsi,%rbx
add    $0x8,%rbx
mov    0x2ea6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%r14),%esi
call   1030 <fputs@plt>
mov    (%r14),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1140 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@stdout = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8* [ %13, %5 ], [ %3, %2 ]
%7 = phi i8** [ %12, %5 ], [ %1, %2 ]
%8 = load i32, i32* @stdout
%9 = tail call i32 @fputs(i8* %6, i32 %8)
%10 = load i32, i32* @stdout
%11 = tail call i32 @fputc(i8 signext 10, i32 %10)
%12 = getelementptr inbounds i8*, i8** %7, i64 1
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret i32 0
}
void *nopPtr4(void *a1, void *a2, void *a3, void *a4) { return 0; }


x86 assembly (clang, -O0):
<nopPtr4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @nopPtr4(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @nopPtr4(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void wypisz(int x1, int x2) {
  printf("x1 = %d\n", x1);
  printf("x2 = %d\n", x2);
}


x86 assembly (clang, -O0):
<wypisz>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wypisz>:
push   %rbx
mov    %esi,%ebx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [9 x i8] c"x1 = %d\0A\00"
@.str.1 = [9 x i8] c"x2 = %d\0A\00"
define void @wypisz(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void displayDescription() {
  printf("Created: Aaron Jones/n");
  printf("");
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Created: Aaron Jones/n\00"
@.str.1 = [1 x i8] zeroinitializer
define void @displayDescription() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Created: Aaron Jones/n\00"
define void @displayDescription() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct Objs_cache {
  int dummy;
};

/* Variables and functions */
struct Objs_cache *_objs_cache_init(struct Objs_cache *, size_t, int,
                                    int /*<<< orphan*/, void (*)(void *),
                                    int /*<<< orphan*/ *);
struct Objs_cache *objs_cache_init(struct Objs_cache *cache, size_t obj_size,
                                   void (*ctor)(void *)) {
  return _objs_cache_init(cache, obj_size, 1, 0, ctor, NULL);
}


x86 assembly (clang, -O0):
<objs_cache_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%r8
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r9d
call   1030 <_objs_cache_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<objs_cache_init>:
mov    %rdx,%r8
mov    $0x1,%edx
xor    %ecx,%ecx
xor    %r9d,%r9d
jmp    1030 <_objs_cache_init@plt>

LLVM IR (-O0):
%struct.Objs_cache = type { i32 }
define %struct.Objs_cache* @objs_cache_init(%struct.Objs_cache* %0, i64 %1, void (i8*)* %2) {
%4 = alloca %struct.Objs_cache*
%5 = alloca i64
%6 = alloca void (i8*)*
store %struct.Objs_cache* %0, %struct.Objs_cache** %4
store i64 %1, i64* %5
store void (i8*)* %2, void (i8*)** %6
%7 = load %struct.Objs_cache*, %struct.Objs_cache** %4
%8 = load i64, i64* %5
%9 = load void (i8*)*, void (i8*)** %6
%10 = call %struct.Objs_cache* @_objs_cache_init(%struct.Objs_cache* %7, i64 %8, i32 1, i32 0, void (i8*)* %9, i32* null)
ret %struct.Objs_cache* %10
}

LLVM IR (-O2):
%struct.Objs_cache = type { i32 }
define %struct.Objs_cache* @objs_cache_init(%struct.Objs_cache* %0, i64 %1, void (i8*)* %2) {
%4 = tail call %struct.Objs_cache* @_objs_cache_init(%struct.Objs_cache* %0, i64 %1, i32 1, i32 0, void (i8*)* %2, i32* null)
ret %struct.Objs_cache* %4
}