xunge/DecIR huggingface dataset:
float anglemod(float a) {
  a = (360.0 / 65536) * ((int)(a * (65536 / 360.0)) & 65535);
  return a;
}


x86 assembly (clang, -O0):
<anglemod>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
and    $0xffff,%eax
cvtsi2sd %eax,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<anglemod>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
movzwl %ax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xee6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @anglemod(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 0x4066C16C16C16C17
%6 = fptosi double %5 to i32
%7 = and i32 %6, 65535
%8 = sitofp i32 %7 to double
%9 = fmul double 0x3F76800000000000, %8
%10 = fptrunc double %9 to float
store float %10, float* %2
%11 = load float, float* %2
ret float %11
}

LLVM IR (-O2):
define float @anglemod(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x4066C16C16C16C17
%4 = fptosi double %3 to i32
%5 = and i32 %4, 65535
%6 = sitofp i32 %5 to double
%7 = fmul double %6, 0x3F76800000000000
%8 = fptrunc double %7 to float
ret float %8
}
/* Type definitions */
struct account {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ account_dispose(struct account *);
int /*<<< orphan*/ account_set_balance(struct account *, int);
struct account *create_account();
int main() {
  struct account *myAccount = create_account();
  account_set_balance(myAccount, 5);
  account_dispose(myAccount);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <create_account@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1040 <account_set_balance@plt>
mov    -0x10(%rbp),%rdi
call   1050 <account_dispose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <create_account@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x5,%esi
call   1040 <account_set_balance@plt>
mov    %rbx,%rdi
call   1050 <account_dispose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.account = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.account*
store i32 0, i32* %1
%3 = call %struct.account* (...) @create_account()
store %struct.account* %3, %struct.account** %2
%4 = load %struct.account*, %struct.account** %2
%5 = call i32 @account_set_balance(%struct.account* %4, i32 5)
%6 = load %struct.account*, %struct.account** %2
%7 = call i32 @account_dispose(%struct.account* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.account = type { i32 }
define i32 @main() {
%1 = tail call %struct.account* (...) @create_account()
%2 = tail call i32 @account_set_balance(%struct.account* %1, i32 5)
%3 = tail call i32 @account_dispose(%struct.account* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ const *);
struct tm *dc_gmtime_r(const time_t *t, struct tm *tm) {
  struct tm *p = gmtime(t);
  if (p == NULL)
    return NULL;
  if (tm)
    *tm = *p;
  return tm;
}


x86 assembly (clang, -O0):
<dc_gmtime_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1145 <dc_gmtime_r+0x35>
movq   $0x0,-0x8(%rbp)
jmp    1164 <dc_gmtime_r+0x54>
cmpq   $0x0,-0x18(%rbp)
je     115c <dc_gmtime_r+0x4c>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dc_gmtime_r>:
push   %rbx
mov    %rsi,%rbx
call   1030 <gmtime@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rbx,%rbx
je     112f <dc_gmtime_r+0x1f>
test   %rcx,%rcx
je     112f <dc_gmtime_r+0x1f>
mov    (%rcx),%eax
mov    %eax,(%rbx)
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @dc_gmtime_r(i32* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca i32*
%5 = alloca %struct.tm*
%6 = alloca %struct.tm*
store i32* %0, i32** %4
store %struct.tm* %1, %struct.tm** %5
%7 = load i32*, i32** %4
%8 = call %struct.tm* @gmtime(i32* %7)
store %struct.tm* %8, %struct.tm** %6
%9 = load %struct.tm*, %struct.tm** %6
%10 = icmp eq %struct.tm* %9, null
br i1 %10, label %11, label %12
11: ; preds = %2
store %struct.tm* null, %struct.tm** %3
br label %22
12: ; preds = %2
%13 = load %struct.tm*, %struct.tm** %5
%14 = icmp ne %struct.tm* %13, null
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = load %struct.tm*, %struct.tm** %5
%17 = load %struct.tm*, %struct.tm** %6
%18 = bitcast %struct.tm* %16 to i8*
%19 = bitcast %struct.tm* %17 to i8*
br label %20
20: ; preds = %15, %12
%21 = load %struct.tm*, %struct.tm** %5
store %struct.tm* %21, %struct.tm** %3
br label %22
22: ; preds = %20, %11
%23 = load %struct.tm*, %struct.tm** %3
ret %struct.tm* %23
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @dc_gmtime_r(i32* %0, %struct.tm* writeonly %1) {
%3 = tail call %struct.tm* @gmtime(i32* %0)
%4 = icmp eq %struct.tm* %3, null
%5 = icmp eq %struct.tm* %1, null
%6 = or i1 %5, %4
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = getelementptr %struct.tm, %struct.tm* %3, i64 0, i32 0
%9 = getelementptr %struct.tm, %struct.tm* %1, i64 0, i32 0
%10 = load i32, i32* %8
store i32 %10, i32* %9
br label %11
11: ; preds = %7, %2
%12 = phi %struct.tm* [ null, %2 ], [ %1, %7 ]
ret %struct.tm* %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) { printf("%.55f\n", 1.0 / 10.0); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%.55f\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.000000e-01)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%.55f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 1.000000e-01)
ret i32 0
}
long long int presum(int a) {
  switch (a) {
  case 2:
    return 855;
  case 3:
    return 12600;
  case 4:
    return 166500;
  case 5:
    return 2070000;
  case 6:
    return 24750000;
  case 7:
    return 288000000;
  case 8:
    return 3285000000;
  case 9:
    return 36900000000;
  }
}


x86 assembly (clang, -O0):
<presum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffffe,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x7,%eax
ja     119a <presum+0x9a>
mov    -0x18(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movq   $0x357,-0x8(%rbp)
jmp    119a <presum+0x9a>
movq   $0x3138,-0x8(%rbp)
jmp    119a <presum+0x9a>
movq   $0x28a64,-0x8(%rbp)
jmp    119a <presum+0x9a>
movq   $0x1f95f0,-0x8(%rbp)
jmp    119a <presum+0x9a>
movq   $0x179a7b0,-0x8(%rbp)
01
jmp    119a <presum+0x9a>
movq   $0x112a8800,-0x8(%rbp)
11
jmp    119a <presum+0x9a>
mov    $0xc3cd1f40,%eax
mov    %rax,-0x8(%rbp)
jmp    119a <presum+0x9a>
movabs $0x897695100,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<presum>:
add    $0xfffffffd,%edi
mov    $0x357,%eax
cmp    $0x6,%edi
ja     111b <presum+0x1b>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,8),%rax
ret

LLVM IR (-O0):
define i64 @presum(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 2, label %5
i32 3, label %6
i32 4, label %7
i32 5, label %8
i32 6, label %9
i32 7, label %10
i32 8, label %11
i32 9, label %12
]
5: ; preds = %1
store i64 855, i64* %2
br label %13
6: ; preds = %1
store i64 12600, i64* %2
br label %13
7: ; preds = %1
store i64 166500, i64* %2
br label %13
8: ; preds = %1
store i64 2070000, i64* %2
br label %13
9: ; preds = %1
store i64 24750000, i64* %2
br label %13
10: ; preds = %1
store i64 288000000, i64* %2
br label %13
11: ; preds = %1
store i64 3285000000, i64* %2
br label %13
12: ; preds = %1
store i64 36900000000, i64* %2
br label %13
13: ; preds = %5, %6, %7, %8, %9, %10, %11, %12, %1
%14 = load i64, i64* %2
ret i64 %14
}

LLVM IR (-O2):
@switch.table.presum = [7 x i64] [i64 12600, i64 166500, i64 2070000, i64 24750000, i64 288000000, i64 3285000000, i64 36900000000]
define i64 @presum(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 7
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [7 x i64], [7 x i64]* @switch.table.presum, i64 0, i64 %5
%7 = load i64, i64* %6
br label %8
8: ; preds = %4, %1
%9 = phi i64 [ 855, %1 ], [ %7, %4 ]
ret i64 %9
}
/* Variables and functions */
char *getenv(char *);
char *getTempDir() {
  char *dir = getenv("SWFTOOLS_TMP");
  if (!dir)
    dir = "/tmp/";
  return dir;
}


x86 assembly (clang, -O0):
<getTempDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113e <getTempDir+0x2e>
lea    0xed3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTempDir>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee6(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"SWFTOOLS_TMP\00"
@.str.1 = [6 x i8] c"/tmp/\00"
define i8* @getTempDir() {
%1 = alloca i8*
%2 = call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %5, %0
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
@.str = [13 x i8] c"SWFTOOLS_TMP\00"
@.str.1 = [6 x i8] c"/tmp/\00"
define i8* @getTempDir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
__attribute__((nonnull(1))) const char *m_strchrnul(const char *s, int c) {
  while (*s && *s != c)
    s++;
  return s;
}


x86 assembly (clang, -O0):
<m_strchrnul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1130 <m_strchrnul+0x30>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1140 <m_strchrnul+0x40>
jmp    1151 <m_strchrnul+0x51>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <m_strchrnul+0xb>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<m_strchrnul>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movsbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %ecx,%ecx
je     1120 <m_strchrnul+0x20>
cmp    %esi,%ecx
jne    1110 <m_strchrnul+0x10>
ret

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

LLVM IR (-O2):
define i8* @m_strchrnul(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = sext i8 %5 to i32
%8 = icmp eq i32 %7, %1
%9 = or i1 %6, %8
%10 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %9, label %11, label %3
11: ; preds = %3
ret i8* %4
}
/* Type definitions */
struct RNAcofold_args_info {
  int dummy;
};

/* Variables and functions */
int RNAcofold_cmdline_parser2(int, char **, struct RNAcofold_args_info *,
                              int /*<<< orphan*/, int, int);
int RNAcofold_cmdline_parser(int argc, char **argv,
                             struct RNAcofold_args_info *args_info) {
  return RNAcofold_cmdline_parser2(argc, argv, args_info, 0, 1, 1);
}


x86 assembly (clang, -O0):
<RNAcofold_cmdline_parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
mov    $0x1,%r9d
mov    %r9d,%r8d
call   1030 <RNAcofold_cmdline_parser2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RNAcofold_cmdline_parser>:
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
jmp    1030 <RNAcofold_cmdline_parser2@plt>

LLVM IR (-O0):
%struct.RNAcofold_args_info = type { i32 }
define i32 @RNAcofold_cmdline_parser(i32 %0, i8** %1, %struct.RNAcofold_args_info* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.RNAcofold_args_info*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.RNAcofold_args_info* %2, %struct.RNAcofold_args_info** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load %struct.RNAcofold_args_info*, %struct.RNAcofold_args_info** %6
%10 = call i32 @RNAcofold_cmdline_parser2(i32 %7, i8** %8, %struct.RNAcofold_args_info* %9, i32 0, i32 1, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.RNAcofold_args_info = type { i32 }
define i32 @RNAcofold_cmdline_parser(i32 %0, i8** %1, %struct.RNAcofold_args_info* %2) {
%4 = tail call i32 @RNAcofold_cmdline_parser2(i32 %0, i8** %1, %struct.RNAcofold_args_info* %2, i32 0, i32 1, i32 1)
ret i32 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t utf8_chsize(uint32_t ch) {
  if (ch < 0x80) {
    return 1;
  } else if (ch < 0x800) {
    return 2;
  } else if (ch < 0x10000) {
    return 3;
  }
  return 4;
}


x86 assembly (clang, -O0):
<utf8_chsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x80,-0xc(%rbp)
jge    1121 <utf8_chsize+0x21>
movq   $0x1,-0x8(%rbp)
jmp    1167 <utf8_chsize+0x67>
cmpl   $0x800,-0xc(%rbp)
jge    113b <utf8_chsize+0x3b>
movq   $0x2,-0x8(%rbp)
jmp    1167 <utf8_chsize+0x67>
cmpl   $0x10000,-0xc(%rbp)
jge    1155 <utf8_chsize+0x55>
movq   $0x3,-0x8(%rbp)
jmp    1167 <utf8_chsize+0x67>
jmp    115a <utf8_chsize+0x5a>
jmp    115f <utf8_chsize+0x5f>
movq   $0x4,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8_chsize>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1129 <utf8_chsize+0x29>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1129 <utf8_chsize+0x29>
cmp    $0x10000,%edi
mov    $0x4,%eax
sbb    $0x0,%rax
ret

LLVM IR (-O0):
define i64 @utf8_chsize(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %18
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 2, i64* %2
br label %18
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 3, i64* %2
br label %18
15: ; preds = %11
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
store i64 4, i64* %2
br label %18
18: ; preds = %17, %14, %10, %6
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
define i64 @utf8_chsize(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
%7 = select i1 %6, i64 3, i64 4
br label %8
8: ; preds = %5, %3, %1
%9 = phi i64 [ 1, %1 ], [ 2, %3 ], [ %7, %5 ]
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ SystemInit();
void __attribute__((weak)) __initialize_hardware_early(void) { SystemInit(); }


x86 assembly (clang, -O0):
<__initialize_hardware_early>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <SystemInit@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define weak void @__initialize_hardware_early() {
%1 = call i32 (...) @SystemInit()
ret void
}

LLVM IR (-O2):
define weak void @__initialize_hardware_early() {
%1 = tail call i32 (...) @SystemInit()
ret void
}
/* Variables and functions */
int slk_color(short);
int wrap_slk_color(short color_pair) { return slk_color(color_pair); }


x86 assembly (clang, -O0):
<wrap_slk_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edi
call   1030 <slk_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_slk_color>:
jmp    1030 <slk_color@plt>

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

LLVM IR (-O2):
define i32 @wrap_slk_color(i16 signext %0) {
%2 = tail call i32 @slk_color(i16 signext %0)
ret i32 %2
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ test_singly_linked_list();
int main(int argc __attribute__((unused)),
         char const *argv[] __attribute__((unused))) {
  test_singly_linked_list();
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_singly_linked_list@plt>
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
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 (...) @test_singly_linked_list()
%7 = load i32, i32* @EXIT_SUCCESS
ret i32 %7
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_singly_linked_list()
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
void thread_sync_caches(void) {}


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

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

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

LLVM IR (-O2):
define void @thread_sync_caches() {
ret void
}
void umocktypes_free_unsignedint(unsigned int *value) { (void)value; }


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

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

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

LLVM IR (-O2):
define void @umocktypes_free_unsignedint(i32* nocapture %0) {
ret void
}
void __attribute__((weak)) dma2_ch1_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<dma2_ch1_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<dma2_ch1_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.dma2_ch1_isr = [13 x i8] c"dma2_ch1_isr\00"
define weak void @dma2_ch1_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.dma2_ch1_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.dma2_ch1_isr = [13 x i8] c"dma2_ch1_isr\00"
define weak void @dma2_ch1_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.dma2_ch1_isr, i64 0, i64 0))
ret void
}
short g(short a, char b) { return a + b; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%eax
movsbl -0x3(%rbp),%ecx
add    %ecx,%eax
cwtl
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define signext i16 @g(i16 signext %0, i8 signext %1) {
%3 = sext i8 %1 to i16
%4 = add i16 %3, %0
ret i16 %4
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ fib(int);
int main(int argc, char *argv[]) {
  int n = 8;
  if (argc > 1)
    n = atoi(argv[1]);
  fib(n);
  return 0;
}


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   $0x8,-0x14(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <fib@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %edi,%eax
mov    $0x8,%edi
cmp    $0x2,%eax
jl     1138 <main+0x18>
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%edi
call   1030 <fib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
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 8, i32* %6
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %6
br label %14
14: ; preds = %9, %2
%15 = load i32, i32* %6
%16 = call i32 @fib(i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %4, %2
%9 = phi i32 [ %7, %4 ], [ 8, %2 ]
%10 = tail call i32 @fib(i32 %9)
ret i32 0
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void sig_chld(int sig) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0)
    printf("child %d terminated\n", pid);
  return;
}


x86 assembly (clang, -O0):
<sig_chld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <sig_chld+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <sig_chld+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_chld>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <sig_chld+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <sig_chld+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [21 x i8] c"child %d terminated\0A\00"
define void @sig_chld(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_window_attributes_reply_t;
typedef int /*<<< orphan*/ xcb_get_window_attributes_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;

/* Variables and functions */
int /*<<< orphan*/ xcb_get_window_attributes(int /*<<< orphan*/ *,
                                             int /*<<< orphan*/);
int /*<<< orphan*/ *xcb_get_window_attributes_reply(int /*<<< orphan*/ *,
                                                    int /*<<< orphan*/,
                                                    int /*<<< orphan*/ *);
int exists(xcb_connection_t *con, xcb_window_t w) {
  xcb_get_window_attributes_cookie_t c;
  xcb_get_window_attributes_reply_t *r;
  c = xcb_get_window_attributes(con, w);
  r = xcb_get_window_attributes_reply(con, c, NULL);
  if (r == NULL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <xcb_get_window_attributes@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <xcb_get_window_attributes_reply@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1169 <exists+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1170 <exists+0x50>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exists>:
push   %rbx
mov    %rdi,%rbx
call   1040 <xcb_get_window_attributes@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1030 <xcb_get_window_attributes_reply@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @exists(i32* %0, i32 %1) {
%3 = tail call i32 @xcb_get_window_attributes(i32* %0, i32 %1)
%4 = tail call i32* @xcb_get_window_attributes_reply(i32* %0, i32 %3, i32* null)
%5 = icmp ne i32* %4, null
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int SIGALRM;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ signal(int, void (*)(int));
void handler(int s) {
  if (s != SIGALRM) {
    printf("Received unhandled signal %d\n", s);
    exit(1);
  }
  printf("Alarm!\n");
  signal(SIGALRM, handler);
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
je     1168 <handler+0x38>
mov    -0x4(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e6b(%rip),%rax
mov    (%rax),%edi
mov    0x2e5a(%rip),%rsi
call   1040 <signal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    0x2ea0(%rip),%rbx
cmp    %edi,(%rbx)
jne    1167 <handler+0x27>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
mov    0x2e7f(%rip),%rsi
pop    %rbx
jmp    1050 <signal@plt>
mov    %edi,%esi
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
@.str = [30 x i8] c"Received unhandled signal %d\0A\00"
@.str.1 = [8 x i8] c"Alarm!\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGALRM
%5 = icmp ne i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @SIGALRM
%13 = call i32 @signal(i32 %12, void (i32)* @handler)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
@.str = [30 x i8] c"Received unhandled signal %d\0A\00"
@str = [7 x i8] c"Alarm!\00"
define void @handler(i32 %0) {
%2 = load i32, i32* @SIGALRM
%3 = icmp eq i32 %2, %0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %0)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%9 = load i32, i32* @SIGALRM
%10 = tail call i32 @signal(i32 %9, void (i32)* @handler)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "  it must be to parameter\n"
                  "  -s|--str_name    the string be check\n"
                  "  -c|--chr         the char to check\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [103 x i8] c" it must be to parameter\0A -s|--str_name the string be check\0A -c|--chr the char to check\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [103 x i8] c" it must be to parameter\0A -s|--str_name the string be check\0A -c|--chr the char to check\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([103 x i8], [103 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, void const *);
void assert_is_null(const void *p) {
  if (p) {
    printf("Expected: NULL, but was %p\n", p);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<assert_is_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1155 <assert_is_null+0x35>
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_is_null>:
test   %rdi,%rdi
jne    1126 <assert_is_null+0x6>
ret
push   %rax
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Expected: NULL, but was %p\0A\00"
@EXIT_FAILURE = global i32 0
define void @assert_is_null(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Expected: NULL, but was %p\0A\00"
@EXIT_FAILURE = global i32 0
define void @assert_is_null(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: convbdf [options] [input-files]\n"
          "       convbdf [options] [-o output-file] [single-input-file]\n"
          "Options:\n"
          "    -c     Convert .bdf to .c source file\n"
          "    -f     Convert .bdf to .fnt font file\n"
          "    -s N   Start output at character encodings >= N\n"
          "    -l N   Limit output to character encodings <= N\n"
          "    -x N-M Exclude character range N...M\n"
          "    -u N   Use code N as default char \n"
          "    -a N   Decrease ascent by N\n"
          "    -d N   Decrease descent by N\n"
          "    -n     Don't generate bitmaps as comments in .c file\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [501 x i8] c"Usage: convbdf [options] [input-files]\0A convbdf [options] [-o output-file] [single-input-file]\0AOptions:\0A -c Convert .bdf to .c source file\0A -f Convert .bdf to .fnt font file\0A -s N Start output at character encodings >= N\0A -l N Limit output to character encodings <= N\0A -x N-M Exclude character range N...M\0A -u N Use code N as default char \0A -a N Decrease ascent by N\0A -d N Decrease descent by N\0A -n Don't generate bitmaps as comments in .c file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([501 x i8], [501 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [501 x i8] c"Usage: convbdf [options] [input-files]\0A convbdf [options] [-o output-file] [single-input-file]\0AOptions:\0A -c Convert .bdf to .c source file\0A -f Convert .bdf to .fnt font file\0A -s N Start output at character encodings >= N\0A -l N Limit output to character encodings <= N\0A -x N-M Exclude character range N...M\0A -u N Use code N as default char \0A -a N Decrease ascent by N\0A -d N Decrease descent by N\0A -n Don't generate bitmaps as comments in .c file\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([501 x i8], [501 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef size_t uint8_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
uint8_t is_in_array(uint16_t *port_array, uint8_t max, uint16_t port) {
  uint8_t i = 0;
  for (i = 0; i < max; i++) {
    if (port_array[i] == port)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_in_array>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1167 <is_in_array+0x67>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
cmp    -0x20(%rbp),%rax
jne    1151 <is_in_array+0x51>
movq   $0x1,-0x8(%rbp)
jmp    116f <is_in_array+0x6f>
jmp    1156 <is_in_array+0x56>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1120 <is_in_array+0x20>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_array>:
xor    %eax,%eax
test   %rsi,%rsi
je     111f <is_in_array+0x1f>
xor    %ecx,%ecx
nopl   0x0(%rax)
cmp    %rdx,(%rdi,%rcx,8)
je     1120 <is_in_array+0x20>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <is_in_array+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i64 @is_in_array(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %1, 0
br i1 %4, label %13, label %7
5: ; preds = %7
%6 = icmp eq i64 %12, %1
br i1 %6, label %13, label %7
7: ; preds = %3, %5
%8 = phi i64 [ %12, %5 ], [ 0, %3 ]
%9 = getelementptr inbounds i64, i64* %0, i64 %8
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, %2
%12 = add nuw i64 %8, 1
br i1 %11, label %13, label %5
13: ; preds = %7, %5, %3
%14 = phi i64 [ 0, %3 ], [ 0, %5 ], [ 1, %7 ]
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t gap_event_security_level_get_security_level(const uint8_t *event) {
  return event[4];
}


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

x86 assembly (clang, -O2):
<gap_event_security_level_get_security_level>:
mov    0x10(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @gap_event_security_level_get_security_level(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gui_set_label_color(int, int, int);
void gui_update_rec_mode(int mode) {
  switch (mode) {
  case 1:
    gui_set_label_color(3, 0xffff0000, 0xff000000);
    break;
  case 2:
    gui_set_label_color(3, 0xffff0000, 0xff000000);
    break;
  case 3:
    gui_set_label_color(3, 0xffff0000, 0xff000000);
    break;
  case 0:
  default:
    gui_set_label_color(3, 0xff990000, 0xff000000);
    break;
  }
}


x86 assembly (clang, -O0):
<gui_update_rec_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x3,%rax
ja     1190 <gui_update_rec_mode+0x80>
mov    -0x10(%rbp),%rax
lea    0xec9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x3,%edi
mov    $0xffff0000,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
jmp    11a4 <gui_update_rec_mode+0x94>
mov    $0x3,%edi
mov    $0xffff0000,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
jmp    11a4 <gui_update_rec_mode+0x94>
mov    $0x3,%edi
mov    $0xffff0000,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
jmp    11a4 <gui_update_rec_mode+0x94>
jmp    1190 <gui_update_rec_mode+0x80>
mov    $0x3,%edi
mov    $0xff990000,%esi
mov    $0xff000000,%edx
call   1030 <gui_set_label_color@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_update_rec_mode>:
add    $0xffffffff,%edi
cmp    $0x3,%edi
mov    $0xffff0000,%eax
mov    $0xff990000,%esi
cmovb  %eax,%esi
mov    $0x3,%edi
mov    $0xff000000,%edx
jmp    1030 <gui_set_label_color@plt>

LLVM IR (-O0):
define void @gui_update_rec_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %11 [
i32 1, label %4
i32 2, label %6
i32 3, label %8
i32 0, label %10
]
4: ; preds = %1
%5 = call i32 @gui_set_label_color(i32 3, i32 -65536, i32 -16777216)
br label %13
6: ; preds = %1
%7 = call i32 @gui_set_label_color(i32 3, i32 -65536, i32 -16777216)
br label %13
8: ; preds = %1
%9 = call i32 @gui_set_label_color(i32 3, i32 -65536, i32 -16777216)
br label %13
10: ; preds = %1
br label %11
11: ; preds = %1, %10
%12 = call i32 @gui_set_label_color(i32 3, i32 -6750208, i32 -16777216)
br label %13
13: ; preds = %11, %8, %6, %4
ret void
}

LLVM IR (-O2):
define void @gui_update_rec_mode(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
%4 = select i1 %3, i32 -65536, i32 -6750208
%5 = tail call i32 @gui_set_label_color(i32 3, i32 %4, i32 -16777216)
ret void
}
falsecmd(argc, argv) char **argv;
{ return 1; }


x86 assembly (clang, -O0):
<falsecmd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @falsecmd(i32 %0, i8** nocapture readnone %1) {
ret i32 1
}
unsigned kol_system_date_get() { asm("int $0x40" ::"a"(29)); }


x86 assembly (clang, -O0):
<kol_system_date_get>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%eax
int    $0x40
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_system_date_get>:
mov    $0x1d,%eax
int    $0x40
ret

LLVM IR (-O0):
define i32 @kol_system_date_get() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @kol_system_date_get() {
tail call void asm sideeffect "int $$0x40", "{ax},~{dirflag},~{fpsr},~{flags}"(i32 29)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int searcher(char *url, char *sub) {
  if (strstr(url, sub) != NULL) {
    return 1;
  } else {
    return 2;
  }
}


x86 assembly (clang, -O0):
<searcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1143 <searcher+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <searcher+0x3a>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<searcher>:
push   %rax
call   1030 <strstr@plt>
cmp    $0x1,%rax
mov    $0x1,%eax
adc    $0x0,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @searcher(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i32* %3, null
%5 = select i1 %4, i32 2, i32 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverseWords(char *);
int main(int argc, char *argv[]) {
  char str[] = "This is a reverse string example.";
  reverseWords(str);
  printf("%s\n", str);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x2e,0x20(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <reverseWords@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [34 x i8] c"This is a reverse string example.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [34 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [34 x i8]* %6 to i8*
%8 = getelementptr inbounds [34 x i8], [34 x i8]* %6, i64 0, i64 0
%9 = call i32 @reverseWords(i8* %8)
%10 = getelementptr inbounds [34 x i8], [34 x i8]* %6, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [34 x i8] c"This is a reverse string example.\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [34 x i8]
%4 = getelementptr inbounds [34 x i8], [34 x i8]* %3, i64 0, i64 0
%5 = call i32 @reverseWords(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}