xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_info(int amount, int balance) {
  printf("Withdrawing\n");
  printf("Successfully withdrew %d dollars.\n", amount);
  printf("New balance %d dollars.\n", balance);
}


x86 assembly (clang, -O0):
<print_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xee9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xec6(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Withdrawing\0A\00"
@.str.1 = [35 x i8] c"Successfully withdrew %d dollars.\0A\00"
@.str.2 = [25 x i8] c"New balance %d dollars.\0A\00"
define void @print_info(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"Successfully withdrew %d dollars.\0A\00"
@.str.2 = [25 x i8] c"New balance %d dollars.\0A\00"
@str = [12 x i8] c"Withdrawing\00"
define void @print_info(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 %0)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_word(unsigned int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int scan_hexnum(unsigned int *);
void read_ioreg() {
  unsigned int *p;
  if (scan_hexnum((unsigned *)&p) == 0x0) {
    print_word((unsigned)p);
    putchar(':');
    print_word(*p);
  } else
    puts("Invalid arguments\r\n");
}


x86 assembly (clang, -O0):
<read_ioreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1060 <scan_hexnum@plt>
cmp    $0x0,%eax
jne    117f <read_ioreg+0x3f>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1050 <print_word@plt>
mov    $0x3a,%edi
call   1030 <putchar@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1050 <print_word@plt>
jmp    118b <read_ioreg+0x4b>
lea    0xe7a(%rip),%rdi
call   1040 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ioreg>:
push   %rax
mov    %rsp,%rdi
call   1060 <scan_hexnum@plt>
test   %eax,%eax
je     115b <read_ioreg+0x1b>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
pop    %rax
ret
mov    (%rsp),%edi
call   1050 <print_word@plt>
mov    $0x3a,%edi
call   1030 <putchar@plt>
mov    (%rsp),%rax
mov    (%rax),%edi
call   1050 <print_word@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Invalid arguments\0D\0A\00"
define void @read_ioreg() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i32*
%3 = call i32 @scan_hexnum(i32* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = ptrtoint i32* %6 to i32
%8 = call i32 @print_word(i32 %7)
%9 = call i32 @putchar(i8 signext 58)
%10 = load i32*, i32** %1
%11 = load i32, i32* %10
%12 = call i32 @print_word(i32 %11)
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %5
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Invalid arguments\0D\0A\00"
define void @read_ioreg() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = bitcast i32** %1 to i32*
%4 = call i32 @scan_hexnum(i32* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = ptrtoint i32* %7 to i64
%9 = trunc i64 %8 to i32
%10 = call i32 @print_word(i32 %9)
%11 = call i32 @putchar(i8 signext 58)
%12 = load i32*, i32** %1
%13 = load i32, i32* %12
%14 = call i32 @print_word(i32 %13)
br label %17
15: ; preds = %0
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %15, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_backtrace(int);
void *time__Tm__localtime_from_timet(void *self, void *p0) {
  void *var;
  printf("NOT YET IMPLEMENTED nitni for time#Tm#localtime_from_timet at "
         "lib/standard/time.nit:70,2--74,3\n");
  show_backtrace(1);
RET_LABEL:;
  return var;
}


x86 assembly (clang, -O0):
<time__Tm__localtime_from_timet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <show_backtrace@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [96 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#localtime_from_timet at lib/standard/time.nit:70,2--74,3\0A\00"
define i8* @time__Tm__localtime_from_timet(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @show_backtrace(i32 1)
br label %8
8: ; preds = %2
%9 = load i8*, i8** %5
ret i8* %9
}

LLVM IR (-O2):
@str = [95 x i8] c"NOT YET IMPLEMENTED nitni for time#Tm#localtime_from_timet at lib/standard/time.nit:70,2--74,3\00"
define noalias i8* @time__Tm__localtime_from_timet(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @show_backtrace(i32 1)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __aeabi_memcpy(void *restrict dest, const void *restrict src, size_t n) {
  memcpy(dest, src, n);
}


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

x86 assembly (clang, -O2):
<__aeabi_memcpy>:
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @__aeabi_memcpy(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __getmainargs(int *, char ***, char ***, int /*<<< orphan*/,
                                 int *);
int /*<<< orphan*/ exit(int);
int main(int, char **, char **);
void _entry() {
  int argc;
  char **argv;
  char **env;
  int ret;
  int start_info = 0;
  __getmainargs(&argc, &argv, &env, 0, &start_info);
  ret = main(argc, argv, env);
  exit(ret);
}


x86 assembly (clang, -O0):
<_entry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x20(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
xor    %ecx,%ecx
lea    -0x20(%rbp),%r8
call   1050 <__getmainargs@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_entry>:
sub    $0x18,%rsp
movl   $0x0,(%rsp)
lea    0x4(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%r8
xor    %ecx,%ecx
call   1050 <__getmainargs@plt>
mov    0x4(%rsp),%edi
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rdx
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @_entry() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %5
%6 = call i32 @__getmainargs(i32* %1, i8*** %2, i8*** %3, i32 0, i32* %5)
%7 = load i32, i32* %1
%8 = load i8**, i8*** %2
%9 = load i8**, i8*** %3
%10 = call i32 @main(i32 %7, i8** %8, i8** %9)
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 @exit(i32 %11)
unreachable
}

LLVM IR (-O2):
define void @_entry() {
%1 = alloca i32
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i8*** %2 to i8*
%7 = bitcast i8*** %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = call i32 @__getmainargs(i32* %1, i8*** %2, i8*** %3, i32 0, i32* %4)
%10 = load i32, i32* %1
%11 = load i8**, i8*** %2
%12 = load i8**, i8*** %3
%13 = call i32 @main(i32 %10, i8** %11, i8** %12)
%14 = call i32 @exit(i32 %13)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wm_1_setter(int);
int init_wasm(int n) {
  const int max = 1000000;
  if (n > max) {
    n = max;
    fprintf(stderr, "Asking for too much, mul.wast only allows 1M elements, "
                    "setting to 1M\n");
  }
  wm_1_setter(n);
  return 1;
}


x86 assembly (clang, -O0):
<init_wasm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xf4240,-0x8(%rbp)
cmpl   $0xf4240,-0x4(%rbp)
jle    115b <init_wasm+0x3b>
movl   $0xf4240,-0x4(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeaa(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1040 <wm_1_setter@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_wasm>:
push   %rax
cmp    $0xf4241,%edi
jl     1143 <init_wasm+0x23>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xf4240,%edi
call   1040 <wm_1_setter@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Asking for too much, mul.wast only allows 1M elements, setting to 1M\0A\00"
define i32 @init_wasm(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1000000, i32* %3
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 1000000
br i1 %5, label %6, label %9
6: ; preds = %1
store i32 1000000, i32* %2
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %1
%10 = load i32, i32* %2
%11 = call i32 @wm_1_setter(i32 %10)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Asking for too much, mul.wast only allows 1M elements, setting to 1M\0A\00"
define i32 @init_wasm(i32 %0) {
%2 = icmp sgt i32 %0, 1000000
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %3, %1
%7 = phi i32 [ 1000000, %3 ], [ %0, %1 ]
%8 = tail call i32 @wm_1_setter(i32 %7)
ret i32 1
}
int omap_mux_init_signal(char *muxname, int val) { return 0; }


x86 assembly (clang, -O0):
<omap_mux_init_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @omap_mux_init_signal(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @omap_mux_init_signal(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int op_log(char *operand, char **filename) {
  printf("%s\n", *filename);
  return 1;
}


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

x86 assembly (clang, -O2):
<op_log>:
push   %rax
mov    (%rsi),%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @op_log(i8* nocapture readnone %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int getpid();
int getuid();
int /*<<< orphan*/ print_variables(char **, int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("UID: %d\n", getuid());
  printf("PID: %d\n", getpid());
  print_variables(argv, argc);
  exit(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)
mov    $0x0,%al
call   1050 <getuid@plt>
mov    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1060 <printf@plt>
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <print_variables@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1050 <getuid@plt>
lea    0xe9a(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
xor    %eax,%eax
call   1040 <getpid@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <print_variables@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"UID: %d\0A\00"
@.str.1 = [9 x i8] c"PID: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getuid()
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @getpid()
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load i8**, i8*** %5
%11 = load i32, i32* %4
%12 = call i32 @print_variables(i8** %10, i32 %11)
%13 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [9 x i8] c"UID: %d\0A\00"
@.str.1 = [9 x i8] c"PID: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @print_variables(i8** %1, i32 %0)
%8 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *);
void PAbt_Routine(void) { kprintf("PAbt!\n"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"PAbt!\0A\00"
define void @PAbt_Routine() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gpio_clr(int);
int /*<<< orphan*/ gpio_set(int);
int /*<<< orphan*/ reg_data(short);
int /*<<< orphan*/ usleep(int);
void LCD_command(short command) {
  reg_data(command);
  gpio_set(1 << 18);
  gpio_clr(1 << 23);
  usleep(1);
  gpio_set(1 << 23);
}


x86 assembly (clang, -O0):
<LCD_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1050 <reg_data@plt>
mov    $0x40000,%edi
call   1040 <gpio_set@plt>
mov    $0x800000,%edi
call   1030 <gpio_clr@plt>
mov    $0x1,%edi
call   1060 <usleep@plt>
mov    $0x800000,%edi
call   1040 <gpio_set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_command>:
push   %rax
call   1050 <reg_data@plt>
mov    $0x40000,%edi
call   1040 <gpio_set@plt>
mov    $0x800000,%edi
call   1030 <gpio_clr@plt>
mov    $0x1,%edi
call   1060 <usleep@plt>
mov    $0x800000,%edi
pop    %rax
jmp    1040 <gpio_set@plt>

LLVM IR (-O0):
define void @LCD_command(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @reg_data(i16 signext %3)
%5 = call i32 @gpio_set(i32 262144)
%6 = call i32 @gpio_clr(i32 8388608)
%7 = call i32 @usleep(i32 1)
%8 = call i32 @gpio_set(i32 8388608)
ret void
}

LLVM IR (-O2):
define void @LCD_command(i16 signext %0) {
%2 = tail call i32 @reg_data(i16 signext %0)
%3 = tail call i32 @gpio_set(i32 262144)
%4 = tail call i32 @gpio_clr(i32 8388608)
%5 = tail call i32 @usleep(i32 1)
%6 = tail call i32 @gpio_set(i32 8388608)
ret void
}
double Wave(double x) {
  return (x * x * x * x - x * x + 2 * x * x * x - 2 * x * x * x * x * x) / 0.14;
}


x86 assembly (clang, -O0):
<Wave>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xe9b(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xe53(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Wave>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
subsd  %xmm2,%xmm1
movapd %xmm0,%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
divsd  0xec0(%rip),%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Wave(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
%6 = load double, double* %2
%7 = fmul double %5, %6
%8 = load double, double* %2
%9 = load double, double* %2
%10 = load double, double* %2
%11 = fmul double %9, %10
%12 = fneg double %11
%13 = call double @llvm.fmuladd.f64(double %7, double %8, double %12)
%14 = load double, double* %2
%15 = fmul double 2.000000e+00, %14
%16 = load double, double* %2
%17 = fmul double %15, %16
%18 = load double, double* %2
%19 = call double @llvm.fmuladd.f64(double %17, double %18, double %13)
%20 = load double, double* %2
%21 = fmul double 2.000000e+00, %20
%22 = load double, double* %2
%23 = fmul double %21, %22
%24 = load double, double* %2
%25 = fmul double %23, %24
%26 = load double, double* %2
%27 = fmul double %25, %26
%28 = load double, double* %2
%29 = fneg double %27
%30 = call double @llvm.fmuladd.f64(double %29, double %28, double %19)
%31 = fdiv double %30, 1.400000e-01
ret double %31
}

LLVM IR (-O2):
define double @Wave(double %0) {
%2 = fmul double %0, %0
%3 = fmul double %2, %0
%4 = fneg double %2
%5 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %4)
%6 = fmul double %0, 2.000000e+00
%7 = fmul double %6, %0
%8 = tail call double @llvm.fmuladd.f64(double %7, double %0, double %5)
%9 = fneg double %7
%10 = fmul double %9, %0
%11 = fmul double %10, %0
%12 = tail call double @llvm.fmuladd.f64(double %11, double %0, double %8)
%13 = fdiv double %12, 1.400000e-01
ret double %13
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
char *asctime_r(struct tm const *, char *);
char *asctime(const struct tm *t) {
  static char cbuf[30];
  return asctime_r(t, cbuf);
}


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

x86 assembly (clang, -O2):
<asctime>:
lea    0x2f29(%rip),%rsi
jmp    1030 <asctime_r@plt>

LLVM IR (-O0):
%struct.tm = type { i32 }
@asctime.cbuf = internal global [30 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = alloca %struct.tm*
store %struct.tm* %0, %struct.tm** %2
%3 = load %struct.tm*, %struct.tm** %2
%4 = call i8* @asctime_r(%struct.tm* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @asctime.cbuf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@asctime.cbuf = internal global [30 x i8] zeroinitializer
define i8* @asctime(%struct.tm* %0) {
%2 = tail call i8* @asctime_r(%struct.tm* %0, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @asctime.cbuf, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int nombreAleatoire(int nombreMax) {
  int nb1, nb2, nbr;
  srand(time(NULL));
  do {
    nb1 = (rand() % nombreMax);
    nb2 = (rand() % nombreMax);
    nbr = nb1 * nb2;
  } while (nbr > nombreMax);
  return nbr;
}


x86 assembly (clang, -O0):
<nombreAleatoire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x8(%rbp)
mov    $0x0,%al
call   1050 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     114b <nombreAleatoire+0x1b>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nombreAleatoire>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%ebp
xor    %eax,%eax
call   1050 <rand@plt>
cltd
idiv   %ebx
imul   %ebp,%edx
cmp    %ebx,%edx
jg     1150 <nombreAleatoire+0x20>
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @nombreAleatoire(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
br label %8
8: ; preds = %18, %1
%9 = call i32 (...) @rand()
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
store i32 %11, i32* %3
%12 = call i32 (...) @rand()
%13 = load i32, i32* %2
%14 = srem i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 %15, %16
store i32 %17, i32* %5
br label %18
18: ; preds = %8
%19 = load i32, i32* %5
%20 = load i32, i32* %2
%21 = icmp sgt i32 %19, %20
br i1 %21, label %8, label %22
22: ; preds = %18
%23 = load i32, i32* %5
ret i32 %23
}

LLVM IR (-O2):
define i32 @nombreAleatoire(i32 %0) {
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
br label %4
4: ; preds = %4, %1
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, %0
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, %0
%9 = mul nsw i32 %8, %6
%10 = icmp sgt i32 %9, %0
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %9
}
/* Variables and functions */
size_t json_parse_string(char const *);
bool json_is_string(const char *str) {
  size_t len;
  len = json_parse_string(str);
  if (!len || str[len] != '\0')
    return false;
  return true;
}


x86 assembly (clang, -O0):
<json_is_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <json_parse_string@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1149 <json_is_string+0x39>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1155 <json_is_string+0x45>
movl   $0x0,-0x4(%rbp)
jmp    115c <json_is_string+0x4c>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_is_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <json_parse_string@plt>
test   %rax,%rax
je     112c <json_is_string+0x1c>
mov    %rax,%rcx
xor    %eax,%eax
cmpb   $0x0,(%rbx,%rcx,1)
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @json_is_string(i8* %0) {
%2 = tail call i64 @json_parse_string(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t build_instr(int opcode, int operand) {
  unsigned int instr = 0;
  instr = instr | (opcode << 12);
  instr = instr | operand;
  return (int16_t)instr;
}


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

x86 assembly (clang, -O2):
<build_instr>:
mov    %edi,%eax
shl    $0xc,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @build_instr(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
%6 = load i32, i32* %5
%7 = load i32, i32* %3
%8 = shl i32 %7, 12
%9 = or i32 %6, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = or i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @build_instr(i32 %0, i32 %1) {
%3 = shl i32 %0, 12
%4 = or i32 %3, %1
ret i32 %4
}
/* Variables and functions */
scalar_t__ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ error(int, int /*<<< orphan*/, char *);
void nflog_exit(int fd) {
  if (close(fd))
    error(1, errno, "close");
}


x86 assembly (clang, -O0):
<nflog_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
je     1157 <nflog_exit+0x37>
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edi
lea    0xeae(%rip),%rdx
call   1040 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nflog_exit>:
push   %rax
call   1030 <close@plt>
test   %rax,%rax
je     1146 <nflog_exit+0x26>
mov    0x2eae(%rip),%rax
mov    (%rax),%esi
lea    0xec5(%rip),%rdx
mov    $0x1,%edi
pop    %rax
jmp    1040 <error@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@errno = global i32 0
@.str = [6 x i8] c"close\00"
define void @nflog_exit(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = load i32, i32* @errno
%6 = tail call i32 @error(i32 1, i32 %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ malloc(int /*<<< orphan*/);
int main() {
  char *str;
  str = (char *)malloc(0);
  if (str == NULL) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1141 <main+0x31>
movl   $0x0,-0x4(%rbp)
jmp    1148 <main+0x38>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 0)
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int atoi(char *);
int my_atoi(char *s) {
  if (!s)
    return -1;
  return atoi(s);
}


x86 assembly (clang, -O0):
<my_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <my_atoi+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    113f <my_atoi+0x2f>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_atoi>:
test   %rdi,%rdi
je     111a <my_atoi+0xa>
jmp    1030 <atoi@plt>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @my_atoi(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @atoi(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
int test_imm_68int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x68 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_68int64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x20,%rdx
and    $0x68,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_68int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 446676598784
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *vohttpd_gmtime() {
  static char out[32];
  time_t t;
  struct tm *pt;
  t = time(NULL);
  pt = gmtime(&t);
  strftime(out, 32, "%a, %d %b %Y %H:%M:%S GMT", pt);
  return out;
}


x86 assembly (clang, -O0):
<vohttpd_gmtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1030 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1050 <gmtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2ef4(%rip),%rdi
mov    $0x20,%esi
lea    0xe98(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2edc(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vohttpd_gmtime>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1050 <gmtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x20,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@vohttpd_gmtime.out = internal global [32 x i8] zeroinitializer
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define i8* @vohttpd_gmtime() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @gmtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @vohttpd_gmtime.out, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @vohttpd_gmtime.out, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@vohttpd_gmtime.out = internal global [32 x i8] zeroinitializer
@.str = [26 x i8] c"%a, %d %b %Y %H:%M:%S GMT\00"
define i8* @vohttpd_gmtime() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @gmtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @vohttpd_gmtime.out, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @vohttpd_gmtime.out, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello, C."); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"Hello, C.\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ debug_puthex(int /*<<< orphan*/ const);
int /*<<< orphan*/ debug_puts(char *);
void print_buf(const uint8_t *data, unsigned int count) {
  for (unsigned int i = 0; i < count; i++) {
    debug_puthex(data[i]);
    debug_puts(":");
  }
}


x86 assembly (clang, -O0):
<print_buf>:
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
jae    116b <print_buf+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
call   1040 <debug_puthex@plt>
lea    0xea8(%rip),%rdi
call   1030 <debug_puts@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print_buf+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
je     115a <print_buf+0x3a>
mov    %rdi,%r15
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xec5(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%edi
call   1040 <debug_puthex@plt>
mov    %r14,%rdi
call   1030 <debug_puts@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_buf+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
define void @print_buf(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 = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @debug_puthex(i32 %15)
%17 = call i32 @debug_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
define void @print_buf(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
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 ], [ %13, %7 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 @debug_puthex(i32 %10)
%12 = tail call i32 @debug_puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ endmntent(int /*<<< orphan*/ *);
void sc_cleanup_endmntent(FILE **ptr) {
  if (ptr != NULL && *ptr != NULL) {
    endmntent(*ptr);
  }
}


x86 assembly (clang, -O0):
<sc_cleanup_endmntent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1141 <sc_cleanup_endmntent+0x31>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1141 <sc_cleanup_endmntent+0x31>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <endmntent@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sc_cleanup_endmntent>:
test   %rdi,%rdi
je     1122 <sc_cleanup_endmntent+0x12>
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1122 <sc_cleanup_endmntent+0x12>
jmp    1030 <endmntent@plt>
ret

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

LLVM IR (-O2):
define void @sc_cleanup_endmntent(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @endmntent(i32* %4)
br label %8
8: ; preds = %6, %3, %1
ret void
}
double pid_Limit(double value, double min, double max) {
  if (value > max)
    return max;
  if (value < min)
    return min;
  return value;
}


x86 assembly (clang, -O0):
<pid_Limit>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1132 <pid_Limit+0x32>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <pid_Limit+0x5f>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1155 <pid_Limit+0x55>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115f <pid_Limit+0x5f>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pid_Limit>:
maxsd  %xmm0,%xmm1
movapd %xmm2,%xmm3
cmpltsd %xmm0,%xmm3
movapd %xmm3,%xmm0
andnpd %xmm1,%xmm0
andpd  %xmm2,%xmm3
orpd   %xmm0,%xmm3
movapd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @pid_Limit(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %7
%10 = fcmp ogt double %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load double, double* %7
store double %12, double* %4
br label %21
13: ; preds = %3
%14 = load double, double* %5
%15 = load double, double* %6
%16 = fcmp olt double %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load double, double* %6
store double %18, double* %4
br label %21
19: ; preds = %13
%20 = load double, double* %5
store double %20, double* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load double, double* %4
ret double %22
}

LLVM IR (-O2):
define double @pid_Limit(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %2
%5 = fcmp olt double %0, %1
%6 = select i1 %5, double %1, double %0
%7 = select i1 %4, double %2, double %6
ret double %7
}
int bump_up(int input) {
  if ((input & 1) == 1) {
    input++;
  }
  return input;
}


x86 assembly (clang, -O0):
<bump_up>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x1,%eax
jne    111f <bump_up+0x1f>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bump_up>:
mov    %edi,%eax
and    $0x1,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @bump_up(i32 %0) {
%2 = and i32 %0, 1
%3 = add nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
long atoi(char *);
long oatoi(char *str, long def) {
  if (str == (char *)NULL)
    return (def);
  else
    return (atoi(str));
}


x86 assembly (clang, -O0):
<oatoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1138 <oatoi+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1145 <oatoi+0x35>
mov    -0x10(%rbp),%rdi
call   1030 <atoi@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oatoi>:
test   %rdi,%rdi
je     111a <oatoi+0xa>
jmp    1030 <atoi@plt>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @oatoi(i8* %0, i64 %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i64 @atoi(i8* %0)
br label %6
6: ; preds = %2, %4
%7 = phi i64 [ %5, %4 ], [ %1, %2 ]
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void printusage_converter(char *program) {
  printf("Usage : %s input_patternfile(txt) output_patternfile(binary)\n\n",
         program);
}


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

x86 assembly (clang, -O2):
<printusage_converter>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [63 x i8] c"Usage : %s input_patternfile(txt) output_patternfile(binary)\0A\0A\00"
define void @printusage_converter(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [63 x i8] c"Usage : %s input_patternfile(txt) output_patternfile(binary)\0A\0A\00"
define void @printusage_converter(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
struct symbol_expr {
  int dummy;
};
struct object {
  int dummy;
};
struct expr {
  int dummy;
};

/* Variables and functions */
struct object *object_new(int /*<<< orphan*/);
int /*<<< orphan*/ symbol_class_get();
int /*<<< orphan*/ symbol_expr_init(struct symbol_expr *, char const *);
struct expr *symbol_new(const char *name) {
  struct object *expr = object_new(symbol_class_get());
  symbol_expr_init(((struct symbol_expr *)(expr)), name);
  return ((struct expr *)(expr));
}


x86 assembly (clang, -O0):
<symbol_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <symbol_class_get@plt>
mov    %eax,%edi
call   1030 <object_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1050 <symbol_expr_init@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbol_new>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1040 <symbol_class_get@plt>
mov    %eax,%edi
call   1030 <object_new@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1050 <symbol_expr_init@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.symbol_expr = type { i32 }
define %struct.expr* @symbol_new(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.object*
store i8* %0, i8** %2
%4 = call i32 (...) @symbol_class_get()
%5 = call %struct.object* @object_new(i32 %4)
store %struct.object* %5, %struct.object** %3
%6 = load %struct.object*, %struct.object** %3
%7 = bitcast %struct.object* %6 to %struct.symbol_expr*
%8 = load i8*, i8** %2
%9 = call i32 @symbol_expr_init(%struct.symbol_expr* %7, i8* %8)
%10 = load %struct.object*, %struct.object** %3
%11 = bitcast %struct.object* %10 to %struct.expr*
ret %struct.expr* %11
}

LLVM IR (-O2):
%struct.expr = type { i32 }
%struct.object = type { i32 }
%struct.symbol_expr = type { i32 }
define %struct.expr* @symbol_new(i8* %0) {
%2 = tail call i32 (...) @symbol_class_get()
%3 = tail call %struct.object* @object_new(i32 %2)
%4 = bitcast %struct.object* %3 to %struct.symbol_expr*
%5 = tail call i32 @symbol_expr_init(%struct.symbol_expr* %4, i8* %0)
%6 = bitcast %struct.object* %3 to %struct.expr*
ret %struct.expr* %6
}