xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *, int *);
void handler(int num) {
  printf("%d\n", num);
  sigset_t set;
  int *p = &set;
  sigprocmask(SIG_BLOCK, NULL, &set);
  printf("0x%x, 0x%x\n", p[0], p[1]);
  return;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x8(%rbp),%rdx
call   1030 <sigprocmask@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rdx
xor    %esi,%esi
call   1030 <sigprocmask@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@SIG_BLOCK = global i32 0
@.str.1 = [12 x i8] c"0x%x, 0x%x\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32* %3, i32** %4
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* null, i32* %3)
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32, i32* %13
%15 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@SIG_BLOCK = global i32 0
@.str.1 = [12 x i8] c"0x%x, 0x%x\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = bitcast i32* %2 to i8*
%5 = load i32, i32* @SIG_BLOCK
%6 = call i32 @sigprocmask(i32 %5, i32* null, i32* %2)
%7 = load i32, i32* %2
%8 = getelementptr inbounds i32, i32* %2, i64 1
%9 = load i32, i32* %8
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %9)
ret void
}
unsigned long ICeil(unsigned long a, unsigned long b) {
  return ((a) + (b)-1) / (b);
}


x86 assembly (clang, -O0):
<ICeil>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICeil>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111a <ICeil+0x1a>
xor    %edx,%edx
div    %rsi
ret
xor    %edx,%edx
div    %esi
ret

