xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ dirwalk(char const *, int (*)(char const *));
scalar_t__ is_dir(char const *);
int remove_file(char const *);
int remove_dir(const char *name) {
  if (is_dir(name))
    dirwalk(name, remove_dir);
  return remove_file(name);
}


x86 assembly (clang, -O0):
<remove_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_dir@plt>
cmp    $0x0,%rax
je     115f <remove_dir+0x2f>
mov    -0x8(%rbp),%rdi
mov    0x2e8e(%rip),%rsi
call   1050 <dirwalk@plt>
mov    -0x8(%rbp),%rdi
call   1040 <remove_file@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_dir>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_dir@plt>
test   %rax,%rax
je     114d <remove_dir+0x1d>
mov    0x2ea3(%rip),%rsi
mov    %rbx,%rdi
call   1050 <dirwalk@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <remove_file@plt>

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

LLVM IR (-O2):
define i32 @remove_dir(i8* %0) {
%2 = tail call i64 @is_dir(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @dirwalk(i8* %0, i32 (i8*)* @remove_dir)
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @remove_file(i8* %0)
ret i32 %7
}
void timer(int seconds) {
  int i;
  while (seconds--) {
    for (i = 0; i < 300000000; i++)
      ;
  }
}


x86 assembly (clang, -O0):
<timer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1147 <timer+0x47>
movl   $0x0,-0x8(%rbp)
cmpl   $0x11e1a300,-0x8(%rbp)
jge    1142 <timer+0x42>
jmp    1134 <timer+0x34>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <timer+0x22>
jmp    1107 <timer+0x7>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @timer(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ sscanf(char *, char *, int *);
int parse_bracketed_int(char *s) {
  int i;
  return sscanf(s, "[%d]", &i) ? i : -1;
}


x86 assembly (clang, -O0):
<parse_bracketed_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <sscanf@plt>
cmp    $0x0,%rax
je     1145 <parse_bracketed_int+0x35>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <parse_bracketed_int+0x42>
mov    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1152 <parse_bracketed_int+0x42>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_bracketed_int>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1030 <sscanf@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"[%d]\00"
define i32 @parse_bracketed_int(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i64 @sscanf(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i64 %4, 0
%6 = load i32, i32* %2
%7 = select i1 %5, i32 -1, i32 %6
ret i32 %7
}
int NullAtom(const char *in) {
  return (in[0] == 'n' && in[1] == 'u' && in[2] == 'l' && in[3] == 'l');
}


x86 assembly (clang, -O0):
<NullAtom>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x6e,%ecx
mov    %al,-0x9(%rbp)
jne    115a <NullAtom+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x75,%ecx
mov    %al,-0x9(%rbp)
jne    115a <NullAtom+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x6c,%ecx
mov    %al,-0x9(%rbp)
jne    115a <NullAtom+0x5a>
mov    -0x8(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x6c,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NullAtom>:
xor    %eax,%eax
cmpb   $0x6e,(%rdi)
jne    111c <NullAtom+0x1c>
cmpb   $0x75,0x1(%rdi)
jne    111c <NullAtom+0x1c>
cmpb   $0x6c,0x2(%rdi)
jne    111c <NullAtom+0x1c>
xor    %eax,%eax
cmpb   $0x6c,0x3(%rdi)
sete   %al
ret

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

LLVM IR (-O2):
define i32 @NullAtom(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 110
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 117
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 108
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 108
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %12, %8, %4, %1
%18 = phi i32 [ 0, %8 ], [ 0, %4 ], [ 0, %1 ], [ %16, %12 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *hello_world(void **args) {
  printf("Hello World!!!\n");
  sleep(5);
}


x86 assembly (clang, -O0):
<hello_world>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1040 <sleep@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello_world>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
pop    %rax
jmp    1040 <sleep@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"Hello World!!!\0A\00"
define i8* @hello_world(i8** %0) {
%2 = alloca i8*
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @sleep(i32 5)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@str = [15 x i8] c"Hello World!!!\00"
define noalias i8* @hello_world(i8** nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @sleep(i32 5)
ret i8* undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ internal_fiat_p256_divstep_precomp(uintptr_t);
void fiat_p256_divstep_precomp(uint32_t out1[8]) {
  internal_fiat_p256_divstep_precomp((uintptr_t)out1);
}


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

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

LLVM IR (-O0):
define void @fiat_p256_divstep_precomp(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = ptrtoint i32* %3 to i64
%5 = call i32 @internal_fiat_p256_divstep_precomp(i64 %4)
ret void
}

LLVM IR (-O2):
define void @fiat_p256_divstep_precomp(i32* %0) {
%2 = ptrtoint i32* %0 to i64
%3 = tail call i32 @internal_fiat_p256_divstep_precomp(i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_halt_cpu();
void __attribute__((sysv_abi)) hal_halt(void) { hal_halt_cpu(); }


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

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

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

LLVM IR (-O2):
define void @hal_halt() {
%1 = tail call i32 (...) @hal_halt_cpu()
ret void
}
/* Variables and functions */
unsigned long HSL2RGB97(unsigned long);
unsigned long hsl2rgb(unsigned long hsn) { return HSL2RGB97(hsn); }


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

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

LLVM IR (-O0):
define i64 @hsl2rgb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @HSL2RGB97(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @hsl2rgb(i64 %0) {
%2 = tail call i64 @HSL2RGB97(i64 %0)
ret i64 %2
}
/* Variables and functions */
void *malloc(size_t);
void *new_array(size_t length, size_t struct_size, size_t type_size) {
  void *array;
  array = malloc(struct_size + type_size * (length - 1));
  if (!array) {
    return 0;
  }
  *(size_t *)array = length;
  return array;
}


x86 assembly (clang, -O0):
<new_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
imul   %rcx,%rax
add    %rax,%rdi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115c <new_array+0x4c>
movq   $0x0,-0x8(%rbp)
jmp    116f <new_array+0x5f>
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_array>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rdi
imul   %rdx,%rdi
add    %rsi,%rdi
call   1030 <malloc@plt>
test   %rax,%rax
je     112c <new_array+0x1c>
mov    %rbx,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define i8* @new_array(i64 %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%9 = load i64, i64* %6
%10 = load i64, i64* %7
%11 = load i64, i64* %5
%12 = sub i64 %11, 1
%13 = mul i64 %10, %12
%14 = add i64 %9, %13
%15 = call i8* @malloc(i64 %14)
store i8* %15, i8** %8
%16 = load i8*, i8** %8
%17 = icmp ne i8* %16, null
br i1 %17, label %19, label %18
18: ; preds = %3
store i8* null, i8** %4
br label %24
19: ; preds = %3
%20 = load i64, i64* %5
%21 = load i8*, i8** %8
%22 = bitcast i8* %21 to i64*
store i64 %20, i64* %22
%23 = load i8*, i8** %8
store i8* %23, i8** %4
br label %24
24: ; preds = %19, %18
%25 = load i8*, i8** %4
ret i8* %25
}

LLVM IR (-O2):
define noalias i8* @new_array(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %0, -1
%5 = mul i64 %4, %2
%6 = add i64 %5, %1
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = bitcast i8* %7 to i64*
store i64 %0, i64* %10
br label %11
11: ; preds = %3, %9
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
main() { write(1, "\nHello\n", 7); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
mov    $0x7,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x7,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\0AHello\0A\00"
define i32 @main() {
%1 = call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\0AHello\0A\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 7)
ret i32 0
}
/* Type definitions */
struct audio_ring_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct audio_ring_buffer *);
void audio_ring_buffer_free(struct audio_ring_buffer *ring) { free(ring); }


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

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

LLVM IR (-O0):
%struct.audio_ring_buffer = type { i32 }
define void @audio_ring_buffer_free(%struct.audio_ring_buffer* %0) {
%2 = alloca %struct.audio_ring_buffer*
store %struct.audio_ring_buffer* %0, %struct.audio_ring_buffer** %2
%3 = load %struct.audio_ring_buffer*, %struct.audio_ring_buffer** %2
%4 = call i32 @free(%struct.audio_ring_buffer* %3)
ret void
}

LLVM IR (-O2):
%struct.audio_ring_buffer = type { i32 }
define void @audio_ring_buffer_free(%struct.audio_ring_buffer* nocapture %0) {
%2 = tail call i32 @free(%struct.audio_ring_buffer* %0)
ret void
}
void update(int nx, int ny, double *u1, double *u2) { int ix, iy; }


x86 assembly (clang, -O0):
<update>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @update(i32 %0, i32 %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store double* %2, double** %7
store double* %3, double** %8
ret void
}

LLVM IR (-O2):
define void @update(i32 %0, i32 %1, double* nocapture %2, double* nocapture %3) {
ret void
}
int copyLSB(int x) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @copyLSB(i32 %0) {
ret i32 2
}
int ft_fibonacci(int index) {
  if (index < 0)
    return (-1);
  else if (index == 0)
    return (0);
  else if (index == 1)
    return (1);
  else
    return (ft_fibonacci(index - 1) + ft_fibonacci(index - 2));
}


x86 assembly (clang, -O0):
<ft_fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1131 <ft_fibonacci+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x0,-0x8(%rbp)
jne    1147 <ft_fibonacci+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
cmpl   $0x1,-0x8(%rbp)
jne    115d <ft_fibonacci+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ft_fibonacci+0x70>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
call   1030 <ft_fibonacci@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_fibonacci>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
js     1136 <ft_fibonacci+0x26>
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%ebx
jb     1132 <ft_fibonacci+0x22>
lea    -0x1(%rbx),%edi
call   1030 <ft_fibonacci@plt>
add    %eax,%ebp
add    $0xfffffffe,%ebx
cmp    $0x2,%ebx
jae    1120 <ft_fibonacci+0x10>
add    %ebp,%ebx
jmp    113b <ft_fibonacci+0x2b>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ft_fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %10, %7 ], [ %0, %1 ]
%5 = phi i32 [ %11, %7 ], [ 0, %1 ]
%6 = icmp ult i32 %4, 2
br i1 %6, label %12, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = tail call i32 @ft_fibonacci(i32 %8)
%10 = add nsw i32 %4, -2
%11 = add nsw i32 %9, %5
br label %3
12: ; preds = %3
%13 = add nsw i32 %4, %5
br label %14
14: ; preds = %12, %1
%15 = phi i32 [ %13, %12 ], [ -1, %1 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
void stub1();
void main() {
  char buf[129];
  read(0, buf, 129);
  ((void (*)())buf)();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x90(%rbp),%rsi
xor    %edi,%edi
mov    $0x81,%edx
call   1030 <read@plt>
lea    -0x90(%rbp),%rcx
mov    $0x0,%al
call   *%rcx
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
mov    %rsp,%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x81,%edx
call   1030 <read@plt>
xor    %eax,%eax
call   *%rbx
add    $0x90,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @main() {
%1 = alloca [129 x i8]
%2 = getelementptr inbounds [129 x i8], [129 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 129)
%4 = getelementptr inbounds [129 x i8], [129 x i8]* %1, i64 0, i64 0
%5 = bitcast i8* %4 to void (...)*
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = alloca [129 x i8]
%2 = getelementptr inbounds [129 x i8], [129 x i8]* %1, i64 0, i64 0
%3 = call i32 @read(i32 0, i8* %2, i32 129)
%4 = bitcast [129 x i8]* %1 to void (...)*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void delete_all() {
  printf("All Accounts, Account details deleted successfully\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"All Accounts, Account details deleted successfully\0A\00"
define void @delete_all() {
%1 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [51 x i8] c"All Accounts, Account details deleted successfully\00"
define void @delete_all() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/
AsyncPowerManagerP__0__ResourceDefaultOwner__immediateRequested();
void ArbiterP__1__ResourceDefaultOwner__immediateRequested(void) {
  AsyncPowerManagerP__0__ResourceDefaultOwner__immediateRequested();
}


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

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

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

LLVM IR (-O2):
define void @ArbiterP__1__ResourceDefaultOwner__immediateRequested() {
%1 = tail call i32 (...) @AsyncPowerManagerP__0__ResourceDefaultOwner__immediateRequested()
ret void
}
void RTStrCmp(void) {}


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

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

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

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

/* Variables and functions */
int cvt_31x6p5_bin32(int *, int /*<<< orphan*/);
void cvt_31x13_bin64(uint8_t *gfv, uint32_t bv0, uint32_t bv1) {
  uint8_t gfv0, gfv1;
  gfv0 = cvt_31x6p5_bin32(gfv, bv0);
  gfv1 = cvt_31x6p5_bin32(&gfv[6], bv1);
  gfv[12] = gfv0 + gfv1 * 5;
}


x86 assembly (clang, -O0):
<cvt_31x13_bin64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <cvt_31x6p5_bin32@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x18,%rdi
mov    -0x10(%rbp),%esi
call   1030 <cvt_31x6p5_bin32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%ecx
imul   $0x5,-0x18(%rbp),%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x30(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_31x13_bin64>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
call   1030 <cvt_31x6p5_bin32@plt>
mov    %eax,%ebp
lea    0x18(%rbx),%rdi
mov    %r14d,%esi
call   1030 <cvt_31x6p5_bin32@plt>
lea    (%rax,%rax,4),%eax
add    %ebp,%eax
mov    %eax,0x30(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @cvt_31x13_bin64(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32*, i32** %4
%10 = load i32, i32* %5
%11 = call i32 @cvt_31x6p5_bin32(i32* %9, i32 %10)
store i32 %11, i32* %7
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 6
%14 = load i32, i32* %6
%15 = call i32 @cvt_31x6p5_bin32(i32* %13, i32 %14)
store i32 %15, i32* %8
%16 = load i32, i32* %7
%17 = load i32, i32* %8
%18 = mul nsw i32 %17, 5
%19 = add nsw i32 %16, %18
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 12
store i32 %19, i32* %21
ret void
}

LLVM IR (-O2):
define void @cvt_31x13_bin64(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @cvt_31x6p5_bin32(i32* %0, i32 %1)
%5 = getelementptr inbounds i32, i32* %0, i64 6
%6 = tail call i32 @cvt_31x6p5_bin32(i32* %5, i32 %2)
%7 = mul nsw i32 %6, 5
%8 = add nsw i32 %7, %4
%9 = getelementptr inbounds i32, i32* %0, i64 12
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
int count_leading_whitespace(char *);
int /*<<< orphan*/ memmove(char *, char *, int);
int strlen(char *);
char *str_ltrim(char *str) {
  int len;
  int num_chars = count_leading_whitespace(str);
  if (num_chars > 0) {
    len = strlen(str) - num_chars;
    memmove(str, str + num_chars, len);
    str[len] = '\0';
  }
  return str;
}


x86 assembly (clang, -O0):
<str_ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <count_leading_whitespace@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    1184 <str_ltrim+0x54>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
sub    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x10(%rbp),%rax
add    %rax,%rsi
mov    -0xc(%rbp),%edx
call   1050 <memmove@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_ltrim>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
call   1040 <count_leading_whitespace@plt>
test   %eax,%eax
jle    1167 <str_ltrim+0x37>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%r14d
sub    %ebp,%r14d
mov    %ebp,%esi
add    %rbx,%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1050 <memmove@plt>
movslq %r14d,%rax
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @str_ltrim(i8* returned %0) {
%2 = tail call i32 @count_leading_whitespace(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %12
4: ; preds = %1
%5 = tail call i32 @strlen(i8* %0)
%6 = sub nsw i32 %5, %2
%7 = zext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = tail call i32 @memmove(i8* %0, i8* %8, i32 %6)
%10 = sext i32 %6 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 0, i8* %11
br label %12
12: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int /*<<< orphan*/ printf(char *, long);
int main() {
  long nc;
  nc = 0;
  while (getchar() != EOF) {
    ++nc;
  }
  printf("%ld\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
je     115f <main+0x3f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <main+0x17>
mov    -0x10(%rbp),%rsi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xffffffffffffffff,%rbx
mov    0x2eb6(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    (%r14),%rax
jne    1140 <main+0x20>
lea    0xea9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@EOF = global i64 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i64 [ 0, %0 ], [ %6, %1 ]
%3 = tail call i64 (...) @getchar()
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
%6 = add nuw nsw i64 %2, 1
br i1 %5, label %7, label %1
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i32 0
}
unsigned char encode64Char2(char ci1, char ci2) {
  unsigned char c2 = ci1 & 3;
  c2 = c2 << 4;
  unsigned char tmp2 = ci2 >> 4;
  tmp2 = tmp2 & 15;
  c2 = c2 | tmp2;
  c2 = c2 & 63;
  return c2;
}


x86 assembly (clang, -O0):
<encode64Char2>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x3,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x4,%eax
mov    %al,-0x3(%rbp)
movsbl -0x2(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x4(%rbp)
movzbl -0x4(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
movzbl -0x4(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
and    $0x3f,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode64Char2>:
shr    $0x4,%sil
shl    $0x4,%dil
lea    (%rdi,%rsi,1),%eax
and    $0x3f,%al
ret

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

LLVM IR (-O2):
define zeroext i8 @encode64Char2(i8 signext %0, i8 signext %1) {
%3 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %1, i8 4)
%4 = and i8 %3, 63
ret i8 %4
}
void ucase(char *cp) {
  {
    while (*cp) {
      if ((int)*cp >= 97) {
        if ((int)*cp <= 122) {
          *cp = (char)((int)*cp - 32);
        } else {
          *cp = *cp;
        }
      } else {
        *cp = *cp;
      }
      cp++;
    }
    return;
  }
}


x86 assembly (clang, -O0):
<ucase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     117a <ucase+0x7a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     115d <ucase+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <ucase+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x20,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1158 <ucase+0x58>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    1169 <ucase+0x69>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <ucase+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucase>:
mov    (%rdi),%al
test   %al,%al
je     112a <ucase+0x2a>
add    $0x1,%rdi
jmp    111b <ucase+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <ucase+0x2a>
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <ucase+0x10>
add    $0xe0,%al
mov    %al,-0x1(%rdi)
jmp    1110 <ucase+0x10>
ret

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

LLVM IR (-O2):
define void @ucase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRCC_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMRCC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void so_fini2() {
  printf("so_fini2"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [9 x i8] c"so_fini2\00"
define void @so_fini2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ errmsg(int /*<<< orphan*/, char *, char);
int /*<<< orphan*/ *optarg;
int required_arg(char c, char *arg) {
  if ((optarg != NULL) && (*arg == '-')) {
    errmsg(0, "option %c requires an argument\n", c);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<required_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ecf(%rip),%rax
cmpq   $0x0,(%rax)
je     1161 <required_arg+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1161 <required_arg+0x51>
xor    %edi,%edi
lea    0xeb4(%rip),%rsi
movsbl -0x5(%rbp),%edx
call   1030 <errmsg@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <required_arg+0x58>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<required_arg>:
push   %rax
mov    0x2ee0(%rip),%rcx
xor    %eax,%eax
cmpq   $0x0,(%rcx)
je     113c <required_arg+0x2c>
cmpb   $0x2d,(%rsi)
jne    113c <required_arg+0x2c>
movsbl %dil,%edx
lea    0xed0(%rip),%rsi
xor    %edi,%edi
call   1030 <errmsg@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@optarg = global i32* null
@.str = [32 x i8] c"option %c requires an argument\0A\00"
define i32 @required_arg(i8 signext %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %4
store i8* %1, i8** %5
%6 = load i32*, i32** @optarg
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 45
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i8, i8* %4
%15 = call i32 @errmsg(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 signext %14)
store i32 -1, i32* %3
br label %17
16: ; preds = %8, %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@optarg = global i32* null
@.str = [32 x i8] c"option %c requires an argument\0A\00"
define i32 @required_arg(i8 signext %0, i8* nocapture %1) {
%3 = load i32*, i32** @optarg
%4 = icmp eq i32* %3, null
br i1 %4, label %10, label %5
5: ; preds = %2
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 45
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @errmsg(i32 0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8 signext %0)
br label %10
10: ; preds = %2, %5, %8
%11 = phi i32 [ -1, %8 ], [ 0, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ klogHexByte(unsigned char);
void klogHexWord(unsigned short wd) {
  klogHexByte((unsigned char)((wd & 0xFF00) >> 8));
  klogHexByte((unsigned char)(wd & 0xFF));
}


x86 assembly (clang, -O0):
<klogHexWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movzbl %al,%edi
call   1030 <klogHexByte@plt>
movzwl -0x2(%rbp),%eax
and    $0xff,%eax
movzbl %al,%edi
call   1030 <klogHexByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<klogHexWord>:
push   %rbx
mov    %edi,%ebx
shr    $0x8,%edi
call   1030 <klogHexByte@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <klogHexByte@plt>

LLVM IR (-O0):
define void @klogHexWord(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 65280
%6 = ashr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = call i32 @klogHexByte(i8 zeroext %7)
%9 = load i16, i16* %2
%10 = zext i16 %9 to i32
%11 = and i32 %10, 255
%12 = trunc i32 %11 to i8
%13 = call i32 @klogHexByte(i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @klogHexWord(i16 zeroext %0) {
%2 = lshr i16 %0, 8
%3 = trunc i16 %2 to i8
%4 = tail call i32 @klogHexByte(i8 zeroext %3)
%5 = trunc i16 %0 to i8
%6 = tail call i32 @klogHexByte(i8 zeroext %5)
ret void
}
/* Variables and functions */
float FLT_MIN;
float log(float);
float db(float real, float imag) {
  float square = real * real + imag * imag;
  if (square == 0.0f) {
    square = FLT_MIN * 10.0f;
  }
  float ret = 10.0f * log(square) / log(10.0f);
  return ret;
}


x86 assembly (clang, -O0):
<db>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0x8(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1172 <db+0x62>
jp     1172 <db+0x62>
movss  0xe9e(%rip),%xmm0
mov    0x2e7f(%rip),%rax
mulss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movss  0xe79(%rip),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe68(%rip),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db>:
push   %rax
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
mov    0x2ec4(%rip),%rax
movss  (%rax),%xmm2
mulss  0xed0(%rip),%xmm2
xorps  %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
call   1030 <log@plt>
mulss  0xeaf(%rip),%xmm0
divss  0xeab(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@FLT_MIN = global float 0.000000e+00
define float @db(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %3
store float %1, float* %4
%7 = load float, float* %3
%8 = load float, float* %3
%9 = load float, float* %4
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = call float @llvm.fmuladd.f32(float %7, float %8, float %11)
store float %12, float* %5
%13 = load float, float* %5
%14 = fcmp oeq float %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %2
%16 = load float, float* @FLT_MIN
%17 = fmul float %16, 1.000000e+01
store float %17, float* %5
br label %18
18: ; preds = %15, %2
%19 = load float, float* %5
%20 = call float @log(float %19)
%21 = fmul float 1.000000e+01, %20
%22 = call float @log(float 1.000000e+01)
%23 = fdiv float %21, %22
store float %23, float* %6
%24 = load float, float* %6
ret float %24
}

LLVM IR (-O2):
@FLT_MIN = global float 0.000000e+00
define float @db(float %0, float %1) {
%3 = fmul float %1, %1
%4 = tail call float @llvm.fmuladd.f32(float %0, float %0, float %3)
%5 = fcmp oeq float %4, 0.000000e+00
%6 = load float, float* @FLT_MIN
%7 = fmul float %6, 1.000000e+01
%8 = select i1 %5, float %7, float %4
%9 = tail call float @log(float %8)
%10 = fmul float %9, 1.000000e+01
%11 = fdiv float %10, 0x40026BB1C0000000
ret float %11
}
int mammoth_leaf(int arg) {
  int array[65536];
  array[arg] = 4;
  return array[arg];
}


x86 assembly (clang, -O0):
<mammoth_leaf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3ff90,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
movl   $0x4,-0x40010(%rbp,%rax,4)
movslq -0x4(%rbp),%rax
mov    -0x40010(%rbp,%rax,4),%eax
add    $0x3ff90,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mammoth_leaf(i32 %0) {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xa1() {
  Assert_real((isxdigit(161) == 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_isxdigit.c",
              810, ("isxdigit should be 0 for 0xa1"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xa1>:
push   %rax
mov    $0xa1,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x32a,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa1\00"
define void @t_isxdigit_0xa1() {
%1 = call i64 @isxdigit(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xa1\00"
define void @t_isxdigit_0xa1() {
%1 = tail call i64 @isxdigit(i32 161)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 810, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int any(char *, char);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s1[100] = "CDEFG";
  char s2 = 'F';
  printf("%d\n", any(s1, s2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x43,-0x70(%rbp)
movb   $0x44,-0x6f(%rbp)
movb   $0x45,-0x6e(%rbp)
movb   $0x46,-0x6d(%rbp)
movb   $0x47,-0x6c(%rbp)
movb   $0x46,-0x71(%rbp)
lea    -0x70(%rbp),%rdi
movsbl -0x71(%rbp),%esi
call   1050 <any@plt>
mov    %eax,%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x46454443,(%rsp)
movb   $0x47,0x4(%rsp)
mov    %rsp,%rdi
mov    $0x46,%esi
call   1040 <any@plt>
lea    0xe94(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i8
%3 = bitcast [100 x i8]* %1 to i8*
%4 = bitcast i8* %3 to [100 x i8]*
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i32 0, i32 0
store i8 67, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i32 0, i32 1
store i8 68, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i32 0, i32 2
store i8 69, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i32 0, i32 3
store i8 70, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i32 0, i32 4
store i8 71, i8* %9
store i8 70, i8* %2
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = load i8, i8* %2
%12 = call i32 @any(i8* %10, i8 signext %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 67, i8* %2
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 68, i8* %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 69, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 70, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 4
store i8 71, i8* %6
%7 = call i32 @any(i8* %2, i8 signext 70)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}