xunge/DecIR huggingface dataset:
void gdk_keyval_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_keyval_name() {
ret void
}
void gtk_rc_property_parse_flags() {}


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

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

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

LLVM IR (-O2):
define void @gtk_rc_property_parse_flags() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putc(int /*<<< orphan*/);
void uputs(const char *str) {
  while (*str)
    putc(*str++);
}


x86 assembly (clang, -O0):
<uputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <uputs+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <putc@plt>
jmp    111c <uputs+0xc>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @uputs(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 %13
7: ; preds = %3
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %2
%10 = load i8, i8* %8
%11 = sext i8 %10 to i32
%12 = call i32 @putc(i32 %11)
br label %3
13: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @uputs(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @putc(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
void signed_char_div_signed_char_signed_int(signed char *LHS, signed int RHS) {
  (*LHS) /= RHS;
}


x86 assembly (clang, -O0):
<signed_char_div_signed_char_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl (%rax),%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_div_signed_char_signed_int>:
movsbl (%rdi),%eax
cltd
idiv   %esi
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_div_signed_char_signed_int(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = sdiv i32 %8, %5
%10 = trunc i32 %9 to i8
store i8 %10, i8* %6
ret void
}

LLVM IR (-O2):
define void @signed_char_div_signed_char_signed_int(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = sdiv i32 %4, %1
%6 = trunc i32 %5 to i8
store i8 %6, i8* %0
ret void
}
int of_property_read_string_index(struct device_node *np, const char *propname,
                                  int index, const char **output) {
  return -38;
}


x86 assembly (clang, -O0):
<of_property_read_string_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffda,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device_node = type opaque
define i32 @of_property_read_string_index(%struct.device_node* %0, i8* %1, i32 %2, i8** %3) {
%5 = alloca %struct.device_node*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8**
store %struct.device_node* %0, %struct.device_node** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
ret i32 -38
}

LLVM IR (-O2):
%struct.device_node = type opaque
define i32 @of_property_read_string_index(%struct.device_node* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i8** nocapture readnone %3) {
ret i32 -38
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int errno;
void socket_close(int sock) {
  int old_errno = errno;
  close(sock);
  errno = old_errno;
}


x86 assembly (clang, -O0):
<socket_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x8(%rbp),%ecx
mov    0x2ea7(%rip),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket_close>:
push   %rbp
push   %rbx
push   %rax
mov    0x2ec6(%rip),%rbx
mov    (%rbx),%ebp
call   1030 <close@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i32 0
define void @socket_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* @errno
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
%7 = load i32, i32* %3
store i32 %7, i32* @errno
ret void
}

LLVM IR (-O2):
@errno = global i32 0
define void @socket_close(i32 %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @close(i32 %0)
store i32 %2, i32* @errno
ret void
}
/* Variables and functions */
int /*<<< orphan*/ STDIN_FILENO;
int /*<<< orphan*/ disableRawMode(int /*<<< orphan*/);
int /*<<< orphan*/ freeHistory();
void linenoiseAtExit(void) {
  disableRawMode(STDIN_FILENO);
  freeHistory();
}


x86 assembly (clang, -O0):
<linenoiseAtExit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1030 <disableRawMode@plt>
mov    $0x0,%al
call   1040 <freeHistory@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<linenoiseAtExit>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <disableRawMode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <freeHistory@plt>

LLVM IR (-O0):
@STDIN_FILENO = global i32 0
define void @linenoiseAtExit() {
%1 = load i32, i32* @STDIN_FILENO
%2 = call i32 @disableRawMode(i32 %1)
%3 = call i32 (...) @freeHistory()
ret void
}

LLVM IR (-O2):
@STDIN_FILENO = global i32 0
define void @linenoiseAtExit() {
%1 = load i32, i32* @STDIN_FILENO
%2 = tail call i32 @disableRawMode(i32 %1)
%3 = tail call i32 (...) @freeHistory()
ret void
}
/* Variables and functions */
double pow(int, double);
double getPrevCenter(double from, int frac) {
  return from / pow(10, 3.0 / (10.0 * frac));
}


x86 assembly (clang, -O0):
<getPrevCenter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xed1(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xebd(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPrevCenter>:
push   %rax
movsd  %xmm0,(%rsp)
cvtsi2sd %edi,%xmm1
mulsd  0xede(%rip),%xmm1
movsd  0xede(%rip),%xmm0
divsd  %xmm1,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @getPrevCenter(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
store double %0, double* %3
store i32 %1, i32* %4
%5 = load double, double* %3
%6 = load i32, i32* %4
%7 = sitofp i32 %6 to double
%8 = fmul double 1.000000e+01, %7
%9 = fdiv double 3.000000e+00, %8
%10 = call double @pow(i32 10, double %9)
%11 = fdiv double %5, %10
ret double %11
}

LLVM IR (-O2):
define double @getPrevCenter(double %0, i32 %1) {
%3 = sitofp i32 %1 to double
%4 = fmul double %3, 1.000000e+01
%5 = fdiv double 3.000000e+00, %4
%6 = tail call double @pow(i32 10, double %5)
%7 = fdiv double %0, %6
ret double %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void CloseFile(FILE **f) {
  if (*f == NULL) {
    fprintf(stderr, "ERROR: tried to close NULL file\n");
    return;
  }
  fclose(*f);
  *f = NULL;
}


x86 assembly (clang, -O0):
<CloseFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1154 <CloseFile+0x34>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
call   1040 <fprintf@plt>
jmp    116b <CloseFile+0x4b>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <fclose@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CloseFile>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     113a <CloseFile+0x1a>
call   1030 <fclose@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR: tried to close NULL file\0A\00"
define void @CloseFile(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = load i32**, i32*** %2
%4 = load i32*, i32** %3
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %14
9: ; preds = %1
%10 = load i32**, i32*** %2
%11 = load i32*, i32** %10
%12 = call i32 @fclose(i32* %11)
%13 = load i32**, i32*** %2
store i32* null, i32** %13
br label %14
14: ; preds = %9, %6
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [33 x i8] c"ERROR: tried to close NULL file\0A\00"
define void @CloseFile(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = tail call i32 @fclose(i32* %2)
store i32* null, i32** %0
br label %9
9: ; preds = %7, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ out_html(char *);
int /*<<< orphan*/ outputPageHeader(char *, char *, char *);
void outputPageFooter(char *l, char *c, char *r) {
  out_html("<HR>\n");
  outputPageHeader(l, c, r);
}


x86 assembly (clang, -O0):
<outputPageFooter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1040 <out_html@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <outputPageHeader@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputPageFooter>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xecb(%rip),%rdi
call   1040 <out_html@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <outputPageHeader@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"<HR>\0A\00"
define void @outputPageFooter(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = call i32 @out_html(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @outputPageHeader(i8* %8, i8* %9, i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"<HR>\0A\00"
define void @outputPageFooter(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @out_html(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @outputPageHeader(i8* %0, i8* %1, i8* %2)
ret void
}
double mus_mu_fix(double s __attribute__((unused)), double alpha) {
  return alpha;
}


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

x86 assembly (clang, -O2):
<mus_mu_fix>:
movaps %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @mus_mu_fix(double %0, double returned %1) {
ret double %1
}
void gtk_menu_bar_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_bar_new() {
ret void
}
unsigned int count_arguments(char *s) {
  unsigned i, argc = 1;
  for (i = 0; s[i]; i++)
    if (s[i] == ',')
      argc++;
  return argc;
}


x86 assembly (clang, -O0):
<count_arguments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
cmpb   $0x0,(%rax,%rcx,1)
je     1157 <count_arguments+0x57>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1144 <count_arguments+0x44>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1149 <count_arguments+0x49>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <count_arguments+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_arguments>:
mov    $0x1,%eax
xor    %ecx,%ecx
jmp    1116 <count_arguments+0x16>
nopl   0x0(%rax)
add    $0x1,%eax
add    $0x1,%ecx
mov    %ecx,%edx
movzbl (%rdi,%rdx,1),%edx
cmp    $0x2c,%dl
je     1110 <count_arguments+0x10>
test   %dl,%dl
jne    1113 <count_arguments+0x13>
ret

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

LLVM IR (-O2):
define i32 @count_arguments(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i32 [ 0, %1 ], [ %12, %10 ]
%4 = phi i32 [ 1, %1 ], [ %11, %10 ]
%5 = zext i32 %3 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
switch i8 %7, label %10 [
i8 0, label %13
i8 44, label %8
]
8: ; preds = %2
%9 = add i32 %4, 1
br label %10
10: ; preds = %2, %8
%11 = phi i32 [ %9, %8 ], [ %4, %2 ]
%12 = add i32 %3, 1
br label %2
13: ; preds = %2
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void gpio_unlock(uint32_t *port, uint8_t pins) {
  port[0x520 / 4] = 0x4C4F434B;
  port[0x524 / 4] |= pins;
}


x86 assembly (clang, -O0):
<gpio_unlock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x4c4f434b,0x520(%rax)
43 4f 4c
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     0x524(%rax),%ecx
mov    %ecx,0x524(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_unlock>:
movl   $0x4c4f434b,0x520(%rdi)
43 4f 4c
or     %esi,0x524(%rdi)
ret

LLVM IR (-O0):
define void @gpio_unlock(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 328
store i32 1280262987, i32* %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 329
%10 = load i32, i32* %9
%11 = or i32 %10, %7
store i32 %11, i32* %9
ret void
}

LLVM IR (-O2):
define void @gpio_unlock(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 328
store i32 1280262987, i32* %3
%4 = getelementptr inbounds i32, i32* %0, i64 329
%5 = load i32, i32* %4
%6 = or i32 %5, %1
store i32 %6, i32* %4
ret void
}
void DBG_ERR_FMT(const char *const format, ...) {}


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

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

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

LLVM IR (-O2):
define void @DBG_ERR_FMT(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
int strlen(char *);
void chop(char *str) {
  int index = strlen(str);
  str[index] = '\0';
  return;
}


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @chop(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
store i8 0, i8* %9
ret void
}

LLVM IR (-O2):
define void @chop(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Variables and functions */
void *SSL_new(void *);
void *dv_openssl_new(void *ctx) { return SSL_new(ctx); }


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

x86 assembly (clang, -O2):
<dv_openssl_new>:
jmp    1030 <SSL_new@plt>

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

LLVM IR (-O2):
define i8* @dv_openssl_new(i8* %0) {
%2 = tail call i8* @SSL_new(i8* %0)
ret i8* %2
}
int adtlist_compare(void *a, void *b) {
  int ar = *((int *)a);
  int br = *((int *)b);
  if (ar < br)
    return -1;
  if (ar > br)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<adtlist_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <adtlist_compare+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <adtlist_compare+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    114e <adtlist_compare+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1155 <adtlist_compare+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adtlist_compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @adtlist_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
double fmax(double x, double y) { return x > y ? x : y; }


x86 assembly (clang, -O0):
<fmax>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <fmax+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <fmax+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmax>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @fmax(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @fmax(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ endwin();
int getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ keypad(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ noecho();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdscr;
int main() {
  int ch;
  initscr();
  cbreak();
  noecho();
  keypad(stdscr, TRUE);
  ch = getch();
  endwin();
  printf("The key pressed is %d\n", ch);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    $0x0,%al
call   1090 <noecho@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
mov    0x2e43(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
mov    $0x0,%al
call   1070 <getch@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1080 <endwin@plt>
mov    -0x4(%rbp),%esi
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
xor    %eax,%eax
call   1090 <noecho@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
mov    0x2e4a(%rip),%rax
mov    (%rax),%esi
call   1050 <keypad@plt>
xor    %eax,%eax
call   1070 <getch@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1080 <endwin@plt>
lea    0xe4c(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdscr = global i32 0
@TRUE = global i32 0
@.str = [23 x i8] c"The key pressed is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = call i32 (...) @initscr()
%3 = call i32 (...) @cbreak()
%4 = call i32 (...) @noecho()
%5 = load i32, i32* @stdscr
%6 = load i32, i32* @TRUE
%7 = call i32 @keypad(i32 %5, i32 %6)
%8 = call i32 (...) @getch()
store i32 %8, i32* %1
%9 = call i32 (...) @endwin()
%10 = load i32, i32* %1
%11 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@stdscr = global i32 0
@TRUE = global i32 0
@.str = [23 x i8] c"The key pressed is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 (...) @cbreak()
%3 = tail call i32 (...) @noecho()
%4 = load i32, i32* @stdscr
%5 = load i32, i32* @TRUE
%6 = tail call i32 @keypad(i32 %4, i32 %5)
%7 = tail call i32 (...) @getch()
%8 = tail call i32 (...) @endwin()
%9 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getNoKill();
int /*<<< orphan*/ shutDown(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/);
int /*<<< orphan*/ termReset();
void sigUsr1Handler(int signum) {
  termReset();
  shutDown(getNoKill(), 0, 0);
}


x86 assembly (clang, -O0):
<sigUsr1Handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <termReset@plt>
mov    $0x0,%al
call   1030 <getNoKill@plt>
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <shutDown@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigUsr1Handler>:
push   %rax
xor    %eax,%eax
call   1050 <termReset@plt>
xor    %eax,%eax
call   1030 <getNoKill@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1040 <shutDown@plt>

LLVM IR (-O0):
define void @sigUsr1Handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @termReset()
%4 = call i32 (...) @getNoKill()
%5 = call i32 @shutDown(i32 %4, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @sigUsr1Handler(i32 %0) {
%2 = tail call i32 (...) @termReset()
%3 = tail call i32 (...) @getNoKill()
%4 = tail call i32 @shutDown(i32 %3, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dtree_errno_set(scalar_t__);
scalar_t__ errno;
void dtree_error_from_errno(void) {
  if (errno != 0)
    dtree_errno_set(errno);
}


x86 assembly (clang, -O0):
<dtree_error_from_errno>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
cmpq   $0x0,(%rax)
je     1134 <dtree_error_from_errno+0x24>
mov    0x2eb4(%rip),%rax
mov    (%rax),%rdi
call   1030 <dtree_errno_set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtree_error_from_errno>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%rdi
test   %rdi,%rdi
je     1124 <dtree_error_from_errno+0x14>
jmp    1030 <dtree_errno_set@plt>
ret

LLVM IR (-O0):
@errno = global i64 0
define void @dtree_error_from_errno() {
%1 = load i64, i64* @errno
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = load i64, i64* @errno
%5 = call i32 @dtree_errno_set(i64 %4)
br label %6
6: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@errno = global i64 0
define void @dtree_error_from_errno() {
%1 = load i64, i64* @errno
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @dtree_errno_set(i64 %1)
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void indent(int depth) {
  int i;
  for (i = 0; i < depth; i++) {
    printf("    ");
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <indent+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
jne    1130 <indent+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
double test_sinh(double x) { return __builtin_sinh(x); }


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

x86 assembly (clang, -O2):
<test_sinh>:
jmp    1030 <sinh@plt>

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

LLVM IR (-O2):
define double @test_sinh(double %0) {
%2 = tail call double @sinh(double %0)
ret double %2
}
/* Variables and functions */
void *calloc(size_t const, size_t const);
int /*<<< orphan*/ handle_memerr();
__attribute__((always_)) void *xcalloc(const size_t nmemb, const size_t size) {
  void *ptr = calloc(nmemb, size);
  if (ptr == ((void *)0))
    handle_memerr();
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1153 <xcalloc+0x33>
mov    $0x0,%al
call   1040 <handle_memerr@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1135 <xcalloc+0x15>
xor    %eax,%eax
call   1040 <handle_memerr@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @handle_memerr()
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void instructions(void) {
  printf("Enter your choice:\n"
         "    1 to add an item to the queue.\n"
         "    2 to remove an item from the queue.\n"
         "    3 to end.\n");
}


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

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

LLVM IR (-O0):
@.str = [109 x i8] c"Enter your choice:\0A 1 to add an item to the queue.\0A 2 to remove an item from the queue.\0A 3 to end.\0A\00"
define void @instructions() {
%1 = call i32 @printf(i8* getelementptr inbounds ([109 x i8], [109 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [108 x i8] c"Enter your choice:\0A 1 to add an item to the queue.\0A 2 to remove an item from the queue.\0A 3 to end.\00"
define void @instructions() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([108 x i8], [108 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ loop();
int main(void) {
  loop();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <loop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <loop@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @loop()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
bool nrf52_errata_228(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_228() {
ret i32 0
}
void overflow() {
  __asm__ __volatile__("cli");
  SetTextColor(0x04 | 0x08, 0x00);
  kprintf("\nERROR: overflow\n");
  do {
    __asm__ __volatile__("cli  \n\t"
                         "hlt");
  } while (1 == 1);
}


x86 assembly (clang, -O0):
<overflow>:
push   %rbp
mov    %rsp,%rbp
cli
mov    $0xc,%edi
xor    %esi,%esi
mov    $0x0,%al
call   1030 <SetTextColor@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <kprintf@plt>
cli
hlt
mov    $0x1,%al
test   $0x1,%al
jne    1141 <overflow+0x21>
jmp    1152 <overflow+0x32>
pop    %rbp
ret

x86 assembly (clang, -O2):
<overflow>:
push   %rax
cli
mov    $0xc,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <SetTextColor@plt>
lea    0xec9(%rip),%rdi
xor    %eax,%eax
call   1040 <kprintf@plt>
xchg   %ax,%ax
cli
hlt
jmp    1140 <overflow+0x20>

LLVM IR (-O0):
@.str = [18 x i8] c"\0AERROR: overflow\0A\00"
define void @overflow() {
%1 = call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %4, %0
br label %4
4: ; preds = %3
br i1 true, label %3, label %5
5: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AERROR: overflow\0A\00"
define void @overflow() {
tail call void asm sideeffect "cli", "~{dirflag},~{fpsr},~{flags}"()
%1 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @SetTextColor to i32 (i32, i32, ...)*)(i32 12, i32 0)
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @kprintf to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %3, %0
tail call void asm sideeffect "cli \0A\09hlt", "~{dirflag},~{fpsr},~{flags}"()
br label %3
}
void permute(char *input, char *out, int *len, int *used) {
  if (len == 5) {
    printf("out\n");
  }
}


x86 assembly (clang, -O0):
<permute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x5,%eax
cmp    %rax,-0x18(%rbp)
jne    1145 <permute+0x35>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<permute>:
cmp    $0x5,%rdx
je     1117 <permute+0x7>
ret
lea    0xee2(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"out\0A\00"
define void @permute(i8* %0, i8* %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %7
%10 = icmp eq i32* %9, inttoptr (i64 5 to i32*)
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@str = [4 x i8] c"out\00"
define void @permute(i8* nocapture readnone %0, i8* nocapture readnone %1, i32* readnone %2, i32* nocapture readnone %3) {
%5 = icmp eq i32* %2, inttoptr (i64 5 to i32*)
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %6, %4
ret void
}
int antiLabel(int label) {
  if (label == 2)
    return (1);
  if (label == 1)
    return (2);
  return (label);
}


x86 assembly (clang, -O0):
<antiLabel>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    111d <antiLabel+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1139 <antiLabel+0x39>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <antiLabel+0x33>
movl   $0x2,-0x4(%rbp)
jmp    1139 <antiLabel+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<antiLabel>:
cmp    $0x2,%edi
je     1112 <antiLabel+0x12>
mov    %edi,%eax
cmp    $0x1,%edi
jne    1111 <antiLabel+0x11>
mov    $0x2,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @antiLabel(i32 %0) {
switch i32 %0, label %3 [
i32 2, label %4
i32 1, label %2
]
2: ; preds = %1
br label %4
3: ; preds = %1
br label %4
4: ; preds = %1, %3, %2
%5 = phi i32 [ 2, %2 ], [ %0, %3 ], [ 1, %1 ]
ret i32 %5
}
int execute_move_pages() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_move_pages() {
ret i32 0
}
int MPI_Bcast(void *buf, int count, int datatype, int root, int comm) {
  return 0;
}


x86 assembly (clang, -O0):
<MPI_Bcast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @MPI_Bcast(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
define i32 @MPI_Bcast(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
int init_pair(short pair, short f, short b) {
  (void)pair;
  (void)f;
  (void)b;
  return (0);
}


x86 assembly (clang, -O0):
<init_pair>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @init_pair(i16 signext %0, i16 signext %1, i16 signext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @init_pair(i16 signext %0, i16 signext %1, i16 signext %2) {
ret i32 0
}
int fun612() { return 612; }


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

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

LLVM IR (-O0):
define i32 @fun612() {
ret i32 612
}

LLVM IR (-O2):
define i32 @fun612() {
ret i32 612
}
double Sqr(double arg) { return (arg * arg); }


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

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

LLVM IR (-O0):
define double @Sqr(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 @Sqr(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Type definitions */
struct bufferevent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
void erl_error(struct bufferevent *ev, short event, void *ud) { exit(-1); }


x86 assembly (clang, -O0):
<erl_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0xffffffff,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<erl_error>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
%struct.bufferevent = type { i32 }
define void @erl_error(%struct.bufferevent* %0, i16 signext %1, i8* %2) {
%4 = alloca %struct.bufferevent*
%5 = alloca i16
%6 = alloca i8*
store %struct.bufferevent* %0, %struct.bufferevent** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.bufferevent = type { i32 }
define void @erl_error(%struct.bufferevent* nocapture readnone %0, i16 signext %1, i8* nocapture readnone %2) {
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
char *strcpy(char *, char const *);
char *g_strcpy(char *dest, const char *src) {
  if (src == 0 && dest != 0) {
    dest[0] = 0;
    return dest;
  }
  if (dest == 0 || src == 0) {
    return 0;
  }
  return strcpy(dest, src);
}


x86 assembly (clang, -O0):
<g_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114a <g_strcpy+0x3a>
cmpq   $0x0,-0x10(%rbp)
je     114a <g_strcpy+0x3a>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117e <g_strcpy+0x6e>
cmpq   $0x0,-0x10(%rbp)
je     1160 <g_strcpy+0x50>
cmpq   $0x0,-0x18(%rbp)
jne    116d <g_strcpy+0x5d>
movq   $0x0,-0x8(%rbp)
jmp    117e <g_strcpy+0x6e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_strcpy>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1123 <g_strcpy+0x13>
test   %rsi,%rsi
jne    1123 <g_strcpy+0x13>
movb   $0x0,(%rbx)
jmp    1137 <g_strcpy+0x27>
xor    %eax,%eax
test   %rbx,%rbx
je     113a <g_strcpy+0x2a>
test   %rsi,%rsi
je     113a <g_strcpy+0x2a>
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @g_strcpy(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** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %15
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 0, i8* %13
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %26
15: ; preds = %8, %2
%16 = load i8*, i8** %4
%17 = icmp eq i8* %16, null
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load i8*, i8** %5
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %22
21: ; preds = %18, %15
store i8* null, i8** %3
br label %26
22: ; preds = %18
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = call i8* @strcpy(i8* %23, i8* %24)
store i8* %25, i8** %3
br label %26
26: ; preds = %22, %21, %11
%27 = load i8*, i8** %3
ret i8* %27
}

LLVM IR (-O2):
define i8* @g_strcpy(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = icmp ne i8* %0, null
%5 = and i1 %4, %3
br i1 %5, label %6, label %7
6: ; preds = %2
store i8 0, i8* %0
br label %12
7: ; preds = %2
%8 = icmp eq i8* %0, null
%9 = or i1 %8, %3
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %12
12: ; preds = %7, %10, %6
%13 = phi i8* [ %0, %6 ], [ %0, %10 ], [ null, %7 ]
ret i8* %13
}
/* Variables and functions */
int Get_Byte();
int Get_Word(void) {
  int Val;
  int tmp;
  {
    Val = Get_Byte();
    tmp = Get_Byte();
    return ((Val << 8) | tmp);
  }
}


x86 assembly (clang, -O0):
<Get_Word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Get_Byte@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Get_Word>:
push   %rbx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <Get_Byte@plt>
shl    $0x8,%ebx
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Get_Word() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @Get_Byte()
store i32 %3, i32* %1
%4 = call i32 (...) @Get_Byte()
store i32 %4, i32* %2
%5 = load i32, i32* %1
%6 = shl i32 %5, 8
%7 = load i32, i32* %2
%8 = or i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @Get_Word() {
%1 = tail call i32 (...) @Get_Byte()
%2 = tail call i32 (...) @Get_Byte()
%3 = shl i32 %1, 8
%4 = or i32 %3, %2
ret i32 %4
}
int is_operator(char c) { return c == '^' || c == '|' || c == '&'; }


x86 assembly (clang, -O0):
<is_operator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5e,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_operator+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7c,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_operator+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x26,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_operator>:
mov    $0x1,%eax
cmp    $0x5e,%dil
je     1111 <is_operator+0x11>
cmp    $0x7c,%dil
jne    1112 <is_operator+0x12>
ret
xor    %eax,%eax
cmp    $0x26,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_operator(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 94
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 124
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 38
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_operator(i8 signext %0) {
switch i8 %0, label %2 [
i8 124, label %5
i8 94, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 38
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
char *basename(char const *);
char *gnu_basename(const char *filename) { return basename(filename); }


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

x86 assembly (clang, -O2):
<gnu_basename>:
jmp    1030 <basename@plt>

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

LLVM IR (-O2):
define i8* @gnu_basename(i8* %0) {
%2 = tail call i8* @basename(i8* %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) { exit(EXIT_SUCCESS); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @EXIT_SUCCESS
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = load i32, i32* @EXIT_SUCCESS
%2 = tail call i32 @exit(i32 %1)
unreachable
}