xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x6d() {
  Assert_real((isalpha(109)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              550, ("isalpha should be 1 for m"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x6d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6d,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x226,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x6d>:
push   %rax
mov    $0x6d,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x226,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for m\00"
define void @t_isalpha_0x6d() {
%1 = call i32 @isalpha(i32 109)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for m\00"
define void @t_isalpha_0x6d() {
%1 = tail call i32 @isalpha(i32 109)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 550, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *test8_helper_2() { return ""; }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @test8_helper_2() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @test8_helper_2() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
void av_samples_get_buffer_size() {}


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

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

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

LLVM IR (-O2):
define void @av_samples_get_buffer_size() {
ret void
}
/* Variables and functions */
double *malloc(int);
double *malloc_double(int count) { return malloc(count * sizeof(double)); }


x86 assembly (clang, -O0):
<malloc_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_double>:
shl    $0x3,%edi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define double* @malloc_double(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sext i32 %3 to i64
%5 = mul i64 %4, 8
%6 = trunc i64 %5 to i32
%7 = call double* @malloc(i32 %6)
ret double* %7
}

LLVM IR (-O2):
define noalias double* @malloc_double(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call double* @malloc(i32 %2)
ret double* %3
}
void *avl_default_item_copy(const void *item) { return (void *)item; }


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

x86 assembly (clang, -O2):
<avl_default_item_copy>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @avl_default_item_copy(i8* readnone returned %0) {
ret i8* %0
}
int is_freeform_true(const char *c) {
  return c[0] == '1' || c[0] == 'y' || c[0] == 'Y' || c[0] == 't' ||
         c[0] == 'T';
}


x86 assembly (clang, -O0):
<is_freeform_true>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x31,%ecx
mov    %al,-0x9(%rbp)
je     116c <is_freeform_true+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x9(%rbp)
je     116c <is_freeform_true+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x59,%ecx
mov    %al,-0x9(%rbp)
je     116c <is_freeform_true+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x74,%ecx
mov    %al,-0x9(%rbp)
je     116c <is_freeform_true+0x6c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x54,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_freeform_true>:
mov    (%rdi),%cl
mov    $0x1,%eax
lea    -0x59(%rcx),%edx
cmp    $0x20,%dl
ja     1122 <is_freeform_true+0x22>
movzbl %dl,%edx
movabs $0x108000001,%rsi
bt     %rdx,%rsi
jb     1127 <is_freeform_true+0x27>
cmp    $0x31,%cl
jne    1128 <is_freeform_true+0x28>
ret
xor    %eax,%eax
cmp    $0x54,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @is_freeform_true(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, 49
br i1 %7, label %32, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 121
br i1 %13, label %32, label %14
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 89
br i1 %19, label %32, label %20
20: ; preds = %14
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 116
br i1 %25, label %32, label %26
26: ; preds = %20
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp eq i32 %30, 84
br label %32
32: ; preds = %26, %20, %14, %8, %1
%33 = phi i1 [ true, %20 ], [ true, %14 ], [ true, %8 ], [ true, %1 ], [ %31, %26 ]
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @is_freeform_true(i8* nocapture %0) {
%2 = load i8, i8* %0
switch i8 %2, label %3 [
i8 49, label %6
i8 121, label %6
i8 89, label %6
i8 116, label %6
]
3: ; preds = %1
%4 = icmp eq i8 %2, 84
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %1, %1, %1, %1, %3
%7 = phi i32 [ 1, %1 ], [ %5, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
scalar_t__ strings_is_white_space(char *);
bool strings_is_null_or_white_space(char *string) {
  return string == NULL || strings_is_white_space(string);
}


x86 assembly (clang, -O0):
<strings_is_null_or_white_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     113f <strings_is_null_or_white_space+0x2f>
mov    -0x8(%rbp),%rdi
call   1030 <strings_is_white_space@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strings_is_null_or_white_space>:
test   %rdi,%rdi
je     112b <strings_is_null_or_white_space+0x1b>
push   %rax
call   1030 <strings_is_white_space@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @strings_is_null_or_white_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strings_is_white_space(i8* %6)
%8 = icmp ne i64 %7, 0
br label %9
9: ; preds = %5, %1
%10 = phi i1 [ true, %1 ], [ %8, %5 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @strings_is_null_or_white_space(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strings_is_white_space(i8* %0)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 1, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ get_val();
void FlmDecode() {
  get_val();
  get_val();
}


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

x86 assembly (clang, -O2):
<FlmDecode>:
push   %rax
xor    %eax,%eax
call   1030 <get_val@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <get_val@plt>

LLVM IR (-O0):
define void @FlmDecode() {
%1 = call i32 (...) @get_val()
%2 = call i32 (...) @get_val()
ret void
}

LLVM IR (-O2):
define void @FlmDecode() {
%1 = tail call i32 (...) @get_val()
%2 = tail call i32 (...) @get_val()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ is_pulse(int);
int is_space(int data) { return !is_pulse(data); }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_pulse@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_space>:
push   %rax
call   1030 <is_pulse@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_pulse(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_space(i32 %0) {
%2 = tail call i32 @is_pulse(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) {
  if (islower(c)) {
    return c - 'a' + 'A';
  }
  return c;
}


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113e <toupper+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <toupper+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
lea    -0x20(%rbx),%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @islower(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 97
%10 = add nsw i32 %9, 65
store i32 %10, i32* %2
br label %13
11: ; preds = %1
%12 = load i32, i32* %3
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
int test_imm_DDuint32_mem(unsigned int *val) {
  return ((*val) & (0xDD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_DDuint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0xdd,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_DDuint32_mem>:
testb  $0xdd,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DDuint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 221
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_DDuint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 221
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x24() {
  Assert_real((isgraph(36)),
              "/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_isgraph.c",
              185, ("isgraph should be 1 for $"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x24>:
push   %rbp
mov    %rsp,%rbp
mov    $0x24,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0xb9,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x24>:
push   %rax
mov    $0x24,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0xb9,%edx
pop    %rax
jmp    1030 <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_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for $\00"
define void @t_isgraph_0x24() {
%1 = call i32 @isgraph(i32 36)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for $\00"
define void @t_isgraph_0x24() {
%1 = tail call i32 @isgraph(i32 36)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 185, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char *strmov(register char *dst, register const char *src) {
  while ((*dst++ = *src++))
    ;
  return dst - 1;
}


x86 assembly (clang, -O0):
<strmov>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     113b <strmov+0x3b>
jmp    110c <strmov+0xc>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmov>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
mov    %cl,0x1(%rax)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strmov+0x10>
ret

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

LLVM IR (-O2):
define i8* @strmov(i8* writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %4
}
void FP_array_access2_Ok(int x, int y) {
  int a[1];
  if (x + y == 1) {
    if (x + y != 1) {
      a[3] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<FP_array_access2_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x1,%eax
jne    1134 <FP_array_access2_Ok+0x34>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    $0x1,%eax
je     112f <FP_array_access2_Ok+0x2f>
movl   $0x0,0x0(%rbp)
jmp    1134 <FP_array_access2_Ok+0x34>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @FP_array_access2_Ok(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0x5b() {
  Assert_real((isalpha(91) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              460, ("isalpha should be 0 for ["));
}


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

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

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for [\00"
define void @t_isalpha_0x5b() {
%1 = call i64 @isalpha(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 0 for [\00"
define void @t_isalpha_0x5b() {
%1 = tail call i64 @isalpha(i32 91)
%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 460, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_equal(unsigned char *, int, unsigned char *, int);
unsigned char *base64_decode(char *, int *);
char *base64_encode(unsigned char *, int);
void test_data(unsigned char *data, int data_length) {
  unsigned char *data2;
  int data2_length;
  char *base64 = base64_encode(data, data_length);
  data2 = base64_decode(base64, &data2_length);
  assert_equal(data, data_length, data2, data2_length);
}


x86 assembly (clang, -O0):
<test_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <base64_encode@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <base64_decode@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <assert_equal@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_data>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <base64_encode@plt>
lea    0x4(%rsp),%rsi
mov    %rax,%rdi
call   1050 <base64_decode@plt>
mov    0x4(%rsp),%ecx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1040 <assert_equal@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @test_data(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = call i8* @base64_encode(i8* %8, i32 %9)
store i8* %10, i8** %7
%11 = load i8*, i8** %7
%12 = call i8* @base64_decode(i8* %11, i32* %6)
store i8* %12, i8** %5
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @assert_equal(i8* %13, i32 %14, i8* %15, i32 %16)
ret void
}

LLVM IR (-O2):
define void @test_data(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i8* @base64_encode(i8* %0, i32 %1)
%6 = call i8* @base64_decode(i8* %5, i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @assert_equal(i8* %0, i32 %1, i8* %6, i32 %7)
ret void
}
int compare(const void *lhs, const void *rhs) {
  return *(int *)lhs - *(int *)rhs;
}


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void myfunc(char *const src, int len) {
  int i;
  for (i = 0; i < len; ++i) {
    src[i] = 42;
  }
}


x86 assembly (clang, -O0):
<myfunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1138 <myfunc+0x38>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x2a,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <myfunc+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunc>:
test   %esi,%esi
jle    1125 <myfunc+0x15>
push   %rax
mov    %esi,%edx
mov    $0x2a,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @myfunc(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 = %15, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %18
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
store i8 42, i8* %14
br label %15
15: ; preds = %10
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @myfunc(i8* nocapture writeonly %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 %6
6: ; preds = %4, %2
ret void
}
int main() {
  unsigned int top;
  unsigned int start = 0;
  unsigned int count = 0;
  if (start + count > top) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jbe    1134 <main+0x34>
movl   $0x1,-0x4(%rbp)
jmp    113b <main+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
double lqrand();
double dqrand() { return 5.42101086242752217E-20 * lqrand(); }


x86 assembly (clang, -O0):
<dqrand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <lqrand@plt>
movaps %xmm0,%xmm1
movsd  0xeda(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dqrand>:
push   %rax
xor    %eax,%eax
call   1030 <lqrand@plt>
mulsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @dqrand() {
%1 = call double (...) @lqrand()
%2 = fmul double 0x3BF0000000000000, %1
ret double %2
}

LLVM IR (-O2):
define double @dqrand() {
%1 = tail call double (...) @lqrand()
%2 = fmul double %1, 0x3BF0000000000000
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ fputs(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ getline(char **, size_t *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
ssize_t prompt_and_get_input(const char *prompt, char **line, size_t *len) {
  fputs(prompt, stderr);
  return getline(line, len, stdin);
}


x86 assembly (clang, -O0):
<prompt_and_get_input>:
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    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x2e93(%rip),%rax
mov    (%rax),%edx
call   1040 <getline@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_and_get_input>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <getline@plt>

LLVM IR (-O0):
@stderr = global i32 0
@stdin = global i32 0
define i32 @prompt_and_get_input(i8* %0, i8** %1, i64* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i64*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i64* %2, i64** %6
%7 = load i8*, i8** %4
%8 = load i32, i32* @stderr
%9 = call i32 @fputs(i8* %7, i32 %8)
%10 = load i8**, i8*** %5
%11 = load i64*, i64** %6
%12 = load i32, i32* @stdin
%13 = call i32 @getline(i8** %10, i64* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@stderr = global i32 0
@stdin = global i32 0
define i32 @prompt_and_get_input(i8* %0, i8** %1, i64* %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputs(i8* %0, i32 %4)
%6 = load i32, i32* @stdin
%7 = tail call i32 @getline(i8** %1, i64* %2, i32 %6)
ret i32 %7
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *malloc(int);
void *safe_calloc_(size_t nmemb, size_t size) {
  if (!nmemb || !size)
    return malloc(1);
  return calloc(nmemb, size);
}


x86 assembly (clang, -O0):
<safe_calloc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1146 <safe_calloc_+0x26>
cmpq   $0x0,-0x18(%rbp)
jne    1159 <safe_calloc_+0x39>
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
jmp    116a <safe_calloc_+0x4a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_calloc_>:
test   %rdi,%rdi
je     112f <safe_calloc_+0xf>
test   %rsi,%rsi
je     112f <safe_calloc_+0xf>
jmp    1030 <calloc@plt>
mov    $0x1,%edi
jmp    1040 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @safe_calloc_(i64 %0, i64 %1) {
%3 = icmp ne i64 %0, 0
%4 = icmp ne i64 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call dereferenceable_or_null(1) i8* @malloc(i32 1)
br label %10
8: ; preds = %2
%9 = tail call i8* @calloc(i64 %0, i64 %1)
br label %10
10: ; preds = %8, %6
%11 = phi i8* [ %9, %8 ], [ %7, %6 ]
ret i8* %11
}
/* Type definitions */
struct cri_mutex {
  int dummy;
};

/* Variables and functions */
int ENOTSUP;
int cri_mutex_lock(struct cri_mutex *mutex) { return -ENOTSUP; }


x86 assembly (clang, -O0):
<cri_mutex_lock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ed7(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cri_mutex_lock>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.cri_mutex = type { i32 }
@ENOTSUP = global i32 0
define i32 @cri_mutex_lock(%struct.cri_mutex* %0) {
%2 = alloca %struct.cri_mutex*
store %struct.cri_mutex* %0, %struct.cri_mutex** %2
%3 = load i32, i32* @ENOTSUP
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.cri_mutex = type { i32 }
@ENOTSUP = global i32 0
define i32 @cri_mutex_lock(%struct.cri_mutex* nocapture readnone %0) {
%2 = load i32, i32* @ENOTSUP
%3 = sub nsw i32 0, %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _OS_POP();
int /*<<< orphan*/ _OS_RESTORE_SP();
void _OS_ReturnNoSave(void) {
  _OS_POP();
  _OS_RESTORE_SP();
}


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

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

LLVM IR (-O0):
define void @_OS_ReturnNoSave() {
%1 = call i32 (...) @_OS_POP()
%2 = call i32 (...) @_OS_RESTORE_SP()
ret void
}

LLVM IR (-O2):
define void @_OS_ReturnNoSave() {
%1 = tail call i32 (...) @_OS_POP()
%2 = tail call i32 (...) @_OS_RESTORE_SP()
ret void
}
int storeLineCoords(int x, int y, int i, void *arrays) {
  int **intArrays = arrays;
  intArrays[0][i] = x;
  intArrays[1][i] = y;
  return 0;
}


x86 assembly (clang, -O0):
<storeLineCoords>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%edx
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<storeLineCoords>:
mov    (%rcx),%rax
movslq %edx,%rdx
mov    %edi,(%rax,%rdx,4)
mov    0x8(%rcx),%rax
mov    %esi,(%rax,%rdx,4)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @storeLineCoords(i32 %0, i32 %1, i32 %2, i8* nocapture %3) {
%5 = bitcast i8* %3 to i32**
%6 = load i32*, i32** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %6, i64 %7
store i32 %0, i32* %8
%9 = getelementptr inbounds i8, i8* %3, i64 8
%10 = bitcast i8* %9 to i32**
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 %7
store i32 %1, i32* %12
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ little_endian_read_16(int /*<<< orphan*/ const *, int);
uint16_t rfcomm_event_remote_line_status_get_rfcomm_cid(const uint8_t *event) {
  return little_endian_read_16(event, 2);
}


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

x86 assembly (clang, -O2):
<rfcomm_event_remote_line_status_get_rfcomm_cid>:
mov    $0x2,%esi
jmp    1030 <little_endian_read_16@plt>

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

LLVM IR (-O2):
define i32 @rfcomm_event_remote_line_status_get_rfcomm_cid(i32* %0) {
%2 = tail call i32 @little_endian_read_16(i32* %0, i32 2)
ret i32 %2
}
void func10(_Atomic int *p) {
  p[0 / 0] = 1;
  p[0 / 0] += 1;
  *p = 0 / 0;
  *p += 0 / 0;
}


x86 assembly (clang, -O0):
<func10>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
xchg   %eax,(%rcx)
mov    -0x8(%rbp),%rax
lock addl $0x1,(%rax)
mov    -0x8(%rbp),%rcx
xchg   %eax,(%rcx)
mov    -0x8(%rbp),%rax
lock add %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @func10(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 poison
store atomic i32 1, i32* %4 seq_cst
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 poison
%7 = atomicrmw add i32* %6, i32 1 seq_cst
%8 = add i32 %7, 1
%9 = load i32*, i32** %2
store atomic i32 poison, i32* %9 seq_cst
%10 = load i32*, i32** %2
%11 = atomicrmw add i32* %10, i32 poison seq_cst
%12 = add i32 %11, poison
ret void
}

LLVM IR (-O2):
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __UXTB16(uint32_t x) {
  return ((uint32_t)((((x << 24) >> 24) & 0x0000FFFF) |
                     (((x << 8) >> 8) & 0xFFFF0000)));
}


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

x86 assembly (clang, -O2):
<__UXTB16>:
movsbl %dil,%eax
movzwl %ax,%eax
shl    $0x8,%edi
sar    $0x8,%edi
and    $0xffff0000,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @__UXTB16(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = ashr i32 %4, 24
%6 = and i32 %5, 65535
%7 = load i32, i32* %2
%8 = shl i32 %7, 8
%9 = ashr i32 %8, 8
%10 = and i32 %9, -65536
%11 = or i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @__UXTB16(i32 %0) {
%2 = shl i32 %0, 24
%3 = ashr exact i32 %2, 24
%4 = and i32 %3, 65535
%5 = shl i32 %0, 8
%6 = ashr exact i32 %5, 8
%7 = and i32 %6, -65536
%8 = or i32 %4, %7
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ __chk_fail();
int /*<<< orphan*/ __read(int, void *, size_t);
ssize_t __read_chk(int fd, void *buf, size_t nbytes, size_t buflen) {
  if (nbytes > buflen)
    __chk_fail();
  return __read(fd, buf, nbytes);
}


x86 assembly (clang, -O0):
<__read_chk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    114c <__read_chk+0x2c>
mov    $0x0,%al
call   1040 <__chk_fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <__read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__read_chk>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%ebp
cmp    %rcx,%rdx
jbe    1138 <__read_chk+0x18>
xor    %eax,%eax
call   1040 <__chk_fail@plt>
mov    %ebp,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <__read@plt>

LLVM IR (-O0):
define i32 @__read_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %7
%10 = load i64, i64* %8
%11 = icmp ugt i64 %9, %10
br i1 %11, label %12, label %14
12: ; preds = %4
%13 = call i32 (...) @__chk_fail()
br label %14
14: ; preds = %12, %4
%15 = load i32, i32* %5
%16 = load i8*, i8** %6
%17 = load i64, i64* %7
%18 = call i32 @__read(i32 %15, i8* %16, i64 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @__read_chk(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = icmp ugt i64 %2, %3
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (...) @__chk_fail()
br label %8
8: ; preds = %6, %4
%9 = tail call i32 @__read(i32 %0, i8* %1, i64 %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
void main() {
  (*(volatile unsigned long *)0xE0200280) = 0x00001111;
  while (1) {
    (*(volatile unsigned long *)0xE0200284) = 0;
    delay(0x100000);
    (*(volatile unsigned long *)0xE0200284) = 0xf;
    delay(0x100000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200280,%eax
movq   $0x1111,(%rax)
mov    $0xe0200284,%eax
movq   $0x0,(%rax)
mov    $0x100000,%edi
call   1030 <delay@plt>
mov    $0xe0200284,%eax
movq   $0xf,(%rax)
mov    $0x100000,%edi
call   1030 <delay@plt>
jmp    1120 <main+0x10>

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xe0200284,%ebx
movq   $0x1111,-0x4(%rbx)
xchg   %ax,%ax
movq   $0x0,(%rbx)
mov    $0x100000,%edi
call   1030 <delay@plt>
movq   $0xf,(%rbx)
mov    $0x100000,%edi
call   1030 <delay@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define void @main() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
br label %1
1: ; preds = %0, %1
store volatile i64 0, i64* inttoptr (i64 3760194180 to i64*)
%2 = call i32 @delay(i32 1048576)
store volatile i64 15, i64* inttoptr (i64 3760194180 to i64*)
%3 = call i32 @delay(i32 1048576)
br label %1
}

LLVM IR (-O2):
define void @main() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
br label %1
1: ; preds = %0, %1
store volatile i64 0, i64* inttoptr (i64 3760194180 to i64*)
%2 = tail call i32 @delay(i32 1048576)
store volatile i64 15, i64* inttoptr (i64 3760194180 to i64*)
%3 = tail call i32 @delay(i32 1048576)
br label %1
}
int getMin(int a, int b) {
  if (a <= b)
    return (a);
  return (b);
}


x86 assembly (clang, -O0):
<getMin>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1121 <getMin+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <getMin+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getMin>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @getMin(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cleanUp();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int error(char *pErrorMessage) {
  fprintf(stderr, "%s", pErrorMessage);
  cleanUp();
  return 1;
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <cleanUp@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <cleanUp@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @cleanUp()
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define i32 @error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @cleanUp()
ret i32 1
}
/* Type definitions */
struct sp_rtree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct sp_rtree *);
void sp_rtree_release(struct sp_rtree *tree) { free(tree); }


x86 assembly (clang, -O0):
<sp_rtree_release>:
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):
<sp_rtree_release>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.sp_rtree = type { i32 }
define void @sp_rtree_release(%struct.sp_rtree* nocapture %0) {
%2 = tail call i32 @free(%struct.sp_rtree* %0)
ret void
}
void SOS_DefaultShockHandler() {
  printf("%s: ", __PRETTY_FUNCTION__);
  printf("Exit program.\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<SOS_DefaultShockHandler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<SOS_DefaultShockHandler>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0xec6(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s: \00"
@__PRETTY_FUNCTION__.SOS_DefaultShockHandler = [31 x i8] c"void SOS_DefaultShockHandler()\00"
@.str.1 = [15 x i8] c"Exit program.\0A\00"
define void @SOS_DefaultShockHandler() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__PRETTY_FUNCTION__.SOS_DefaultShockHandler, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s: \00"
@__PRETTY_FUNCTION__.SOS_DefaultShockHandler = [31 x i8] c"void SOS_DefaultShockHandler()\00"
@str = [14 x i8] c"Exit program.\00"
define void @SOS_DefaultShockHandler() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @__PRETTY_FUNCTION__.SOS_DefaultShockHandler, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
tail call void @exit(i32 -1)
unreachable
}
/* Variables and functions */
long factorial(int);
long find_npr(int n, int r) {
  long result;
  result = factorial(n) / factorial(n - r);
  return result;
}


x86 assembly (clang, -O0):
<find_npr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
sub    -0x8(%rbp),%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cqto
idiv   %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_npr>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <factorial@plt>
mov    %rax,%rbx
sub    %r14d,%ebp
mov    %ebp,%edi
call   1030 <factorial@plt>
mov    %rax,%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
je     1144 <find_npr+0x34>
mov    %rbx,%rax
cqto
idiv   %rcx
jmp    114a <find_npr+0x3a>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i64 @find_npr(i32 %0, i32 %1) {
%3 = tail call i64 @factorial(i32 %0)
%4 = sub nsw i32 %0, %1
%5 = tail call i64 @factorial(i32 %4)
%6 = sdiv i64 %3, %5
ret i64 %6
}
int MV_ID(int a, int b, int c, int d) {
  return (a) | (b << 8) | (c << 16) | (d << 24);
}


x86 assembly (clang, -O0):
<MV_ID>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MV_ID>:
mov    %ecx,%eax
shl    $0x8,%esi
or     %edi,%esi
shl    $0x10,%edx
shl    $0x18,%eax
or     %edx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @MV_ID(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = shl i32 %10, 8
%12 = or i32 %9, %11
%13 = load i32, i32* %7
%14 = shl i32 %13, 16
%15 = or i32 %12, %14
%16 = load i32, i32* %8
%17 = shl i32 %16, 24
%18 = or i32 %15, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @MV_ID(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl i32 %1, 8
%6 = or i32 %5, %0
%7 = shl i32 %2, 16
%8 = or i32 %6, %7
%9 = shl i32 %3, 24
%10 = or i32 %8, %9
ret i32 %10
}