xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_version_info(void) {
  printf("GoT v%s developped by AlexMog <http://github.com/AlexMog> under the "
         "MIT license.\n",
         "0.1.0");
}


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

x86 assembly (clang, -O2):
<show_version_info>:
lea    0xee9(%rip),%rdi
lea    0xf34(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [82 x i8] c"GoT v%s developped by AlexMog <http://github.com/AlexMog> under the MIT license.\0A\00"
@.str.1 = [6 x i8] c"0.1.0\00"
define void @show_version_info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [82 x i8] c"GoT v%s developped by AlexMog <http://github.com/AlexMog> under the MIT license.\0A\00"
@.str.1 = [6 x i8] c"0.1.0\00"
define void @show_version_info() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}
double dblabs(double n) {
  if (n > 0)
    return n;
  else
    return -n;
}


x86 assembly (clang, -O0):
<dblabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112a <dblabs+0x2a>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    114b <dblabs+0x4b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dblabs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
andpd  %xmm2,%xmm0
andnpd %xmm1,%xmm2
orpd   %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @dblabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %3
store double %7, double* %2
br label %11
8: ; preds = %1
%9 = load double, double* %3
%10 = fneg double %9
store double %10, double* %2
br label %11
11: ; preds = %8, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @dblabs(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %0, double %3
ret double %4
}
/* Variables and functions */
int cio_read(int);
void jpip_read_manf(int len) {
  int i, v, marker_len, marker_type;
  v = (len - 8) / 8;
  for (i = 0; i < v; i++) {
    marker_len = cio_read(4);
    marker_type = cio_read(4);
  }
}


x86 assembly (clang, -O0):
<jpip_read_manf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1167 <jpip_read_manf+0x57>
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <jpip_read_manf+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jpip_read_manf>:
push   %rbx
cmp    $0x10,%edi
jl     1139 <jpip_read_manf+0x29>
mov    %edi,%ebx
add    $0xfffffff8,%ebx
shr    $0x3,%ebx
xchg   %ax,%ax
mov    $0x4,%edi
call   1030 <cio_read@plt>
mov    $0x4,%edi
call   1030 <cio_read@plt>
add    $0xffffffff,%ebx
jne    1120 <jpip_read_manf+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @jpip_read_manf(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 8
%9 = sdiv i32 %8, 8
store i32 %9, i32* %4
store i32 0, i32* %3
br label %10
10: ; preds = %17, %1
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %10
%15 = call i32 @cio_read(i32 4)
store i32 %15, i32* %5
%16 = call i32 @cio_read(i32 4)
store i32 %16, i32* %6
br label %17
17: ; preds = %14
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %10
20: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @jpip_read_manf(i32 %0) {
%2 = icmp sgt i32 %0, 15
br i1 %2, label %3, label %12
3: ; preds = %1
%4 = add nsw i32 %0, -8
%5 = lshr i32 %4, 3
br label %6
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 0, %3 ]
%8 = tail call i32 @cio_read(i32 4)
%9 = tail call i32 @cio_read(i32 4)
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %1
ret void
}
int fn_1(int flag) {
  int x = 4, y = 5;
  if (flag)
    x = 3;
  y = 2;
  return x * y;
}


x86 assembly (clang, -O0):
<fn_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1126 <fn_1+0x26>
movl   $0x3,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_1>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
add    %eax,%eax
add    $0x6,%eax
ret

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

LLVM IR (-O2):
define i32 @fn_1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 8, i32 6
ret i32 %3
}
/* Variables and functions */
int strcmp(char *, char *);
int cmpstring(const void *w1, const void *w2) {
  return strcmp(*(char **)w1, *(char **)w2);
}


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