LLVM IR (-O0):
define i64 @ICeil(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* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = udiv i64 %8, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @ICeil(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = udiv i64 %4, %1
ret i64 %5
}
unsigned char count_variables(char *minterm) {
  unsigned char counter = 0;
  while (*minterm++)
    counter++;
  return counter;
}


x86 assembly (clang, -O0):
<count_variables>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
je     1131 <count_variables+0x31>
mov    -0x9(%rbp),%al
add    $0x1,%al
mov    %al,-0x9(%rbp)
jmp    110c <count_variables+0xc>
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_variables>:
cmpb   $0x0,(%rdi)
je     111c <count_variables+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <count_variables+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @count_variables(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i8 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i8 [ 0, %1 ], [ %8, %4 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void exp15() {
  int x = 5, y = 7;
  if (x == y)
    ;
  { printf("not working\n"); }
  if (x)
    ;
}


x86 assembly (clang, -O0):
<exp15>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
movl   $0x7,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1137 <exp15+0x27>
jmp    1137 <exp15+0x27>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1152 <exp15+0x42>
jmp    1152 <exp15+0x42>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [12 x i8] c"not working\00"
define void @exp15() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
int MUSIC_StopSong(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @MUSIC_StopSong() {
ret i32 0
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf19(int f, int n) { return (cbuf(f, n, 19)); }


x86 assembly (clang, -O0):
<cbuf19>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x13,%edx
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf19>:
mov    $0x13,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf19(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 19)
ret i32 %3
}
/* Type definitions */
struct worker {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
int worker_sendmsg(struct worker *, void *);
int worker_sendmsg_or_free(struct worker *worker, void *m) {
  int ret = worker_sendmsg(worker, m);
  if (ret) {
    free(m);
  }
  return ret;
}


x86 assembly (clang, -O0):
<worker_sendmsg_or_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <worker_sendmsg@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1153 <worker_sendmsg_or_free+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker_sendmsg_or_free>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1040 <worker_sendmsg@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1139 <worker_sendmsg_or_free+0x19>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.worker = type { i32 }
define i32 @worker_sendmsg_or_free(%struct.worker* %0, i8* %1) {
%3 = alloca %struct.worker*
%4 = alloca i8*
%5 = alloca i32
store %struct.worker* %0, %struct.worker** %3
store i8* %1, i8** %4
%6 = load %struct.worker*, %struct.worker** %3
%7 = load i8*, i8** %4
%8 = call i32 @worker_sendmsg(%struct.worker* %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 i8*, i8** %4
%13 = call i32 @free(i8* %12)
br label %14
14: ; preds = %11, %2
%15 = load i32, i32* %5
ret i32 %15
}

LLVM IR (-O2):
%struct.worker = type { i32 }
define i32 @worker_sendmsg_or_free(%struct.worker* %0, i8* %1) {
%3 = tail call i32 @worker_sendmsg(%struct.worker* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(i8* %1)
br label %7
7: ; preds = %5, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int usage(const char *pname, int exit) {
  printf("Usage: %s FILE [15A [24B [...]]]\n"
         "\n"
         "Register inventory to file FILE.\n",
         pname);
  return exit;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %esi,%ebx
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [68 x i8] c"Usage: %s FILE [15A [24B [...]]]\0A\0ARegister inventory to file FILE.\0A\00"
define i32 @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i32, i32* %4
ret i32 %7
}

LLVM IR (-O2):
@.str = [68 x i8] c"Usage: %s FILE [15A [24B [...]]]\0A\0ARegister inventory to file FILE.\0A\00"
define i32 @usage(i8* %0, i32 returned %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
float Clamp(float t, float min, float max) {
  assert(min <= max);
  if (t < min)
    return min;
  if (t > max)
    return max;
  return t;
}


x86 assembly (clang, -O0):
<Clamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1163 <Clamp+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118b <Clamp+0x7b>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    1181 <Clamp+0x71>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118b <Clamp+0x7b>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Clamp>:
sub    $0x38,%rsp
movaps %xmm2,(%rsp)
movaps %xmm1,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
xor    %edi,%edi
ucomiss %xmm1,%xmm2
setae  %dil
call   1030 <assert@plt>
movaps 0x20(%rsp),%xmm1
movaps (%rsp),%xmm2
minss  %xmm1,%xmm2
movaps 0x10(%rsp),%xmm3
cmpltss %xmm3,%xmm1
movaps %xmm1,%xmm0
andnps %xmm2,%xmm0
andps  %xmm3,%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,%xmm0
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define float @Clamp(float %0, float %1, float %2) {
%4 = fcmp ole float %1, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = fcmp olt float %0, %1
%8 = fcmp ogt float %0, %2
%9 = select i1 %8, float %2, float %0
%10 = select i1 %7, float %1, float %9
ret float %10
}
/* Variables and functions */
int add(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int variable = 10;
  int new_variable = add(variable);
  printf("%d\n", new_variable);
  printf("%d\n", add(40));
  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   1030 <add@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
call   1040 <printf@plt>
mov    $0x28,%edi
call   1030 <add@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @add(i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @add(i32 40)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
float load_be_float(const uint8_t *p) {
  union {
    float f;
    uint8_t b[sizeof(float)];
  } u;
  u.b[0] = p[3];
  u.b[1] = p[2];
  u.b[2] = p[1];
  u.b[3] = p[0];
  return u.f;
}


x86 assembly (clang, -O0):
<load_be_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_be_float>:
movss  0xc(%rdi),%xmm0
ret

LLVM IR (-O0):
%union.anon = type { [4 x i32] }
define float @load_be_float(i32* %0) {
%2 = alloca i32*
%3 = alloca %union.anon
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 3
%6 = load i32, i32* %5
%7 = bitcast %union.anon* %3 to [4 x i32]*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 %6, i32* %8
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 2
%11 = load i32, i32* %10
%12 = bitcast %union.anon* %3 to [4 x i32]*
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %12, i64 0, i64 1
store i32 %11, i32* %13
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = bitcast %union.anon* %3 to [4 x i32]*
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %17, i64 0, i64 2
store i32 %16, i32* %18
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = bitcast %union.anon* %3 to [4 x i32]*
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %22, i64 0, i64 3
store i32 %21, i32* %23
%24 = bitcast %union.anon* %3 to float*
%25 = load float, float* %24
ret float %25
}

LLVM IR (-O2):
define float @load_be_float(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = bitcast i32* %2 to float*
%4 = load float, float* %3
ret float %4
}
int main() { return '\''; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x27,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 39
}
/* Variables and functions */
int setenv(char const *, char const *, int);
int globus_libc_setenv(register const char *name, register const char *value,
                       int rewrite) {
  return setenv(name, value, rewrite);
}


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

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

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

LLVM IR (-O2):
define i32 @globus_libc_setenv(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @setenv(i8* %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
char *strcpy(char *d, const char *s) {
  size_t i;
  for (i = 0; (d[i] = s[i]) != '\0'; i++)
    ;
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
cmp    $0x0,%eax
je     114c <strcpy+0x4c>
jmp    113b <strcpy+0x3b>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i8, i8* %1, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 %6, i8* %7
%8 = icmp eq i8 %6, 0
%9 = add i64 %4, 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %0
}
void av_packet_merge_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_merge_side_data() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
void set_nonblock(int fd) {
  int fl;
  fl = fcntl(fd, F_GETFL, 0);
  fl = fcntl(fd, F_SETFL, fl | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<set_nonblock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2ea1(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
mov    %eax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_nonblock>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    0x2eae(%rip),%rcx
mov    (%rcx),%esi
mov    0x2eb5(%rip),%rcx
or     (%rcx),%eax
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* @F_SETFL
%9 = load i32, i32* %3
%10 = load i32, i32* @O_NONBLOCK
%11 = or i32 %9, %10
%12 = call i32 @fcntl(i32 %7, i32 %8, i32 %11)
store i32 %12, i32* %3
ret void
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define void @set_nonblock(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = load i32, i32* @F_SETFL
%5 = load i32, i32* @O_NONBLOCK
%6 = or i32 %5, %3
%7 = tail call i32 @fcntl(i32 %0, i32 %4, i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putint(int);
int ft_strlen(char *str) {
  int compt;
  compt = 0;
  while (*str != '\0') {
    compt++;
    str++;
  }
  ft_putint(compt);
  return 0;
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <ft_strlen+0x3d>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <ft_strlen+0x13>
mov    -0xc(%rbp),%edi
call   1030 <ft_putint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
push   %rax
cmpb   $0x0,(%rdi)
je     112d <ft_strlen+0x1d>
mov    %rdi,%rax
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rax,%rdi,1)
lea    0x1(%rdi),%rdi
jne    1120 <ft_strlen+0x10>
jmp    112f <ft_strlen+0x1f>
xor    %edi,%edi
call   1030 <ft_putint@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
%13 = tail call i32 @ft_putint(i32 %12)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGABRT;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void eiki_abort() {
  signal(SIGABRT, SIG_DFL);
  abort();
}


x86 assembly (clang, -O0):
<eiki_abort>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<eiki_abort>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2eaf(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @eiki_abort() {
%1 = load i32, i32* @SIGABRT
%2 = load i32, i32* @SIG_DFL
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@SIGABRT = global i32 0
@SIG_DFL = global i32 0
define void @eiki_abort() {
%1 = load i32, i32* @SIGABRT
%2 = load i32, i32* @SIG_DFL
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cm_print_error(char *, int);
int /*<<< orphan*/ exit_test(int);
void exception_handler(int sig) {
  cm_print_error("Test failed with exception: %d\n", sig);
  exit_test(1);
}


x86 assembly (clang, -O0):
<exception_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1040 <cm_print_error@plt>
mov    $0x1,%edi
call   1030 <exit_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exception_handler>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
call   1040 <cm_print_error@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <exit_test@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Test failed with exception: %d\0A\00"
define void @exception_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cm_print_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @exit_test(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"Test failed with exception: %d\0A\00"
define void @exception_handler(i32 %0) {
%2 = tail call i32 @cm_print_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @exit_test(i32 1)
ret void
}
/* Variables and functions */
int compute_something(int);
int main(void) { return compute_something(1); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <compute_something@plt>

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

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


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_qpel_hv4_12_sse4() {
ret void
}
void avpriv_atomic_int_set(volatile int *ptr, int val) { *ptr = val; }


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

x86 assembly (clang, -O2):
<avpriv_atomic_int_set>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @avpriv_atomic_int_set(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
store volatile i32 %5, i32* %6
ret void
}

LLVM IR (-O2):
define void @avpriv_atomic_int_set(i32* %0, i32 %1) {
store volatile i32 %1, i32* %0
ret void
}
/* Variables and functions */
bool nrf51_errata_66(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_66() {
ret i32 0
}
int head_check(unsigned int head) {
  if ((head & 0xffe00000) != 0xffe00000)
    return 0;
  if (!((head >> 17) & 3))
    return 0;
  if (((head >> 12) & 0xf) == 0xf)
    return 0;
  if (((head >> 10) & 0x3) == 0x3)
    return 0;
  if ((head & 0xffff0000) == 0xfffe0000)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<head_check>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffe00000,%eax
cmp    $0xffe00000,%eax
je     1126 <head_check+0x26>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <head_check+0xa6>
mov    -0x8(%rbp),%eax
shr    $0x11,%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1144 <head_check+0x44>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <head_check+0xa6>
mov    -0x8(%rbp),%eax
shr    $0xc,%eax
and    $0xf,%eax
cmp    $0xf,%eax
jne    1162 <head_check+0x62>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <head_check+0xa6>
mov    -0x8(%rbp),%eax
shr    $0xa,%eax
and    $0x3,%eax
cmp    $0x3,%eax
jne    1180 <head_check+0x80>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <head_check+0xa6>
mov    -0x8(%rbp),%eax
and    $0xffff0000,%eax
cmp    $0xfffe0000,%eax
jne    119f <head_check+0x9f>
movl   $0x0,-0x4(%rbp)
jmp    11a6 <head_check+0xa6>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<head_check>:
cmp    $0xffe00000,%edi
setae  %al
test   $0x60000,%edi
setne  %cl
and    %al,%cl
mov    %edi,%eax
not    %eax
test   $0xf000,%eax
setne  %dl
and    %cl,%dl
test   $0xc00,%eax
setne  %al
and    $0xffff0000,%edi
cmp    $0xfffe0000,%edi
setne  %cl
and    %al,%cl
and    %dl,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @head_check(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = and i32 %4, -2097152
%6 = icmp ne i32 %5, -2097152
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %32
8: ; preds = %1
%9 = load i32, i32* %3
%10 = lshr i32 %9, 17
%11 = and i32 %10, 3
%12 = icmp ne i32 %11, 0
br i1 %12, label %14, label %13
13: ; preds = %8
store i32 0, i32* %2
br label %32
14: ; preds = %8
%15 = load i32, i32* %3
%16 = lshr i32 %15, 12
%17 = and i32 %16, 15
%18 = icmp eq i32 %17, 15
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %2
br label %32
20: ; preds = %14
%21 = load i32, i32* %3
%22 = lshr i32 %21, 10
%23 = and i32 %22, 3
%24 = icmp eq i32 %23, 3
br i1 %24, label %25, label %26
25: ; preds = %20
store i32 0, i32* %2
br label %32
26: ; preds = %20
%27 = load i32, i32* %3
%28 = and i32 %27, -65536
%29 = icmp eq i32 %28, -131072
br i1 %29, label %30, label %31
30: ; preds = %26
store i32 0, i32* %2
br label %32
31: ; preds = %26
store i32 1, i32* %2
br label %32
32: ; preds = %31, %30, %25, %19, %13, %7
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @head_check(i32 %0) {
%2 = icmp ult i32 %0, -2097152
%3 = and i32 %0, 393216
%4 = icmp eq i32 %3, 0
%5 = or i1 %2, %4
%6 = and i32 %0, 61440
%7 = icmp eq i32 %6, 61440
%8 = or i1 %7, %5
%9 = and i32 %0, 3072
%10 = icmp eq i32 %9, 3072
%11 = or i1 %10, %8
%12 = and i32 %0, -65536
%13 = icmp ne i32 %12, -131072
%14 = xor i1 %11, true
%15 = and i1 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int, char const *, int /*<<< orphan*/);
void writes(const char *p) { write(2, p, strlen(p)); }


x86 assembly (clang, -O0):
<writes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x2,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writes>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>

LLVM IR (-O0):
define void @writes(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @write(i32 2, i8* %3, i32 %5)
ret void
}

LLVM IR (-O2):
define void @writes(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @write(i32 2, i8* %0, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ pthread_exit(void *);
void *functionC(void *p0) {
  pthread_exit(p0);
  printf("ERROR: This code comes after pthread_exit. It should not be "
         "executed!\n");
  assert(0);
}


x86 assembly (clang, -O0):
<functionC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pthread_exit@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<functionC>:
push   %rax
call   1050 <pthread_exit@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <assert@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"ERROR: This code comes after pthread_exit. It should not be executed!\0A\00"
define i8* @functionC(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @pthread_exit(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @assert(i32 0)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
@str = [70 x i8] c"ERROR: This code comes after pthread_exit. It should not be executed!\00"
define noalias i8* @functionC(i8* %0) {
%2 = tail call i32 @pthread_exit(i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @assert(i32 0)
ret i8* undef
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int32_t get_byte(int32_t id, int32_t addr) { return 0xFFFFFFFF; }


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

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

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

LLVM IR (-O2):
define i32 @get_byte(i32 %0, i32 %1) {
ret i32 -1
}
/* Variables and functions */
int is_valid_block_size(const size_t n) {
  return ((n > 0) && (0 == n % (2 * sizeof(size_t))));
}


x86 assembly (clang, -O0):
<is_valid_block_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jbe    112b <is_valid_block_size+0x2b>
mov    -0x8(%rbp),%rcx
and    $0xf,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_block_size>:
test   %rdi,%rdi
setne  %al
test   $0xf,%dil
sete   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @is_valid_block_size(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i64, i64* %2
%7 = urem i64 %6, 16
%8 = icmp eq i64 0, %7
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ false, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @is_valid_block_size(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = and i64 %0, 15
%4 = icmp eq i64 %3, 0
%5 = and i1 %2, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ isspace(char);
char *skip_whitespace(char *str) {
  while (isspace(*str)) {
    str++;
  }
  return str;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_whitespace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ *stdin;
int main(int argc, const char *argv[]) {
  extern int yyparse(void);
  extern FILE *yyin;
  yyin = stdin;
  if (yyparse()) {
    fprintf(stderr, "error \n");
    exit(-1);
  }
  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    0x2e9b(%rip),%rax
mov    (%rax),%rcx
mov    0x2e79(%rip),%rax
mov    %rcx,(%rax)
call   1030 <yyparse@plt>
cmp    $0x0,%eax
je     1187 <main+0x57>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%rax
mov    0x2e8e(%rip),%rcx
mov    %rax,(%rcx)
call   1030 <yyparse@plt>
test   %eax,%eax
jne    1152 <main+0x22>
xor    %eax,%eax
pop    %rcx
ret
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdin = global i32* null
@yyin = external global i32*
@stderr = global i32 0
@.str = [8 x i8] c"error \0A\00"
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
%6 = load i32*, i32** @stdin
store i32* %6, i32** @yyin
%7 = call i32 @yyparse()
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @exit(i32 -1)
unreachable
13: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@stdin = global i32* null
@yyin = external global i32*
@stderr = global i32 0
@.str = [8 x i8] c"error \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32*, i32** @stdin
store i32* %3, i32** @yyin
%4 = tail call i32 @yyparse()
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x9b() {
  Assert_real((isalpha(155) == 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_isalpha.c",
              780, ("isalpha should be 0 for 0x9b"));
}


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

x86 assembly (clang, -O2):
<t_isalpha_0x9b>:
push   %rax
mov    $0x9b,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x30c,%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_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x9b\00"
define void @t_isalpha_0x9b() {
%1 = call i64 @isalpha(i32 155)
%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 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0x9b\00"
define void @t_isalpha_0x9b() {
%1 = tail call i64 @isalpha(i32 155)
%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 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t enrange(uint16_t x) { return x & 0x7fff; }


x86 assembly (clang, -O0):
<enrange>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<enrange>:
mov    %edi,%eax
and    $0x7fff,%eax
ret

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

LLVM IR (-O2):
define i32 @enrange(i32 %0) {
%2 = and i32 %0, 32767
ret i32 %2
}
int stringContains(char s[], char c) {
  int i;
  for (i = 0; s[i] != '\0'; ++i)
    if (c == s[i])
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<stringContains>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1160 <stringContains+0x60>
movsbl -0x11(%rbp),%eax
mov    -0x10(%rbp),%rcx
movslq -0x18(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    114d <stringContains+0x4d>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <stringContains+0x67>
jmp    1152 <stringContains+0x52>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <stringContains+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringContains>:
mov    (%rdi),%dl
mov    $0xffffffff,%eax
test   %dl,%dl
je     1122 <stringContains+0x22>
xor    %ecx,%ecx
nopl   (%rax)
cmp    %sil,%dl
je     1123 <stringContains+0x23>
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <stringContains+0x10>
ret
mov    %ecx,%eax
ret

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

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