xunge/DecIR huggingface dataset:
/* Type definitions */
struct party {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mapif_party_broken(int, int);
int /*<<< orphan*/ partydb_sql_delete(int);
struct party *partydb_sql_load_num(int);
int mapif_parse_BreakParty(int fd, int party_id) {
  const struct party *p = partydb_sql_load_num(party_id);
  if (p == NULL) {
    return 0;
  }
  partydb_sql_delete(party_id);
  mapif_party_broken(fd, party_id);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_parse_BreakParty>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <partydb_sql_load_num@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1161 <mapif_parse_BreakParty+0x31>
movl   $0x0,-0x4(%rbp)
jmp    117b <mapif_parse_BreakParty+0x4b>
mov    -0xc(%rbp),%edi
call   1050 <partydb_sql_delete@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <mapif_party_broken@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_parse_BreakParty>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
call   1040 <partydb_sql_load_num@plt>
test   %rax,%rax
je     1153 <mapif_parse_BreakParty+0x23>
mov    %ebx,%edi
call   1050 <partydb_sql_delete@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <mapif_party_broken@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.party = type { i32 }
define i32 @mapif_parse_BreakParty(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.party*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = call %struct.party* @partydb_sql_load_num(i32 %7)
store %struct.party* %8, %struct.party** %6
%9 = load %struct.party*, %struct.party** %6
%10 = icmp eq %struct.party* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %18
12: ; preds = %2
%13 = load i32, i32* %5
%14 = call i32 @partydb_sql_delete(i32 %13)
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @mapif_party_broken(i32 %15, i32 %16)
store i32 0, i32* %3
br label %18
18: ; preds = %12, %11
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.party = type { i32 }
define i32 @mapif_parse_BreakParty(i32 %0, i32 %1) {
%3 = tail call %struct.party* @partydb_sql_load_num(i32 %1)
%4 = icmp eq %struct.party* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @partydb_sql_delete(i32 %1)
%7 = tail call i32 @mapif_party_broken(i32 %0, i32 %1)
br label %8
8: ; preds = %2, %5
ret i32 0
}
void func(unsigned char a) {
  if (a) {
  };
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1119 <func+0x19>
jmp    1119 <func+0x19>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @func(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @func(i8 zeroext %0) {
ret void
}
unsigned long crb_set_term_int(long unit, long mask) {
  if (unit != 0 || (mask & 0x22) != 0)
    return 0x8000000000000000ul;
  return 0;
}


x86 assembly (clang, -O0):
<crb_set_term_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1129 <crb_set_term_int+0x29>
mov    -0x18(%rbp),%rax
and    $0x22,%rax
cmp    $0x0,%rax
je     113c <crb_set_term_int+0x3c>
movabs $0x8000000000000000,%rax
mov    %rax,-0x8(%rbp)
jmp    1144 <crb_set_term_int+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<crb_set_term_int>:
and    $0x22,%esi
xor    %eax,%eax
or     %rdi,%rsi
setne  %al
shl    $0x3f,%rax
ret

LLVM IR (-O0):
define i64 @crb_set_term_int(i64 %0, i64 %1) {
%3 = alloca i64
%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 %12, label %8
8: ; preds = %2
%9 = load i64, i64* %5
%10 = and i64 %9, 34
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8, %2
store i64 -9223372036854775808, i64* %3
br label %14
13: ; preds = %8
store i64 0, i64* %3
br label %14
14: ; preds = %13, %12
%15 = load i64, i64* %3
ret i64 %15
}

LLVM IR (-O2):
define i64 @crb_set_term_int(i64 %0, i64 %1) {
%3 = and i64 %1, 34
%4 = or i64 %3, %0
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i64 0, i64 -9223372036854775808
ret i64 %6
}
const char *get_sourcedir(void) { return "."; }


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i8* @get_sourcedir() {
ret i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print(int vetor[], int tam) {
  for (int i = 0; i < tam; i++)
    printf("%d\n", vetor[i]);
}


x86 assembly (clang, -O0):
<print>:
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    1157 <print+0x47>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1145 <print+0x35>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %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 i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32* 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 i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %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*/ printf(char *);
int main(int arc, char **argv) {
  printf("hello, world\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"hello, world\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 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"hello, world\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
txt_trackstart() { printf("Track start\n"); }


x86 assembly (clang, -O0):
<txt_trackstart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Track start\0A\00"
define i32 @txt_trackstart() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [12 x i8] c"Track start\00"
define i32 @txt_trackstart() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int munmap(void *, int);
int unsetUIO(void *uio_ptr, int length) { return munmap(uio_ptr, length); }


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

x86 assembly (clang, -O2):
<unsetUIO>:
jmp    1030 <munmap@plt>

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

LLVM IR (-O2):
define i32 @unsetUIO(i8* %0, i32 %1) {
%3 = tail call i32 @munmap(i8* %0, i32 %1)
ret i32 %3
}
int cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x8(%rbp),%rdx
movslq -0x10(%rbp),%rsi
xor    %eax,%eax
cmp    (%rdx,%rsi,4),%ecx
mov    %al,-0x15(%rbp)
jne    1158 <cmp+0x58>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    -0x14(%rbp),%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%r8d
movslq %edx,%r9
xor    %eax,%eax
cmp    (%rdi,%r9,4),%r8d
jne    1127 <cmp+0x27>
add    %ecx,%esi
movslq %esi,%rax
mov    (%rdi,%rax,4),%esi
add    %ecx,%edx
movslq %edx,%rcx
xor    %eax,%eax
cmp    (%rdi,%rcx,4),%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @cmp(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 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
%18 = load i32, i32* %17
%19 = icmp eq i32 %13, %18
br i1 %19, label %20, label %36
20: ; preds = %4
%21 = load i32*, i32** %5
%22 = load i32, i32* %6
%23 = load i32, i32* %8
%24 = add nsw i32 %22, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %21, i64 %25
%27 = load i32, i32* %26
%28 = load i32*, i32** %5
%29 = load i32, i32* %7
%30 = load i32, i32* %8
%31 = add nsw i32 %29, %30
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %28, i64 %32
%34 = load i32, i32* %33
%35 = icmp eq i32 %27, %34
br label %36
36: ; preds = %20, %4
%37 = phi i1 [ false, %4 ], [ %35, %20 ]
%38 = zext i1 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @cmp(i32* nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %7, %10
br i1 %11, label %12, label %23
12: ; preds = %4
%13 = add nsw i32 %3, %1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %0, i64 %14
%16 = load i32, i32* %15
%17 = add nsw i32 %3, %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %0, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %16, %20
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %12, %4
%24 = phi i32 [ 0, %4 ], [ %22, %12 ]
ret i32 %24
}
/* Variables and functions */
int foo(int *);
int main() {
  int a = 1;
  return foo(&a) + a;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <foo@plt>
add    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%3 = call i32 @foo(i32* %1)
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
int execute_string(const char *str) {
  char *argv[(16)] = {'\0'};
  int argc = split_command_line((char *)str, argv);
  return parse_args(argc, argv);
}


x86 assembly (clang, -O0):
<execute_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x0,%al
call   1050 <split_command_line@plt>
mov    %eax,-0x94(%rbp)
mov    -0x94(%rbp),%edi
lea    -0x90(%rbp),%rsi
mov    $0x0,%al
call   1040 <parse_args@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute_string>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <split_command_line@plt>
mov    %eax,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <parse_args@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @execute_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [16 x i8*]
%4 = alloca i32
store i8* %0, i8** %2
%5 = bitcast [16 x i8*]* %3 to i8*
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [16 x i8*], [16 x i8*]* %3, i64 0, i64 0
%8 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @split_command_line to i32 (i8*, i8**, ...)*)(i8* %6, i8** %7)
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = getelementptr inbounds [16 x i8*], [16 x i8*]* %3, i64 0, i64 0
%11 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @parse_args to i32 (i32, i8**, ...)*)(i32 %9, i8** %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @execute_string(i8* %0) {
%2 = alloca [16 x i8*]
%3 = bitcast [16 x i8*]* %2 to i8*
%4 = getelementptr inbounds [16 x i8*], [16 x i8*]* %2, i64 0, i64 0
%5 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @split_command_line to i32 (i8*, i8**, ...)*)(i8* %0, i8** %4)
%6 = call i32 (i32, i8**, ...) bitcast (i32 (...)* @parse_args to i32 (i32, i8**, ...)*)(i32 %5, i8** %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int version() {
  printf("jrep (Just a Regular Expression Parser 1.0.0\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<version>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"jrep (Just a Regular Expression Parser 1.0.0\0A\00"
define i32 @version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [45 x i8] c"jrep (Just a Regular Expression Parser 1.0.0\00"
define i32 @version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _putchar(char);
void _print_rev_recursion(char *s) {
  if (*s == '\0') {
    return;
  }
  _print_rev_recursion(s + 1);
  _putchar(*s);
}


x86 assembly (clang, -O0):
<_print_rev_recursion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1141 <_print_rev_recursion+0x21>
jmp    115a <_print_rev_recursion+0x3a>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <_print_rev_recursion@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_print_rev_recursion>:
push   %rbx
cmpb   $0x0,(%rdi)
je     113b <_print_rev_recursion+0x1b>
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <_print_rev_recursion@plt>
movsbl (%rbx),%edi
pop    %rbx
jmp    1040 <_putchar@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @_print_rev_recursion(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1, %5
ret void
5: ; preds = %1
%6 = getelementptr inbounds i8, i8* %0, i64 1
tail call void @_print_rev_recursion(i8* %6)
%7 = load i8, i8* %0
%8 = tail call i32 @_putchar(i8 signext %7)
br label %4
}
/* Variables and functions */
char isprint(unsigned char c) {
  if (c >= 0x20 && c <= 0x7e)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x20,%eax
jl     112d <isprint+0x2d>
movzbl -0x2(%rbp),%eax
cmp    $0x7e,%eax
jg     112d <isprint+0x2d>
movb   $0x1,-0x1(%rbp)
jmp    1131 <isprint+0x31>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xe0,%dil
cmp    $0x5f,%dil
setb   %al
ret

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

LLVM IR (-O2):
define signext i8 @isprint(i8 zeroext %0) {
%2 = add i8 %0, -32
%3 = icmp ult i8 %2, 95
%4 = zext i1 %3 to i8
ret i8 %4
}
void StopSB() {}


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

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

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

LLVM IR (-O2):
define void @StopSB() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ daemon(int, int);
int main(void) {
  daemon(1, 1);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%esi
mov    %esi,%edi
call   1030 <daemon@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x1,%esi
call   1030 <daemon@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @daemon(i32 1, i32 1)
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @daemon(i32 1, i32 1)
br label %2
2: ; preds = %0, %2
br label %2
}
void coor_to_tiled(int *x, int *y) {
  *y = -*y;
  *x = *x - (*y + 1) / 2;
}


x86 assembly (clang, -O0):
<coor_to_tiled>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    $0x2,%esi
cltd
idiv   %esi
sub    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<coor_to_tiled>:
mov    (%rsi),%eax
mov    $0x1,%ecx
sub    %eax,%ecx
neg    %eax
mov    %eax,(%rsi)
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
sub    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @coor_to_tiled(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = sub nsw i32 0, %6
%8 = load i32*, i32** %4
store i32 %7, i32* %8
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %13, 2
%15 = sub nsw i32 %10, %14
%16 = load i32*, i32** %3
store i32 %15, i32* %16
ret void
}

LLVM IR (-O2):
define void @coor_to_tiled(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sub nsw i32 0, %3
store i32 %4, i32* %1
%5 = load i32, i32* %0
%6 = sub i32 1, %3
%7 = sdiv i32 %6, -2
%8 = add i32 %7, %5
store i32 %8, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ config_WITH_CARDREADER();
int config_READER_VIACCESS(void) { return config_WITH_CARDREADER() ? 1 : 0; }


x86 assembly (clang, -O0):
<config_READER_VIACCESS>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <config_WITH_CARDREADER@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @config_READER_VIACCESS() {
%1 = call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 1, i32 0
ret i32 %4
}

LLVM IR (-O2):
define i32 @config_READER_VIACCESS() {
%1 = tail call i64 (...) @config_WITH_CARDREADER()
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int Mytop(uintptr_t);
int /*<<< orphan*/ printf(char *, void *, int);
void TestShow(void *x) {
  printf("Virtual Address:%u  Physical Address:%u\n", x, Mytop((uintptr_t)x));
}


x86 assembly (clang, -O0):
<TestShow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Mytop@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestShow>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Mytop@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"Virtual Address:%u Physical Address:%u\0A\00"
define void @TestShow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = ptrtoint i8* %4 to i64
%6 = call i32 @Mytop(i64 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"Virtual Address:%u Physical Address:%u\0A\00"
define void @TestShow(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i32 @Mytop(i64 %2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ QS(int *, int /*<<< orphan*/, int);
int rand();
int main(int argc, char *argv[]) {
  int o;
  int a[2048];
  for (o = 0; o < 2048; o++)
    a[o] = rand() % 16384;
  QS(a, 0, 2048 - 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2020,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x800,-0x14(%rbp)
jge    1175 <main+0x55>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x4000,%ecx
cltd
idiv   %ecx
movslq -0x14(%rbp),%rax
mov    %edx,-0x2020(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <main+0x20>
lea    -0x2020(%rbp),%rdi
xor    %esi,%esi
mov    $0x7ff,%edx
call   1030 <QS@plt>
xor    %eax,%eax
add    $0x2020,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2000,%rsp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
lea    0x3fff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffc000,%ecx
sub    %ecx,%eax
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x800,%rbx
jne    1130 <main+0x10>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x7ff,%edx
call   1030 <QS@plt>
xor    %eax,%eax
add    $0x2000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [2048 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %17, %2
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 2048
br i1 %10, label %11, label %20
11: ; preds = %8
%12 = call i32 (...) @rand()
%13 = srem i32 %12, 16384
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2048 x i32], [2048 x i32]* %7, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %11
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %8
20: ; preds = %8
%21 = getelementptr inbounds [2048 x i32], [2048 x i32]* %7, i64 0, i64 0
%22 = call i32 @QS(i32* %21, i32 0, i32 2047)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [2048 x i32]
%4 = bitcast [2048 x i32]* %3 to i8*
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %10, %5 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 16384
%9 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 %6
store i32 %8, i32* %9
%10 = add nuw nsw i64 %6, 1
%11 = icmp eq i64 %10, 2048
br i1 %11, label %12, label %5
12: ; preds = %5
%13 = getelementptr inbounds [2048 x i32], [2048 x i32]* %3, i64 0, i64 0
%14 = call i32 @QS(i32* %13, i32 0, i32 2047)
ret i32 0
}
int dd_leq_dd_d(const double *a, double b) {
  return (a[0] < b || (a[0] == b && a[1] <= 0.0)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<dd_leq_dd_d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
ja     115f <dd_leq_dd_d+0x5f>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xor    %eax,%eax
ucomisd -0x10(%rbp),%xmm0
mov    %al,-0x12(%rbp)
jne    1159 <dd_leq_dd_d+0x59>
jp     1159 <dd_leq_dd_d+0x59>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd 0x8(%rax),%xmm0
setae  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dd_leq_dd_d>:
movsd  (%rdi),%xmm1
mov    $0x1,%eax
ucomisd %xmm1,%xmm0
ja     1125 <dd_leq_dd_d+0x25>
ucomisd %xmm0,%xmm1
jne    1126 <dd_leq_dd_d+0x26>
jp     1126 <dd_leq_dd_d+0x26>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
ucomisd 0x8(%rdi),%xmm0
setae  %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @dd_leq_dd_d(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double, double* %4
%9 = fcmp olt double %7, %8
br i1 %9, label %23, label %10
10: ; preds = %2
%11 = load double*, double** %3
%12 = getelementptr inbounds double, double* %11, i64 0
%13 = load double, double* %12
%14 = load double, double* %4
%15 = fcmp oeq double %13, %14
br i1 %15, label %16, label %21
16: ; preds = %10
%17 = load double*, double** %3
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fcmp ole double %19, 0.000000e+00
br label %21
21: ; preds = %16, %10
%22 = phi i1 [ false, %10 ], [ %20, %16 ]
br label %23
23: ; preds = %21, %2
%24 = phi i1 [ true, %2 ], [ %22, %21 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 1, i32 0
ret i32 %26
}

LLVM IR (-O2):
define i32 @dd_leq_dd_d(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp olt double %3, %1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = fcmp oeq double %3, %1
br i1 %6, label %7, label %12
7: ; preds = %5
%8 = getelementptr inbounds double, double* %0, i64 1
%9 = load double, double* %8
%10 = fcmp ole double %9, 0.000000e+00
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %5, %7, %2
%13 = phi i32 [ 1, %2 ], [ 0, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ error(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
FILE *openfile(char *name, char *mode) {
  FILE *f;
  if ((f = fopen(name, mode)) == NULL) {
    error("cannot open %s", name);
  }
  return f;
}


x86 assembly (clang, -O0):
<openfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    115b <openfile+0x3b>
mov    -0x8(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1030 <error@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<openfile>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <openfile+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"cannot open %s\00"
define noalias i32* @openfile(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %5, %2
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ Delay_ms(int);
void delay2S() { Delay_ms(2000); }


x86 assembly (clang, -O0):
<delay2S>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7d0,%edi
call   1030 <Delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay2S>:
mov    $0x7d0,%edi
jmp    1030 <Delay_ms@plt>

LLVM IR (-O0):
define void @delay2S() {
%1 = call i32 @Delay_ms(i32 2000)
ret void
}

LLVM IR (-O2):
define void @delay2S() {
%1 = tail call i32 @Delay_ms(i32 2000)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strlen(char const *);
scalar_t__ strncmp(char const *, char const *, int /*<<< orphan*/);
int s3d_strstartswith(const char *s, const char *prefix) {
  return (strncmp(s, prefix, strlen(prefix)) == 0);
}


x86 assembly (clang, -O0):
<s3d_strstartswith>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3d_strstartswith>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @s3d_strstartswith(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 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i64 @strncmp(i8* %5, i8* %6, i32 %8)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @s3d_strstartswith(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i64 @strncmp(i8* %0, i8* %1, i32 %3)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _attoHTTPReadC(int /*<<< orphan*/ *);
uint8_t attoHTTPGetRawParamChar(char *c) {
  return _attoHTTPReadC((uint8_t *)c);
}


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

x86 assembly (clang, -O2):
<attoHTTPGetRawParamChar>:
jmp    1030 <_attoHTTPReadC@plt>

LLVM IR (-O0):
define i32 @attoHTTPGetRawParamChar(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @_attoHTTPReadC(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @attoHTTPGetRawParamChar(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @_attoHTTPReadC(i32* %2)
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int host_is_little_endian() {
  static int answer = -1;
  uint32_t x = 0x01020304;
  unsigned char *c = (unsigned char *)&x;
  if (answer != -1)
    return answer;
  answer = (c[0] == 0x04);
  return answer;
}


x86 assembly (clang, -O0):
<host_is_little_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1020304,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0xffffffff,0x2f06(%rip)
je     112e <host_is_little_endian+0x2e>
mov    0x2efa(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <host_is_little_endian+0x4f>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,0x2eda(%rip)
mov    0x2ed4(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<host_is_little_endian>:
cmpb   $0x0,0x2f1d(%rip)
jne    1110 <host_is_little_endian+0x10>
movb   $0x1,0x2f14(%rip)
mov    $0x1,%eax
ret

LLVM IR (-O0):
@host_is_little_endian.answer = internal global i32 -1
define i32 @host_is_little_endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 16909060, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i32, i32* @host_is_little_endian.answer
%6 = icmp ne i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i32, i32* @host_is_little_endian.answer
store i32 %8, i32* %1
br label %17
9: ; preds = %0
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 4
%15 = zext i1 %14 to i32
store i32 %15, i32* @host_is_little_endian.answer
%16 = load i32, i32* @host_is_little_endian.answer
store i32 %16, i32* %1
br label %17
17: ; preds = %9, %7
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@host_is_little_endian.answer = internal unnamed_addr global i1 false
define i32 @host_is_little_endian() {
%1 = load i1, i1* @host_is_little_endian.answer
br i1 %1, label %3, label %2
2: ; preds = %0
store i1 true, i1* @host_is_little_endian.answer
br label %3
3: ; preds = %0, %2
ret i32 1
}
/* Variables and functions */
scalar_t__ read(int, char *, int);
int /*<<< orphan*/ warnx(char *);
void read_gpio_value(int gpio_value_fd) {
  char buf;
  if (read(gpio_value_fd, &buf, 1) < 0) {
    warnx("read() failed");
  }
}


x86 assembly (clang, -O0):
<read_gpio_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
cmp    $0x0,%rax
jge    1152 <read_gpio_value+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <warnx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_gpio_value>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1040 <read@plt>
test   %rax,%rax
js     1137 <read_gpio_value+0x17>
pop    %rax
ret
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1030 <warnx@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"read() failed\00"
define void @read_gpio_value(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @read(i32 %4, i8* %3, i32 1)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"read() failed\00"
define void @read_gpio_value(i32 %0) {
%2 = alloca i8
%3 = call i64 @read(i32 %0, i8* %2, i32 1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @warnx(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
double cos(double);
double sin(double);
void sincos(double t, double *y, double *x) {
  *y = sin(t);
  *x = cos(t);
}


x86 assembly (clang, -O0):
<sincos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x8(%rbp),%xmm0
call   1040 <cos@plt>
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sincos>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
movsd  %xmm0,(%rbx)
movsd  (%rsp),%xmm0
call   1040 <cos@plt>
movsd  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @sincos(double %0, double* %1, double* %2) {
%4 = alloca double
%5 = alloca double*
%6 = alloca double*
store double %0, double* %4
store double* %1, double** %5
store double* %2, double** %6
%7 = load double, double* %4
%8 = call double @sin(double %7)
%9 = load double*, double** %5
store double %8, double* %9
%10 = load double, double* %4
%11 = call double @cos(double %10)
%12 = load double*, double** %6
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @sincos(double %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = tail call double @sin(double %0)
store double %4, double* %1
%5 = tail call double @cos(double %0)
store double %5, double* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isspace(int);
void t_isspace_0x0e() {
  Assert_real((isspace(14) == 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_isspace.c",
              75, ("isspace should be 0 for 0x0e"));
}


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

x86 assembly (clang, -O2):
<t_isspace_0x0e>:
push   %rax
mov    $0xe,%edi
call   1030 <isspace@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4b,%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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x0e\00"
define void @t_isspace_0x0e() {
%1 = call i64 @isspace(i32 14)
%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 75, 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_isspace.c\00"
@.str.1 = [29 x i8] c"isspace should be 0 for 0x0e\00"
define void @t_isspace_0x0e() {
%1 = tail call i64 @isspace(i32 14)
%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 75, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void ShowVersion(void) {
  printf("\n%s\n\n", "v0.0.1");
  exit(0);
}


x86 assembly (clang, -O0):
<ShowVersion>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<ShowVersion>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\0A%s\0A\0A\00"
@.str.1 = [7 x i8] c"v0.0.1\00"
define void @ShowVersion() {
%1 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s\0A\0A\00"
@.str.1 = [7 x i8] c"v0.0.1\00"
define void @ShowVersion() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int calculate_sum(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  printf("%d\n", calculate_sum(n));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <calculate_sum@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @calculate_sum(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int max(size_t a, size_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void delete (char *cstr, int len) {
  memset(cstr, 0, len);
  free(cstr);
}


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

x86 assembly (clang, -O2):
<delete>:
push   %rbx
mov    %esi,%edx
mov    %rdi,%rbx
xor    %esi,%esi
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @delete(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
%4 = tail call i32 @free(i8* %0)
ret void
}
int foo(void) { return 999; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3e7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
ret i32 999
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 999
}