xunge/DecIR huggingface dataset:
/* Type definitions */
struct section_list {
  int dummy;
};
struct section {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
scalar_t__ genlist_front(struct genlist const *);
struct section *section_list_front(const struct section_list *tthis) {
  return (struct section *)genlist_front((const struct genlist *)tthis);
}


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

x86 assembly (clang, -O2):
<section_list_front>:
jmp    1030 <genlist_front@plt>

LLVM IR (-O0):
%struct.section = type { i32 }
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.section* @section_list_front(%struct.section_list* %0) {
%2 = alloca %struct.section_list*
store %struct.section_list* %0, %struct.section_list** %2
%3 = load %struct.section_list*, %struct.section_list** %2
%4 = bitcast %struct.section_list* %3 to %struct.genlist*
%5 = call i64 @genlist_front(%struct.genlist* %4)
%6 = inttoptr i64 %5 to %struct.section*
ret %struct.section* %6
}

LLVM IR (-O2):
%struct.section = type { i32 }
%struct.section_list = type { i32 }
%struct.genlist = type { i32 }
define %struct.section* @section_list_front(%struct.section_list* %0) {
%2 = bitcast %struct.section_list* %0 to %struct.genlist*
%3 = tail call i64 @genlist_front(%struct.genlist* %2)
%4 = inttoptr i64 %3 to %struct.section*
ret %struct.section* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int __setxid(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid) {
  return __setxid(210, rgid, egid, sgid);
}


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

x86 assembly (clang, -O2):
<setresgid>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0xd2,%edi
jmp    1030 <__setxid@plt>

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

LLVM IR (-O2):
define i32 @setresgid(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__setxid(i32 210, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  FILE *foo = fopen("foo.txt", "r");
  char buffer[64];
  fgets(buffer, 10, foo);
  printf("%s\n", buffer);
  fclose(foo);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0xa,%esi
call   1050 <fgets@plt>
lea    -0x60(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xeb2(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%rbx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xa,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
lea    0xe93(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [8 x i8] c"foo.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca [64 x i8]
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %5
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%9 = load i32*, i32** %5
%10 = call i32 @fgets(i8* %8, i32 10, i32* %9)
%11 = getelementptr inbounds [64 x i8], [64 x i8]* %6, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = load i32*, i32** %5
%14 = call i32 @fclose(i32* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"foo.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x i8]
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%6 = call i32 @fgets(i8* %5, i32 10, i32* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%8 = call i32 @fclose(i32* %4)
ret i32 0
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *kmap(struct page *page) {
  assert(0);
  return NULL;
}


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

x86 assembly (clang, -O2):
<kmap>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.page = type { i32 }
define i8* @kmap(%struct.page* %0) {
%2 = alloca %struct.page*
store %struct.page* %0, %struct.page** %2
%3 = call i32 @assert(i32 0)
ret i8* null
}

LLVM IR (-O2):
%struct.page = type { i32 }
define noalias i8* @kmap(%struct.page* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMR7F_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMR7F_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
struct statement_list {
  int dummy;
};

/* Variables and functions */
struct statement_list *optimize_statement_list(struct statement_list *);
int /*<<< orphan*/ scan_statement_list(struct statement_list *);
struct statement_list *
scan_optimize_statement_list(struct statement_list *list) {
  scan_statement_list(list);
  list = optimize_statement_list(list);
  list = optimize_statement_list(list);
  return list;
}


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

x86 assembly (clang, -O2):
<scan_optimize_statement_list>:
push   %rbx
mov    %rdi,%rbx
call   1040 <scan_statement_list@plt>
mov    %rbx,%rdi
call   1030 <optimize_statement_list@plt>
mov    %rax,%rdi
pop    %rbx
jmp    1030 <optimize_statement_list@plt>

LLVM IR (-O0):
%struct.statement_list = type { i32 }
define %struct.statement_list* @scan_optimize_statement_list(%struct.statement_list* %0) {
%2 = alloca %struct.statement_list*
store %struct.statement_list* %0, %struct.statement_list** %2
%3 = load %struct.statement_list*, %struct.statement_list** %2
%4 = call i32 @scan_statement_list(%struct.statement_list* %3)
%5 = load %struct.statement_list*, %struct.statement_list** %2
%6 = call %struct.statement_list* @optimize_statement_list(%struct.statement_list* %5)
store %struct.statement_list* %6, %struct.statement_list** %2
%7 = load %struct.statement_list*, %struct.statement_list** %2
%8 = call %struct.statement_list* @optimize_statement_list(%struct.statement_list* %7)
store %struct.statement_list* %8, %struct.statement_list** %2
%9 = load %struct.statement_list*, %struct.statement_list** %2
ret %struct.statement_list* %9
}

LLVM IR (-O2):
%struct.statement_list = type { i32 }
define %struct.statement_list* @scan_optimize_statement_list(%struct.statement_list* %0) {
%2 = tail call i32 @scan_statement_list(%struct.statement_list* %0)
%3 = tail call %struct.statement_list* @optimize_statement_list(%struct.statement_list* %0)
%4 = tail call %struct.statement_list* @optimize_statement_list(%struct.statement_list* %3)
ret %struct.statement_list* %4
}
int _islower(char c) { return (c >= 'a' && c <= 'z'); }


x86 assembly (clang, -O0):
<_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <_islower+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_islower>:
add    $0x9f,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @_islower(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @_islower(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
char toupper(char);
char *str_upper(char *str) {
  char *c;
  for (c = str; *c != '\0'; c++) {
    *c = toupper(*c);
  }
  return str;
}


x86 assembly (clang, -O0):
<str_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1159 <str_upper+0x49>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <str_upper+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_upper>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <str_upper+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <str_upper+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @str_upper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @toupper(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void *func(void *p) {
  puts("Thread is working.");
  pthread_exit(NULL);
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"Thread is working.\00"
define i8* @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [19 x i8] c"Thread is working.\00"
define noalias i8* @func(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
void loop_enter() { ("loop_enter"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"loop_enter\00"
define void @loop_enter() {
ret void
}

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void fortune_cooke(char *msg) {
  printf("Message reads: %s\n", msg);
  printf("Message size: %lu bytes\n", sizeof(msg));
}


x86 assembly (clang, -O0):
<fortune_cooke>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fortune_cooke>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Message reads: %s\0A\00"
@.str.1 = [25 x i8] c"Message size: %lu bytes\0A\00"
define void @fortune_cooke(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 8)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"Message reads: %s\0A\00"
@.str.1 = [25 x i8] c"Message size: %lu bytes\0A\00"
define void @fortune_cooke(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i64 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mainmenu();
int main() {
  while (1)
    mainmenu();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <mainmenu@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mainmenu@plt>
jmp    1120 <main+0x10>

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @mainmenu()
br label %1
}
double Sqrt(x)
double x;
{ return errcheck(sqrt(x), "sqrt"); }


x86 assembly (clang, -O0):
<Sqrt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <sqrt@plt>
lea    0xec2(%rip),%rdi
mov    $0x1,%al
call   1030 <errcheck@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sqrt>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1131 <Sqrt+0x11>
sqrtsd %xmm0,%xmm0
jmp    1136 <Sqrt+0x16>
call   1040 <sqrt@plt>
lea    0xec3(%rip),%rdi
mov    $0x1,%al
call   1030 <errcheck@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sqrt\00"
define double @Sqrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
%5 = call i32 (double, i8*, ...) bitcast (i32 (...)* @errcheck to i32 (double, i8*, ...)*)(double %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = sitofp i32 %5 to double
ret double %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"sqrt\00"
define double @Sqrt(double %0) {
%2 = tail call double @sqrt(double %0)
%3 = tail call i32 (double, i8*, ...) bitcast (i32 (...)* @errcheck to i32 (double, i8*, ...)*)(double %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = sitofp i32 %3 to double
ret double %4
}
double square_double(double x) { return x * x; }


x86 assembly (clang, -O0):
<square_double>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<square_double>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @square_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @square_double(double %0) {
%2 = fmul double %0, %0
ret double %2
}
char *ft_str_tolower(char *str) {
  char *res;
  res = str;
  while (*str) {
    if (*str <= 'Z' && *str >= 'A')
      *str += 32;
    str++;
  }
  return (res);
}


x86 assembly (clang, -O0):
<ft_str_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115a <ft_str_tolower+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     1149 <ft_str_tolower+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     1149 <ft_str_tolower+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <ft_str_tolower+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_str_tolower>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ft_str_tolower+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <ft_str_tolower+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <ft_str_tolower+0x2c>
lea    -0x41(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <ft_str_tolower+0x10>
add    $0x20,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <ft_str_tolower+0x10>
ret

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

LLVM IR (-O2):
define i8* @ft_str_tolower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
void csi_cache_enable_profile(void) { ; }


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

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

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

LLVM IR (-O2):
define void @csi_cache_enable_profile() {
ret void
}
/* Type definitions */
typedef int uint16_t;
struct p4_action {
  int dummy;
};

/* Variables and functions */
struct p4_action *unpack_p4_action(char *buffer, uint16_t offset) {
  return (struct p4_action *)(buffer + offset);
}


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

x86 assembly (clang, -O2):
<unpack_p4_action>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.p4_action = type { i32 }
define %struct.p4_action* @unpack_p4_action(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.p4_action*
ret %struct.p4_action* %9
}

LLVM IR (-O2):
%struct.p4_action = type { i32 }
define %struct.p4_action* @unpack_p4_action(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.p4_action*
ret %struct.p4_action* %5
}
double test4(double x) {
  double s;
  x = x * 2;
  s = __builtin_sin(x);
  return s;
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sin@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
addsd  %xmm0,%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @test4(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double %4, 2.000000e+00
store double %5, double* %2
%6 = load double, double* %2
%7 = call double @sin(double %6)
store double %7, double* %3
%8 = load double, double* %3
ret double %8
}

LLVM IR (-O2):
define double @test4(double %0) {
%2 = fmul double %0, 2.000000e+00
%3 = tail call double @sin(double %2)
ret double %3
}
void VMR3ReqCallVoidWaitU(void) {}


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

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

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

LLVM IR (-O2):
define void @VMR3ReqCallVoidWaitU() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print(int);
int main() {
  print(-300532101);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xee163e7b,%edi
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print(i32 -300532101)
ret i32 0
}
/* Variables and functions */
size_t strspn(char const *, char const *);
size_t c_strspn(const char *s, const char *accept) { return strspn(s, accept); }


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

x86 assembly (clang, -O2):
<c_strspn>:
jmp    1030 <strspn@plt>

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

LLVM IR (-O2):
define i64 @c_strspn(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strspn(i8* %0, i8* %1)
ret i64 %3
}
char *concat(char *s1, char *s2) {}


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

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

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

LLVM IR (-O2):
define noalias i8* @concat(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i8* undef
}
void g_hook_list_invoke() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int readlink(char *, char *, int);
void show_link(char *name) {
  int count;
  char lname[1024];
  count = readlink(name, lname, sizeof(lname) - 1);
  if (count > 0) {
    lname[count] = 0;
    printf(" -> %s", lname);
  }
}


x86 assembly (clang, -O0):
<show_link>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x410(%rbp),%rsi
mov    $0x3ff,%edx
call   1030 <readlink@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1170 <show_link+0x50>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x410(%rbp,%rax,1)
lea    -0x410(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_link>:
sub    $0x408,%rsp
mov    %rsp,%rsi
mov    $0x3ff,%edx
call   1030 <readlink@plt>
test   %eax,%eax
jle    114d <show_link+0x2d>
mov    %eax,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xebb(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
add    $0x408,%rsp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" -> %s\00"
define void @show_link(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [1024 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%7 = call i32 @readlink(i8* %5, i8* %6, i32 1023)
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %12
store i8 0, i8* %13
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %10, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c" -> %s\00"
define void @show_link(i8* nocapture %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @readlink(i8* %0, i8* %3, i32 1023)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = zext i32 %4 to i64
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 %7
store i8 0, i8* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %10
10: ; preds = %6, %1
ret void
}
/* Variables and functions */
char tolower(char);
void str_lower(char *str) {
  while (*str) {
    *str = tolower(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<str_lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <str_lower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <str_lower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_lower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <str_lower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <str_lower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @str_lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
char input();
comment2() {
  char c;
  while ((c = input()) != '\n' && c != 0)
    ;
}


x86 assembly (clang, -O0):
<comment2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <input@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x6(%rbp)
je     1140 <comment2+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    1150 <comment2+0x40>
jmp    1155 <comment2+0x45>
jmp    1118 <comment2+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comment2>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <input@plt>
cmp    $0xa,%al
je     112f <comment2+0x1f>
test   %al,%al
jne    1120 <comment2+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @comment2() {
%1 = alloca i32
%2 = alloca i8
br label %3
3: ; preds = %13, %0
%4 = call signext i8 (...) @input()
store i8 %4, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br label %11
11: ; preds = %7, %3
%12 = phi i1 [ false, %3 ], [ %10, %7 ]
br i1 %12, label %13, label %14
13: ; preds = %11
br label %3
14: ; preds = %11
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @comment2() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @input()
switch i8 %2, label %1 [
i8 10, label %3
i8 0, label %3
]
3: ; preds = %1, %1
ret i32 undef
}
/* Variables and functions */
char *strrchr(char *, char);
char *shortClientName(char *s) {
  char *result = strrchr(s, '/');
  return ((result == NULL) ? s : result + 1);
}


x86 assembly (clang, -O0):
<shortClientName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <shortClientName+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <shortClientName+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shortClientName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @shortClientName(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 1
br label %13
13: ; preds = %10, %8
%14 = phi i8* [ %9, %8 ], [ %12, %10 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @shortClientName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: side_clock [-b n][-d][-l n][-t]\n");
  printf("   -b : set brightness 0-15\n");
  printf("   -d : Don't daemonize (remain in foreground)\n");
  printf("   -l : Longitude east (negative for west). Default is 0.\n");
  printf("   -t : turn tenth of a second digit off\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xf36(%rip),%rdi
call   1030 <puts@plt>
lea    0xf64(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: side_clock [-b n][-d][-l n][-t]\0A\00"
@.str.1 = [29 x i8] c" -b : set brightness 0-15\0A\00"
@.str.2 = [48 x i8] c" -d : Don't daemonize (remain in foreground)\0A\00"
@.str.3 = [59 x i8] c" -l : Longitude east (negative for west). Default is 0.\0A\00"
@.str.4 = [42 x i8] c" -t : turn tenth of a second digit off\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [39 x i8] c"Usage: side_clock [-b n][-d][-l n][-t]\00"
@str.5 = [28 x i8] c" -b : set brightness 0-15\00"
@str.6 = [47 x i8] c" -d : Don't daemonize (remain in foreground)\00"
@str.7 = [58 x i8] c" -l : Longitude east (negative for west). Default is 0.\00"
@str.8 = [41 x i8] c" -t : turn tenth of a second digit off\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.5, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.6, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.7, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.8, i64 0, i64 0))
ret void
}
int drivers_test_func() { return 3 * 3; }


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

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

LLVM IR (-O0):
define i32 @drivers_test_func() {
ret i32 9
}

LLVM IR (-O2):
define i32 @drivers_test_func() {
ret i32 9
}
void FMSTR_InitTsa(void) {}


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

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

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

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

/* Variables and functions */
int EOF;
int /*<<< orphan*/ die(char *);
int fgetc(int /*<<< orphan*/ *);
int ungetc(int, int /*<<< orphan*/ *);
int fpeek(FILE *stream) {
  int c = fgetc(stream);
  if (ungetc(c, stream) == EOF && c != EOF)
    die("Stream error");
  return c;
}


x86 assembly (clang, -O0):
<fpeek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1040 <ungetc@plt>
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%eax
jne    1181 <fpeek+0x51>
mov    -0xc(%rbp),%eax
mov    0x2e7b(%rip),%rcx
cmp    (%rcx),%eax
je     1181 <fpeek+0x51>
lea    0xe84(%rip),%rdi
call   1050 <die@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpeek>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <fgetc@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
call   1040 <ungetc@plt>
mov    0x2e9a(%rip),%rcx
mov    (%rcx),%ecx
cmp    %ecx,%eax
jne    1164 <fpeek+0x34>
cmp    %ecx,%ebp
je     1164 <fpeek+0x34>
lea    0xea1(%rip),%rdi
call   1050 <die@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [13 x i8] c"Stream error\00"
define i32 @fpeek(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fgetc(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = load i32*, i32** %2
%8 = call i32 @ungetc(i32 %6, i32* %7)
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %17
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* @EOF
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %11, %1
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [13 x i8] c"Stream error\00"
define i32 @fpeek(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
%3 = tail call i32 @ungetc(i32 %2, i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp eq i32 %2, %4
%7 = or i1 %5, %6
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = tail call i32 @die(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ libvlc_clock();
int64_t libvlc_delay(int64_t pts) { return pts - libvlc_clock(); }


x86 assembly (clang, -O0):
<libvlc_delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <libvlc_clock@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<libvlc_delay>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <libvlc_clock@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @libvlc_delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 (...) @libvlc_clock()
%5 = sub nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @libvlc_delay(i64 %0) {
%2 = tail call i64 (...) @libvlc_clock()
%3 = sub nsw i64 %0, %2
ret i64 %3
}
/* Variables and functions */
int plan9_main(int, char **);
int main(int argc, char **argv) { return plan9_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <plan9_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @plan9_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
unsigned long LONG_MAX;
int /*<<< orphan*/ emulateDivMod(unsigned long, unsigned long, long *, long *);
int /*<<< orphan*/ printf(char *, unsigned long, unsigned long, long, long);
void testEmulateDivMod() {
  unsigned long a = LONG_MAX, b = 32;
  long q = 0, r = 0;
  emulateDivMod(a, b, &q, &r);
  printf("%lu / %lu: quotient = %ld, remainder = %ld\n", a, b, q, r);
}


x86 assembly (clang, -O0):
<testEmulateDivMod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
movq   $0x20,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <emulateDivMod@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testEmulateDivMod>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eb4(%rip),%rax
mov    (%rax),%rbx
movq   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
mov    $0x20,%esi
mov    %rbx,%rdi
call   1040 <emulateDivMod@plt>
mov    0x8(%rsp),%rcx
mov    (%rsp),%r8
lea    0xe9b(%rip),%rdi
mov    $0x20,%edx
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@LONG_MAX = global i64 0
@.str = [44 x i8] c"%lu / %lu: quotient = %ld, remainder = %ld\0A\00"
define void @testEmulateDivMod() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = load i64, i64* @LONG_MAX
store i64 %5, i64* %1
store i64 32, i64* %2
store i64 0, i64* %3
store i64 0, i64* %4
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = call i32 @emulateDivMod(i64 %6, i64 %7, i64* %3, i64* %4)
%9 = load i64, i64* %1
%10 = load i64, i64* %2
%11 = load i64, i64* %3
%12 = load i64, i64* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %9, i64 %10, i64 %11, i64 %12)
ret void
}

LLVM IR (-O2):
@LONG_MAX = global i64 0
@.str = [44 x i8] c"%lu / %lu: quotient = %ld, remainder = %ld\0A\00"
define void @testEmulateDivMod() {
%1 = alloca i64
%2 = alloca i64
%3 = load i64, i64* @LONG_MAX
%4 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%5 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%6 = call i32 @emulateDivMod(i64 %3, i64 32, i64* %1, i64* %2)
%7 = load i64, i64* %1
%8 = load i64, i64* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %3, i64 32, i64 %7, i64 %8)
ret void
}
/* Variables and functions */
double floor(double);
int iswholeDouble_separator(const void *arg) {
  double *tmp;
  tmp = (double *)arg;
  if (floor(*tmp) == *tmp) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<iswholeDouble_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <floor@plt>
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    1151 <iswholeDouble_separator+0x41>
jp     1151 <iswholeDouble_separator+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1158 <iswholeDouble_separator+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswholeDouble_separator>:
push   %rax
movsd  (%rdi),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <floor@plt>
cmpeqsd (%rsp),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @iswholeDouble_separator(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca double*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to double*
store double* %6, double** %4
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = call double @llvm.floor.f64(double %8)
%10 = load double*, double** %4
%11 = load double, double* %10
%12 = fcmp oeq double %9, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %2
br label %15
14: ; preds = %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @iswholeDouble_separator(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fcmp oeq double %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}