x86 assembly (clang, -O2):
<cmpstring>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmpstring(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmpstring(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef unsigned char uint32_t;

/* Variables and functions */
uint32_t read_le16_3(unsigned char *data) { return *data | (*(data + 1) << 8); }


x86 assembly (clang, -O0):
<read_le16_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_le16_3>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @read_le16_3(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = or i32 %5, %10
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define zeroext i8 @read_le16_3(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ Sync();
void M235Restore(int version) { Sync(); }


x86 assembly (clang, -O0):
<M235Restore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Sync@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M235Restore>:
xor    %eax,%eax
jmp    1030 <Sync@plt>

LLVM IR (-O0):
define void @M235Restore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @Sync()
ret void
}

LLVM IR (-O2):
define void @M235Restore(i32 %0) {
%2 = tail call i32 (...) @Sync()
ret void
}
/* Variables and functions */
char *malloc(int);
char *getindent(int n) {
  char *str = malloc(sizeof(char) * n + 1);
  int i;
  for (i = 0; i < n; i++) {
    str[i] = ' ';
  }
  str[n] = '\0';
  return str;
}


x86 assembly (clang, -O0):
<getindent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <getindent+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <getindent+0x29>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getindent>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1144 <getindent+0x24>
mov    %ebx,%edx
mov    %r14,%rdi
mov    $0x20,%esi
call   1030 <memset@plt>
movslq %ebx,%rax
movb   $0x0,(%r14,%rax,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8* @getindent(i32 %0) {
%2 = add i32 %0, 1
%3 = tail call i8* @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = zext i32 %0 to i64
br label %7
7: ; preds = %5, %1
%8 = sext i32 %0 to i64
%9 = getelementptr inbounds i8, i8* %3, i64 %8
store i8 0, i8* %9
ret i8* %3
}
void setsocket(int newsocket) { newsocket = newsocket; }


x86 assembly (clang, -O0):
<setsocket>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @setsocket(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isxdigit(int);
void t_isxdigit_0xcf() {
  Assert_real((isxdigit(207) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isxdigit.c",
              1040, ("isxdigit should be 0 for 0xcf"));
}


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

x86 assembly (clang, -O2):
<t_isxdigit_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1030 <isxdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x410,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xcf\00"
define void @t_isxdigit_0xcf() {
%1 = call i64 @isxdigit(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isxdigit.c\00"
@.str.1 = [30 x i8] c"isxdigit should be 0 for 0xcf\00"
define void @t_isxdigit_0xcf() {
%1 = tail call i64 @isxdigit(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float somar(float x, float y) { return x + y; }


x86 assembly (clang, -O0):
<somar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<somar>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @somar(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
main() {
  printf("ACM"
         ""
         ""
         ""
         ""
         ""
         "welcomes you");
  printf("\nAcumen", "99");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"ACMwelcomes you\00"
@.str.1 = [8 x i8] c"\0AAcumen\00"
@.str.2 = [3 x i8] c"99\00"
define i32 @main() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"ACMwelcomes you\00"
@.str.1 = [8 x i8] c"\0AAcumen\00"
@.str.2 = [3 x i8] c"99\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
scalar_t__ gethostname(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
const char *mc_hostname(void) {
  static char buffer[64] = {0};
  if (!buffer[0]) {
    if (0 != gethostname(buffer, sizeof(buffer))) {
      strcpy(buffer, "localhost");
    }
  }
  return buffer;
}


x86 assembly (clang, -O0):
<mc_hostname>:
push   %rbp
mov    %rsp,%rbp
cmpb   $0x0,0x2f15(%rip)
jne    1168 <mc_hostname+0x48>
lea    0x2f08(%rip),%rdi
mov    $0x40,%esi
call   1040 <gethostname@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
je     1163 <mc_hostname+0x43>
lea    0x2ee9(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1030 <strcpy@plt>
jmp    1168 <mc_hostname+0x48>
lea    0x2ed1(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mc_hostname>:
push   %rax
cmpb   $0x0,0x2f18(%rip)
jne    1153 <mc_hostname+0x33>
lea    0x2f0f(%rip),%rdi
mov    $0x40,%esi
call   1040 <gethostname@plt>
test   %rax,%rax
je     1153 <mc_hostname+0x33>
lea    0x2ef9(%rip),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
lea    0x2ee6(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@mc_hostname.buffer = internal global [64 x i8] zeroinitializer
@.str = [10 x i8] c"localhost\00"
define i8* @mc_hostname() {
%1 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0)
%2 = icmp ne i8 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = call i64 @gethostname(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0), i32 64)
%5 = icmp ne i64 0, %4
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = call i32 @strcpy(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
br label %9
9: ; preds = %8, %0
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@mc_hostname.buffer = internal global [64 x i8] zeroinitializer
@.str = [10 x i8] c"localhost\00"
define i8* @mc_hostname() {
%1 = load i8, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i64 @gethostname(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0), i32 64)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @strcpy(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6, %0
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @mc_hostname.buffer, i64 0, i64 0)
}
void RTDbgLineDup(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDbgLineDup() {
ret void
}
void __SLIC_fun_local_irq_disable_entry(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_local_irq_disable_entry() {
ret void
}
void __attribute__((weak)) EXTI12_Callback(void) {}


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

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

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

LLVM IR (-O2):
define weak void @EXTI12_Callback() {
ret void
}
void X509V3_set_nconf(void) {}


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

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

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

LLVM IR (-O2):
define void @X509V3_set_nconf() {
ret void
}
/* Variables and functions */
size_t strlen(const char *string) {
  size_t ret = 0;
  while (string[ret]) {
    ret++;
  }
  return ret;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
double M_PI;
double empi(void) { return M_PI; }


x86 assembly (clang, -O0):
<empi>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<empi>:
mov    0x2ee1(%rip),%rax
movsd  (%rax),%xmm0
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define double @empi() {
%1 = load double, double* @M_PI
ret double %1
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define double @empi() {
%1 = load double, double* @M_PI
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ mask32(int, int, int);
void gpio_init(void) {
  mask32(0x0d8000fc, 0, 0x41);
  mask32(0x0d80003c, 1 << 10, 0);
  mask32(0x0d800034, 0, 1 << 10);
  mask32(0x0d8000d4, 0, 0x41);
  mask32(0x0d8000cc, 0, 0x41);
}


x86 assembly (clang, -O0):
<gpio_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd8000fc,%edi
xor    %esi,%esi
mov    $0x41,%edx
call   1030 <mask32@plt>
mov    $0xd80003c,%edi
mov    $0x400,%esi
xor    %edx,%edx
call   1030 <mask32@plt>
mov    $0xd800034,%edi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <mask32@plt>
mov    $0xd8000d4,%edi
xor    %esi,%esi
mov    $0x41,%edx
call   1030 <mask32@plt>
mov    $0xd8000cc,%edi
xor    %esi,%esi
mov    $0x41,%edx
call   1030 <mask32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_init>:
push   %rax
mov    $0xd8000fc,%edi
xor    %esi,%esi
mov    $0x41,%edx
call   1030 <mask32@plt>
mov    $0xd80003c,%edi
mov    $0x400,%esi
xor    %edx,%edx
call   1030 <mask32@plt>
mov    $0xd800034,%edi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <mask32@plt>
mov    $0xd8000d4,%edi
xor    %esi,%esi
mov    $0x41,%edx
call   1030 <mask32@plt>
mov    $0xd8000cc,%edi
xor    %esi,%esi
mov    $0x41,%edx
pop    %rax
jmp    1030 <mask32@plt>

LLVM IR (-O0):
define void @gpio_init() {
%1 = call i32 @mask32(i32 226492668, i32 0, i32 65)
%2 = call i32 @mask32(i32 226492476, i32 1024, i32 0)
%3 = call i32 @mask32(i32 226492468, i32 0, i32 1024)
%4 = call i32 @mask32(i32 226492628, i32 0, i32 65)
%5 = call i32 @mask32(i32 226492620, i32 0, i32 65)
ret void
}

LLVM IR (-O2):
define void @gpio_init() {
%1 = tail call i32 @mask32(i32 226492668, i32 0, i32 65)
%2 = tail call i32 @mask32(i32 226492476, i32 1024, i32 0)
%3 = tail call i32 @mask32(i32 226492468, i32 0, i32 1024)
%4 = tail call i32 @mask32(i32 226492628, i32 0, i32 65)
%5 = tail call i32 @mask32(i32 226492620, i32 0, i32 65)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void error(const char *s) {
  perror(s);
  assert(0);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
call   1040 <perror@plt>
xor    %edi,%edi
call   1030 <assert@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = call i32 @assert(i32 0)
%6 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @assert(i32 0)
%4 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  puts("console app startup");
  sleep(2);
  puts("console app shutdown");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"console app startup\00"
@.str.1 = [21 x i8] c"console app shutdown\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 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @sleep(i32 2)
%8 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"console app startup\00"
@.str.1 = [21 x i8] c"console app shutdown\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @sleep(i32 2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ tm_str;
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
const char *lwqq_log_time() {
  static char tm_str[64];
  time_t t_ = time(NULL);
  struct tm *tm_ = localtime(&t_);
  strftime(tm_str, sizeof(tm_str), "%X", tm_);
  return tm_str;
}


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

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

LLVM IR (-O0):
%struct.tm = type { i32 }
@lwqq_log_time.tm_str = internal global [64 x i8] zeroinitializer
@.str = [3 x i8] c"%X\00"
define i8* @lwqq_log_time() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @lwqq_log_time.tm_str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %5)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @lwqq_log_time.tm_str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@lwqq_log_time.tm_str = internal global [64 x i8] zeroinitializer
@.str = [3 x i8] c"%X\00"
define i8* @lwqq_log_time() {
%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* @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @lwqq_log_time.tm_str, i64 0, i64 0), i32 64, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @lwqq_log_time.tm_str, i64 0, i64 0)
}
void reverse(char *s, int left, int right) {
  while (left < right) {
    char c = s[left];
    s[left++] = s[right];
    s[right--] = c;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1165 <reverse+0x65>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0xc(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%esi
add    $0xffffffff,%esi
mov    %esi,-0x10(%rbp)
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
jmp    110e <reverse+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    %edx,%esi
jge    1131 <reverse+0x31>
movslq %esi,%rax
movslq %edx,%rcx
add    $0x1,%rax
xchg   %ax,%ax
movzbl -0x1(%rdi,%rax,1),%esi
movzbl (%rdi,%rcx,1),%edx
mov    %dl,-0x1(%rdi,%rax,1)
mov    %sil,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rcx
lea    0x1(%rax),%rdx
cmp    %rcx,%rax
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = sext i32 %1 to i64
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %5, %8
%9 = phi i64 [ %7, %5 ], [ %16, %8 ]
%10 = phi i64 [ %6, %5 ], [ %15, %8 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = getelementptr inbounds i8, i8* %0, i64 %9
%14 = load i8, i8* %13
%15 = add nsw i64 %10, 1
store i8 %14, i8* %11
%16 = add nsw i64 %9, -1
store i8 %12, i8* %13
%17 = icmp slt i64 %15, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %3
ret void
}
/* Variables and functions */
char const *ptr_after_char(char const *, char);
const char *sp_parse_file_extension(const char *filename) {
  return ptr_after_char(filename, '.');
}


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

x86 assembly (clang, -O2):
<sp_parse_file_extension>:
mov    $0x2e,%esi
jmp    1030 <ptr_after_char@plt>

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

LLVM IR (-O2):
define i8* @sp_parse_file_extension(i8* %0) {
%2 = tail call i8* @ptr_after_char(i8* %0, i8 signext 46)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char const);
int puts(const char *s) {
  int count = 0;
  while (*s) {
    putchar(*s);
    count++;
    s++;
  }
  return count;
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <puts+0x46>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <puts+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1138 <puts+0x28>
mov    %rdi,%r14
xor    %ebx,%ebx
nop
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
jmp    113a <puts+0x2a>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = tail call i32 @putchar(i8 signext %5)
%9 = add nuw nsw i32 %6, 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
int x(int i) {}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @x(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sum(int);
int main() {
  int n = 5;
  sum(n);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 5)
ret i32 0
}
/* Variables and functions */
int gdb_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int gdb_puts(char *str) { return gdb_write(str, strlen(str)); }


x86 assembly (clang, -O0):
<gdb_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <gdb_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gdb_puts>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <gdb_write@plt>

LLVM IR (-O0):
define i32 @gdb_puts(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @gdb_write(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @gdb_puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i32 @gdb_write(i8* %0, i32 %2)
ret i32 %3
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_AVTransport_SetAVTransportURI(struct UPnPService *Service,
                                                   int ErrorCode, void *User) {
  printf(
      "RND Invoke Response: AVTransport/SetAVTransportURI[ErrorCode:%d]()\r\n",
      ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_AVTransport_SetAVTransportURI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"RND Invoke Response: AVTransport/SetAVTransportURI[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_SetAVTransportURI(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [69 x i8] c"RND Invoke Response: AVTransport/SetAVTransportURI[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_AVTransport_SetAVTransportURI(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int __attribute__((target("default"))) foo(void) { return 2; }


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

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 2
}
/* Variables and functions */
scalar_t__ time(int /*<<< orphan*/ *);
int funcGetTimeUTC(void) {
  int iTime = (int)time(NULL);
  return iTime;
}


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

x86 assembly (clang, -O2):
<funcGetTimeUTC>:
xor    %edi,%edi
jmp    1030 <time@plt>

LLVM IR (-O0):
define i32 @funcGetTimeUTC() {
%1 = alloca i32
%2 = call i64 @time(i32* null)
%3 = trunc i64 %2 to i32
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @funcGetTimeUTC() {
%1 = tail call i64 @time(i32* null)
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int gomml(int, char **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ s_hook_memory_close();
int /*<<< orphan*/ s_lib_free();
int main(int argc, char *argv[]) {
  int retcode = 0;
  retcode = gomml(argc, argv);
  s_lib_free();
  s_hook_memory_close();
  if (retcode == 1)
    printf("ok.\n");
  return retcode;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <gomml@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <s_lib_free@plt>
mov    $0x0,%al
call   1030 <s_hook_memory_close@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1190 <main+0x50>
lea    0xe75(%rip),%rdi
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1060 <gomml@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <s_lib_free@plt>
xor    %eax,%eax
call   1030 <s_hook_memory_close@plt>
cmp    $0x1,%ebx
jne    1167 <main+0x27>
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [4 x i8] c"ok.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gomml(i32 %0, i8** %1)
%4 = tail call i32 (...) @s_lib_free()
%5 = tail call i32 (...) @s_hook_memory_close()
%6 = icmp eq i32 %3, 1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i32 %3
}
/* Variables and functions */
int outchar(char, char *, int);
int out_space(int _num, char *ptr, int off) {
  if (_num & 0x20000)
    return outchar('0', ptr, off);
  else
    return outchar(' ', ptr, off);
}


x86 assembly (clang, -O0):
<out_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
and    $0x20000,%eax
cmp    $0x0,%eax
je     114c <out_space+0x3c>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x30,%edi
call   1030 <outchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1160 <out_space+0x50>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    $0x20,%edi
call   1030 <outchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<out_space>:
shr    $0xd,%edi
and    $0x10,%edi
or     $0x20,%edi
jmp    1030 <outchar@plt>

LLVM IR (-O0):
define i32 @out_space(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%8 = load i32, i32* %5
%9 = and i32 %8, 131072
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = load i32, i32* %7
%14 = call i32 @outchar(i8 signext 48, i8* %12, i32 %13)
store i32 %14, i32* %4
br label %19
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = call i32 @outchar(i8 signext 32, i8* %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
define i32 @out_space(i32 %0, i8* %1, i32 %2) {
%4 = and i32 %0, 131072
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8 32, i8 48
%7 = tail call i32 @outchar(i8 signext %6, i8* %1, i32 %2)
ret i32 %7
}
/* Variables and functions */
int exp(double);
double invlogit(double x) {
  if (x > 0) {
    return 1 / (1 + exp(-x));
  } else {
    return exp(x) / (1 + exp(x));
  }
}


x86 assembly (clang, -O0):
<invlogit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    116b <invlogit+0x5b>
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1196 <invlogit+0x86>
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    $0x1,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invlogit>:
push   %rbx
sub    $0x10,%rsp
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    113e <invlogit+0x2e>
xorpd  0xed9(%rip),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
lea    0x1(%rcx),%edx
add    $0x2,%ecx
xor    %eax,%eax
cmp    $0x3,%ecx
cmovb  %edx,%eax
jmp    115e <invlogit+0x4e>
movapd %xmm0,(%rsp)
call   1030 <exp@plt>
mov    %eax,%ebx
movapd (%rsp),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @invlogit(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load double, double* %3
%8 = fneg double %7
%9 = call i32 @exp(double %8)
%10 = add nsw i32 1, %9
%11 = sdiv i32 1, %10
%12 = sitofp i32 %11 to double
store double %12, double* %2
br label %21
13: ; preds = %1
%14 = load double, double* %3
%15 = call i32 @exp(double %14)
%16 = load double, double* %3
%17 = call i32 @exp(double %16)
%18 = add nsw i32 1, %17
%19 = sdiv i32 %15, %18
%20 = sitofp i32 %19 to double
store double %20, double* %2
br label %21
21: ; preds = %13, %6
%22 = load double, double* %2
ret double %22
}

LLVM IR (-O2):
define double @invlogit(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = fneg double %0
%5 = tail call i32 @exp(double %4)
%6 = add nsw i32 %5, 1
%7 = add i32 %5, 2
%8 = icmp ult i32 %7, 3
%9 = select i1 %8, i32 %6, i32 0
br label %15
10: ; preds = %1
%11 = tail call i32 @exp(double %0)
%12 = tail call i32 @exp(double %0)
%13 = add nsw i32 %12, 1
%14 = sdiv i32 %11, %13
br label %15
15: ; preds = %10, %3
%16 = phi i32 [ %9, %3 ], [ %14, %10 ]
%17 = sitofp i32 %16 to double
ret double %17
}
int serdisp_goldelox_is_oled(unsigned char code) {
  return (code == 0x00) ? 1 : 0;
}


x86 assembly (clang, -O0):
<serdisp_goldelox_is_oled>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serdisp_goldelox_is_oled>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @serdisp_goldelox_is_oled(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @serdisp_goldelox_is_oled(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}