xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stderr;
void continue_input_error(int line_num) {
  fprintf(stderr, "Wrong input format at line %d\n", line_num);
}


x86 assembly (clang, -O0):
<continue_input_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<continue_input_error>:
mov    %edi,%edx
mov    0x2ec7(%rip),%rax
mov    (%rax),%edi
lea    0xede(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"Wrong input format at line %d\0A\00"
define void @continue_input_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"Wrong input format at line %d\0A\00"
define void @continue_input_error(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_strs(char **strs, int n) {
#pragma omp parallel for
  for (int i = 0; i < n; i++)
    free(strs[i]);
}


x86 assembly (clang, -O0):
<free_strs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <free_strs+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <free_strs+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_strs>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <free_strs+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <free_strs+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @free_strs(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %12, %7 ]
%9 = getelementptr inbounds i8*, i8** %0, i64 %8
%10 = load i8*, i8** %9
%11 = tail call i32 @free(i8* %10)
%12 = add nuw nsw i64 %8, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(size_t const);
int /*<<< orphan*/ printf(char *, size_t const);
void *my_aligned_malloc(size_t const nbytes) {
  void *ptr;
  ptr = malloc(nbytes);
  if (!ptr) {
    printf("Error: Could not allocate %zu bytes of aligned memory.\n", nbytes);
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<my_aligned_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116e <my_aligned_malloc+0x3e>
mov    -0x8(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_aligned_malloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <my_aligned_malloc+0x10>
pop    %rbx
ret
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [56 x i8] c"Error: Could not allocate %zu bytes of aligned memory.\0A\00"
define i8* @my_aligned_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = call i32 @exit(i32 -1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [56 x i8] c"Error: Could not allocate %zu bytes of aligned memory.\0A\00"
define noalias i8* @my_aligned_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i64 %0)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int SuperFastHash(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ strlen(char *);
int main(int argc, char **argv) {
  printf("%d\n", SuperFastHash(argv[1], strlen(argv[1])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <SuperFastHash@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x8(%rsi),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <SuperFastHash@plt>
lea    0xeb2(%rip),%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(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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strlen(i8* %11)
%13 = call i32 @SuperFastHash(i8* %8, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @strlen(i8* %4)
%6 = tail call i32 @SuperFastHash(i8* %4, i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ process_input(char const *);
void process_files(const char **file_list, int file_count) {
  int i;
  for (i = 0; i < file_count; i++) {
    process_input(file_list[i]);
  }
}


x86 assembly (clang, -O0):
<process_files>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <process_files+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <process_input@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <process_files+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_files>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <process_files+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <process_input@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <process_files+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @process_files(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @process_input(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint8_t;

/* Variables and functions */
void reg8_set_bits(volatile uint8_t *reg, uint8_t value) { *reg |= value; }


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

x86 assembly (clang, -O2):
<reg8_set_bits>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
or     %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @reg8_set_bits(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = or i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
char *inet_ntop(int, void const *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
const char *std_inet_ntop(int af, const void *src, char *dst, socklen_t cnt) {
  const char *ret;
  if ((ret = inet_ntop(af, src, dst, cnt)) == NULL) {
    perror("inet_ntop");
    exit(1);
  }
  return ret;
}


x86 assembly (clang, -O0):
<std_inet_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <inet_ntop@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    117d <std_inet_ntop+0x4d>
lea    0xe92(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_inet_ntop>:
push   %rax
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     113d <std_inet_ntop+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"inet_ntop\00"
define i8* @std_inet_ntop(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i32 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_242() {
  Assert_real((isqrt(242) == 15),
              "/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/stdlib/isqrt.c",
              1215, ("Integer square root of 242 should be 15"));
}


x86 assembly (clang, -O0):
<t_sqrt_242>:
push   %rbp
mov    %rsp,%rbp
mov    $0xf2,%edi
call   1030 <isqrt@plt>
cmp    $0xf,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x4bf,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_242>:
push   %rax
mov    $0xf2,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xf,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x4bf,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 242 should be 15\00"
define void @t_sqrt_242() {
%1 = call i32 @isqrt(i32 242)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 242 should be 15\00"
define void @t_sqrt_242() {
%1 = tail call i32 @isqrt(i32 242)
%2 = icmp eq i32 %1, 15
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 1215, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ff_hevc_put_hevc_epel_hv24_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv24_10_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ concat(char *, char *);
int /*<<< orphan*/ toLog(int /*<<< orphan*/);
void archive(char *filename) {
  toLog(concat("Attempting to archive: ", filename));
}


x86 assembly (clang, -O0):
<archive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <concat@plt>
mov    %eax,%edi
call   1030 <toLog@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<archive>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1040 <concat@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <toLog@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Attempting to archive: \00"
define void @archive(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @concat(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @toLog(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Attempting to archive: \00"
define void @archive(i8* %0) {
%2 = tail call i32 @concat(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @toLog(i32 %2)
ret void
}
float get_scrollbar_x1(const struct Tracker_Windows *window) { return 0.0; }


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

x86 assembly (clang, -O2):
<get_scrollbar_x1>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
%struct.Tracker_Windows = type opaque
define float @get_scrollbar_x1(%struct.Tracker_Windows* %0) {
%2 = alloca %struct.Tracker_Windows*
store %struct.Tracker_Windows* %0, %struct.Tracker_Windows** %2
ret float 0.000000e+00
}

LLVM IR (-O2):
%struct.Tracker_Windows = type opaque
define float @get_scrollbar_x1(%struct.Tracker_Windows* nocapture readnone %0) {
ret float 0.000000e+00
}
int main(void) {
  int a;
  char *ptr = (char *)0;
  a = *ptr;
  return "ABC";
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x8(%rbp)
lea    0xedc(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"ABC\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i8* null, i8** %3
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
store i32 %6, i32* %2
ret i32 ptrtoint ([4 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [4 x i8] c"ABC\00"
define i32 @main() {
ret i32 ptrtoint ([4 x i8]* @.str to i32)
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ fd_test_lock(int, int /*<<< orphan*/);
pid_t fd_is_write_lock_blocked(int fd) { return (fd_test_lock(fd, F_WRLCK)); }


x86 assembly (clang, -O0):
<fd_is_write_lock_blocked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
call   1030 <fd_test_lock@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_is_write_lock_blocked>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fd_test_lock@plt>

LLVM IR (-O0):
@F_WRLCK = global i32 0
define i32 @fd_is_write_lock_blocked(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = call i32 @fd_test_lock(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
@F_WRLCK = global i32 0
define i32 @fd_is_write_lock_blocked(i32 %0) {
%2 = load i32, i32* @F_WRLCK
%3 = tail call i32 @fd_test_lock(i32 %0, i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ delay_ms(int);
void delay_s(int i) {
  for (; i > 0; i--) {
    delay_ms(1000);
  }
  return;
}


x86 assembly (clang, -O0):
<delay_s>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113d <delay_s+0x2d>
mov    $0x3e8,%edi
call   1030 <delay_ms@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <delay_s+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay_s>:
push   %rbx
test   %edi,%edi
jle    1132 <delay_s+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <delay_ms@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <delay_s+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @delay_s(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %8, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 @delay_ms(i32 1000)
br label %8
8: ; preds = %6
%9 = load i32, i32* %2
%10 = add nsw i32 %9, -1
store i32 %10, i32* %2
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay_s(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @delay_ms(i32 1000)
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
char *strchrnul(char const *, int);
char *strchr(const char *s, int c) {
  char *r = strchrnul(s, c);
  return *(unsigned char *)r == (unsigned char)c ? r : 0;
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <strchrnul@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    1151 <strchr+0x41>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    115c <strchr+0x4c>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115c <strchr+0x4c>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
push   %rbx
mov    %esi,%ebx
call   1030 <strchrnul@plt>
xor    %ecx,%ecx
cmp    %bl,(%rax)
cmovne %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strchr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @strchrnul(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i32, i32* %4
%13 = trunc i32 %12 to i8
%14 = zext i8 %13 to i32
%15 = icmp eq i32 %11, %14
br i1 %15, label %16, label %18
16: ; preds = %2
%17 = load i8*, i8** %5
br label %19
18: ; preds = %2
br label %19
19: ; preds = %18, %16
%20 = phi i8* [ %17, %16 ], [ null, %18 ]
ret i8* %20
}

LLVM IR (-O2):
define i8* @strchr(i8* %0, i32 %1) {
%3 = tail call i8* @strchrnul(i8* %0, i32 %1)
%4 = load i8, i8* %3
%5 = trunc i32 %1 to i8
%6 = icmp eq i8 %4, %5
%7 = select i1 %6, i8* %3, i8* null
ret i8* %7
}
void apic_write(unsigned long reg, unsigned long v) {
  *((volatile unsigned long *)(0xfee00000 + reg)) = v;
}


x86 assembly (clang, -O0):
<apic_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
movabs $0xfee00000,%rax
add    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<apic_write>:
mov    $0xfee00000,%eax
mov    %rsi,(%rdi,%rax,1)
ret

LLVM IR (-O0):
define void @apic_write(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 4276092928, %6
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @apic_write(i64 %0, i64 %1) {
%3 = add i64 %0, 4276092928
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
int ptr_valid(void const *, size_t, size_t, int);
bool ptr_valid_r(const void *p, size_t align, size_t size) {
  return ptr_valid(p, align, size, false);
}


x86 assembly (clang, -O0):
<ptr_valid_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <ptr_valid@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptr_valid_r>:
xor    %ecx,%ecx
jmp    1030 <ptr_valid@plt>

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

LLVM IR (-O2):
define i32 @ptr_valid_r(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @ptr_valid(i8* %0, i64 %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ C_LOG2(double);
int main() {
  C_LOG2(1.0);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xee7(%rip),%xmm0
call   1030 <C_LOG2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @C_LOG2(double 1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @C_LOG2(double 1.000000e+00)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int ut_strcmp(char const *a, char const *b) {
  if (a == NULL && b == NULL) {
    return (0);
  }
  if (b == NULL) {
    return (1);
  }
  if (a == NULL) {
    return (-1);
  }
  return (strcmp(a, b));
}


x86 assembly (clang, -O0):
<ut_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1142 <ut_strcmp+0x32>
cmpq   $0x0,-0x18(%rbp)
jne    1142 <ut_strcmp+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1180 <ut_strcmp+0x70>
cmpq   $0x0,-0x18(%rbp)
jne    1159 <ut_strcmp+0x49>
movl   $0x1,-0x4(%rbp)
jmp    1180 <ut_strcmp+0x70>
cmpq   $0x0,-0x10(%rbp)
jne    1170 <ut_strcmp+0x60>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <ut_strcmp+0x70>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ut_strcmp>:
xor    %ecx,%ecx
mov    %rdi,%rax
or     %rsi,%rax
setne  %dl
mov    %rsi,%rax
neg    %rax
sbb    %eax,%eax
test   %rdi,%rdi
je     1132 <ut_strcmp+0x22>
test   %rsi,%rsi
je     1132 <ut_strcmp+0x22>
jmp    1030 <strcmp@plt>
mov    %dl,%cl
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @ut_strcmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = and i1 %3, %4
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = or i1 %3, %4
%9 = select i1 %4, i32 %7, i32 -1
br i1 %8, label %12, label %10
10: ; preds = %2
%11 = tail call i32 @strcmp(i8* %0, i8* %1)
br label %12
12: ; preds = %2, %10
%13 = phi i32 [ %11, %10 ], [ %9, %2 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ func1();
int /*<<< orphan*/ mmapdata();
int main() {
  mmapdata();
  func1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <mmapdata@plt>
mov    $0x0,%al
call   1030 <func1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @mmapdata()
%2 = tail call i32 (...) @func1()
ret i32 0
}
long giAtomicDecrement(volatile long *p) { return __sync_sub_and_fetch(p, 1L); }


x86 assembly (clang, -O0):
<giAtomicDecrement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0xffffffffffffffff,%rax
lock xadd %rax,(%rcx)
sub    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<giAtomicDecrement>:
mov    $0xffffffffffffffff,%rax
lock xadd %rax,(%rdi)
add    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @giAtomicDecrement(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = atomicrmw sub i64* %3, i64 1 seq_cst
%5 = sub i64 %4, 1
ret i64 %5
}

LLVM IR (-O2):
define i64 @giAtomicDecrement(i64* nocapture %0) {
%2 = atomicrmw sub i64* %0, i64 1 seq_cst
%3 = add i64 %2, -1
ret i64 %3
}
int rtems_init_network(void) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @rtems_init_network() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x0f() {
  Assert_real((isupper(15) == 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_isupper.c",
              80, ("isupper should be 0 for 0x0f"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0x0f>:
push   %rax
mov    $0xf,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x50,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x0f\00"
define void @t_isupper_0x0f() {
%1 = call i64 @isupper(i32 15)
%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 80, 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x0f\00"
define void @t_isupper_0x0f() {
%1 = tail call i64 @isupper(i32 15)
%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 80, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Wl();
int /*<<< orphan*/ Ws(char const *);
void Wsl(const char *s) {
  Ws(s);
  Wl();
}


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

x86 assembly (clang, -O2):
<Wsl>:
push   %rax
call   1030 <Ws@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <Wl@plt>

LLVM IR (-O0):
define void @Wsl(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Ws(i8* %3)
%5 = call i32 (...) @Wl()
ret void
}

LLVM IR (-O2):
define void @Wsl(i8* %0) {
%2 = tail call i32 @Ws(i8* %0)
%3 = tail call i32 (...) @Wl()
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t cblByteOrderSwap16(uint16_t swap) {
  return ((swap << 8) & (uint16_t)0xFF00) | ((swap >> 8) & (uint16_t)0xFF);
}


x86 assembly (clang, -O0):
<cblByteOrderSwap16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
and    $0xff00,%eax
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cblByteOrderSwap16>:
rol    $0x8,%di
movzwl %di,%eax
ret

LLVM IR (-O0):
define i32 @cblByteOrderSwap16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = and i32 %4, 65280
%6 = load i32, i32* %2
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = or i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @cblByteOrderSwap16(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = tail call i16 @llvm.bswap.i16(i16 %2)
%4 = zext i16 %3 to i32
ret i32 %4
}
/* Variables and functions */
int comp_uni(char const *, char const *, int /*<<< orphan*/, int);
int comp_name(const char *a, const char *b) { return comp_uni(a, b, 0, 100); }


x86 assembly (clang, -O0):
<comp_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x64,%ecx
call   1030 <comp_uni@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_name>:
xor    %edx,%edx
mov    $0x64,%ecx
jmp    1030 <comp_uni@plt>

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

LLVM IR (-O2):
define i32 @comp_name(i8* %0, i8* %1) {
%3 = tail call i32 @comp_uni(i8* %0, i8* %1, i32 0, i32 100)
ret i32 %3
}
int iterate(int bound) {
  int i;
  int sum = 0;
  for (i = 0; i < bound; i++) {
    sum += i;
  }
  return sum;
}


x86 assembly (clang, -O0):
<iterate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <iterate+0x38>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <iterate+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterate>:
test   %edi,%edi
jle    1118 <iterate+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,1),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iterate(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %13
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = zext i32 %4 to i33
%6 = add nsw i32 %0, -2
%7 = zext i32 %6 to i33
%8 = mul i33 %5, %7
%9 = lshr i33 %8, 1
%10 = trunc i33 %9 to i32
%11 = add i32 %10, %0
%12 = add i32 %11, -1
br label %13
13: ; preds = %3, %1
%14 = phi i32 [ 0, %1 ], [ %12, %3 ]
ret i32 %14
}
int byteXor(int x, int y, int n) {
  int mask = 0xff << (n << 3);
  return !!((x & mask) ^ (y & mask));
}


x86 assembly (clang, -O0):
<byteXor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
mov    $0xff,%eax
shl    %cl,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<byteXor>:
lea    0x0(,%rdx,8),%ecx
xor    %esi,%edi
shr    %cl,%edi
xor    %eax,%eax
test   %dil,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @byteXor(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = shl i32 %8, 3
%10 = shl i32 255, %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load i32, i32* %7
%13 = and i32 %11, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = and i32 %14, %15
%17 = xor i32 %13, %16
%18 = icmp ne i32 %17, 0
%19 = xor i1 %18, true
%20 = xor i1 %19, true
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @byteXor(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %2, 3
%5 = shl i32 255, %4
%6 = xor i32 %1, %0
%7 = and i32 %5, %6
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ isspace(char const);
bool is_empty(const char *s) {
  while (*s) {
    if (!isspace(*s)) {
      return false;
    }
    ++s;
  }
  return true;
}


x86 assembly (clang, -O0):
<is_empty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     115b <is_empty+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    114a <is_empty+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_empty+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_empty+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_empty>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
mov    $0x1,%ebp
test   %al,%al
je     114b <is_empty+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
movsbl %al,%edi
call   1030 <isspace@plt>
test   %eax,%eax
je     1149 <is_empty+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <is_empty+0x20>
jmp    114b <is_empty+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @is_empty(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = tail call i32 @isspace(i8 signext %8)
%11 = icmp eq i32 %10, 0
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
char *icl_zlib_name(void) { return "zlib"; }


x86 assembly (clang, -O0):
<icl_zlib_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"zlib\00"
define i8* @icl_zlib_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [5 x i8] c"zlib\00"
define i8* @icl_zlib_name() {
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct genlist {
  int dummy;
};
struct clause_list {
  int dummy;
};
struct Clause {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_append(struct genlist *, struct Clause *);
void clause_list_append(struct clause_list *tthis, struct Clause *pfoo) {
  genlist_append((struct genlist *)tthis, pfoo);
}


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

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

LLVM IR (-O0):
%struct.clause_list = type { i32 }
%struct.Clause = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_append(%struct.clause_list* %0, %struct.Clause* %1) {
%3 = alloca %struct.clause_list*
%4 = alloca %struct.Clause*
store %struct.clause_list* %0, %struct.clause_list** %3
store %struct.Clause* %1, %struct.Clause** %4
%5 = load %struct.clause_list*, %struct.clause_list** %3
%6 = bitcast %struct.clause_list* %5 to %struct.genlist*
%7 = load %struct.Clause*, %struct.Clause** %4
%8 = call i32 @genlist_append(%struct.genlist* %6, %struct.Clause* %7)
ret void
}

LLVM IR (-O2):
%struct.clause_list = type { i32 }
%struct.Clause = type { i32 }
%struct.genlist = type { i32 }
define void @clause_list_append(%struct.clause_list* %0, %struct.Clause* %1) {
%3 = bitcast %struct.clause_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_append(%struct.genlist* %3, %struct.Clause* %1)
ret void
}
/* Variables and functions */
int serial_send_byte(int, unsigned char);
int putc(unsigned char c) {
  if (c == '\n')
    serial_send_byte(1, '\r');
  return serial_send_byte(1, c);
}


x86 assembly (clang, -O0):
<putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jne    113a <putc+0x2a>
mov    $0x1,%edi
mov    $0xd,%esi
call   1030 <serial_send_byte@plt>
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <serial_send_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc>:
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%bl
jne    1127 <putc+0x17>
mov    $0x1,%edi
mov    $0xd,%esi
call   1030 <serial_send_byte@plt>
movzbl %bl,%esi
mov    $0x1,%edi
pop    %rbx
jmp    1030 <serial_send_byte@plt>

LLVM IR (-O0):
define i32 @putc(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 10
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @serial_send_byte(i32 1, i8 zeroext 13)
br label %8
8: ; preds = %6, %1
%9 = load i8, i8* %2
%10 = call i32 @serial_send_byte(i32 1, i8 zeroext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @putc(i8 zeroext %0) {
%2 = icmp eq i8 %0, 10
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @serial_send_byte(i32 1, i8 zeroext 13)
br label %5
5: ; preds = %3, %1
%6 = tail call i32 @serial_send_byte(i32 1, i8 zeroext %0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ set_servo_targetB(unsigned char, unsigned int);
void set_servo_target_b(unsigned char servoNum, unsigned int pos_us) {
  set_servo_targetB(servoNum, pos_us);
}


x86 assembly (clang, -O0):
<set_servo_target_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
movzbl %al,%edi
call   1030 <set_servo_targetB@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @set_servo_target_b(i8 zeroext %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 @set_servo_targetB(i8 zeroext %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @set_servo_target_b(i8 zeroext %0, i32 %1) {
%3 = tail call i32 @set_servo_targetB(i8 zeroext %0, i32 %1)
ret void
}
char *file_base_name(char *path) {
  char *endptr = path;
  char *ptr = path;
  while (*ptr != '\0') {
    if ('/' == *ptr)
      endptr = ++ptr;
    else
      ++ptr;
  }
  return endptr;
}


x86 assembly (clang, -O0):
<file_base_name>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <file_base_name+0x62>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x2f,%eax
cmp    %ecx,%eax
jne    1151 <file_base_name+0x51>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
jmp    115d <file_base_name+0x5d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <file_base_name+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_base_name>:
mov    %rdi,%rax
lea    0x1(%rax),%rcx
nopw   0x0(%rax,%rax,1)
movzbl -0x1(%rcx),%edx
test   %dl,%dl
je     1135 <file_base_name+0x35>
cmp    $0x2f,%dl
je     1130 <file_base_name+0x30>
add    $0x1,%rcx
jmp    1110 <file_base_name+0x10>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,%rax
jmp    1103 <file_base_name+0x3>
ret

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

LLVM IR (-O2):
define i8* @file_base_name(i8* %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %8, %7 ], [ %0, %1 ]
br label %4
4: ; preds = %2, %9
%5 = phi i8* [ %10, %9 ], [ %3, %2 ]
%6 = load i8, i8* %5
switch i8 %6, label %9 [
i8 0, label %11
i8 47, label %7
]
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
br label %2
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
br label %4
11: ; preds = %4
ret i8* %3
}
void foo731(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo731(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Bar12(int, int, int, char, char, char, int, int, int, char,
                         char, float);
int main() {
  Bar12(6, -2, 4, 'z', 't', 'p', -7, 1, 3, 's', 'd', 'f');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x6,%edi
mov    $0xfffffffe,%esi
mov    $0x4,%edx
mov    $0x7a,%ecx
mov    $0x74,%r8d
mov    $0x70,%r9d
movss  0xeb9(%rip),%xmm0
movl   $0xfffffff9,(%rsp)
movl   $0x1,0x8(%rsp)
movl   $0x3,0x10(%rsp)
movl   $0x73,0x18(%rsp)
movl   $0x64,0x20(%rsp)
call   1030 <Bar12@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
sub    $0x8,%rsp
movss  0xee3(%rip),%xmm0
mov    $0x6,%edi
mov    $0xfffffffe,%esi
mov    $0x4,%edx
mov    $0x7a,%ecx
mov    $0x74,%r8d
mov    $0x70,%r9d
push   $0x64
push   $0x73
push   $0x3
push   $0x1
push   $0xfffffffffffffff9
call   1030 <Bar12@plt>
add    $0x30,%rsp
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @Bar12(i32 6, i32 -2, i32 4, i8 signext 122, i8 signext 116, i8 signext 112, i32 -7, i32 1, i32 3, i8 signext 115, i8 signext 100, float 1.020000e+02)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @Bar12(i32 6, i32 -2, i32 4, i8 signext 122, i8 signext 116, i8 signext 112, i32 -7, i32 1, i32 3, i8 signext 115, i8 signext 100, float 1.020000e+02)
ret i32 0
}