xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ *strstr(char *, char *);
int contains(char *str, char *key) { return strstr(str, key) != NULL; }


x86 assembly (clang, -O0):
<contains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @contains(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32* @strstr(i8* %5, i8* %6)
%8 = icmp ne i32* %7, null
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @contains(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
signed char getFilter(char *buf, long unit) {
  return (*(buf + 4 + unit) >> 4) & 0x03;
}


x86 assembly (clang, -O0):
<getFilter>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl 0x4(%rax,%rcx,1),%eax
sar    $0x4,%eax
and    $0x3,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFilter>:
mov    0x4(%rdi,%rsi,1),%al
shr    $0x4,%al
and    $0x3,%al
ret

LLVM IR (-O0):
define signext i8 @getFilter(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 4
%7 = load i64, i64* %4
%8 = getelementptr inbounds i8, i8* %6, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = ashr i32 %10, 4
%12 = and i32 %11, 3
%13 = trunc i32 %12 to i8
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @getFilter(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 4
%4 = getelementptr inbounds i8, i8* %3, i64 %1
%5 = load i8, i8* %4
%6 = lshr i8 %5, 4
%7 = and i8 %6, 3
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ LCD_Out(int, int, char);
int /*<<< orphan*/ limpamlc();
int /*<<< orphan*/ mostrapenter(char);
int /*<<< orphan*/ sprintf(char, char *);
void fraseoito(char plinha, char penter) {
  limpamlc();
  sprintf(plinha, "8: Guarana");
  LCD_Out(1, 4, plinha);
  mostrapenter(penter);
}


x86 assembly (clang, -O0):
<fraseoito>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x0,%al
call   1030 <limpamlc@plt>
lea    0xe9e(%rip),%rsi
movsbl -0x1(%rbp),%edi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    $0x4,%esi
movsbl -0x1(%rbp),%edx
call   1040 <LCD_Out@plt>
movsbl -0x2(%rbp),%edi
call   1060 <mostrapenter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fraseoito>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <limpamlc@plt>
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
call   1050 <sprintf@plt>
mov    $0x1,%edi
mov    $0x4,%esi
mov    %ebp,%edx
call   1040 <LCD_Out@plt>
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mostrapenter@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"8: Guarana\00"
define void @fraseoito(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = call i32 (...) @limpamlc()
%6 = load i8, i8* %3
%7 = call i32 @sprintf(i8 signext %6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = load i8, i8* %3
%9 = call i32 @LCD_Out(i32 1, i32 4, i8 signext %8)
%10 = load i8, i8* %4
%11 = call i32 @mostrapenter(i8 signext %10)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"8: Guarana\00"
define void @fraseoito(i8 signext %0, i8 signext %1) {
%3 = tail call i32 (...) @limpamlc()
%4 = tail call i32 @sprintf(i8 signext %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @LCD_Out(i32 1, i32 4, i8 signext %0)
%6 = tail call i32 @mostrapenter(i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void virtual_mcu_GlobalInterrupts_disable__E() {
  printf("GlobalInterrupts disable\n");
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"GlobalInterrupts disable\0A\00"
define void @virtual_mcu_GlobalInterrupts_disable__E() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"GlobalInterrupts disable\00"
define void @virtual_mcu_GlobalInterrupts_disable__E() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
void ft_free_file(char **file) {
  int y;
  y = -1;
  while (file[++y])
    free(file[y]);
  free(file);
}


x86 assembly (clang, -O0):
<ft_free_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1154 <ft_free_file+0x44>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
jmp    1123 <ft_free_file+0x13>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_free_file>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1141 <ft_free_file+0x31>
lea    0x8(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <ft_free_file+0x20>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ft_free_file(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %9, %4 ], [ %2, %1 ]
tail call void @free(i8* %6)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = bitcast i8** %0 to i8*
tail call void @free(i8* %12)
ret void
}
int terminator_bits(const int version) {
  if (version < 41) {
    return 4;
  }
  if (version < 73) {
    return 3;
  }
  return 3 + (version - 73) * 2;
}


x86 assembly (clang, -O0):
<terminator_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x29,-0x8(%rbp)
jge    111d <terminator_bits+0x1d>
movl   $0x4,-0x4(%rbp)
jmp    1142 <terminator_bits+0x42>
cmpl   $0x49,-0x8(%rbp)
jge    1133 <terminator_bits+0x33>
movl   $0x3,-0x4(%rbp)
jmp    1142 <terminator_bits+0x42>
mov    -0x8(%rbp),%eax
sub    $0x49,%eax
shl    $0x1,%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminator_bits>:
mov    $0x4,%eax
cmp    $0x29,%edi
jl     111c <terminator_bits+0x1c>
mov    $0x3,%eax
cmp    $0x49,%edi
jb     111c <terminator_bits+0x1c>
lea    (%rdi,%rdi,1),%eax
add    $0xffffff71,%eax
ret

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

LLVM IR (-O2):
define i32 @terminator_bits(i32 %0) {
%2 = icmp slt i32 %0, 41
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 73
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = shl nuw i32 %0, 1
%7 = add i32 %6, -143
br label %8
8: ; preds = %3, %1, %5
%9 = phi i32 [ %7, %5 ], [ 4, %1 ], [ 3, %3 ]
ret i32 %9
}
/* Variables and functions */
char const *ll_idx_n2a(unsigned int, char *);
const char *ll_index_to_name(unsigned idx) {
  static char nbuf[16];
  return ll_idx_n2a(idx, nbuf);
}


x86 assembly (clang, -O0):
<ll_index_to_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    0x2f1b(%rip),%rsi
call   1030 <ll_idx_n2a@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ll_index_to_name.nbuf = internal global [16 x i8] zeroinitializer
define i8* @ll_index_to_name(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @ll_idx_n2a(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ll_index_to_name.nbuf, i64 0, i64 0))
ret i8* %4
}

LLVM IR (-O2):
@ll_index_to_name.nbuf = internal global [16 x i8] zeroinitializer
define i8* @ll_index_to_name(i32 %0) {
%2 = tail call i8* @ll_idx_n2a(i32 %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @ll_index_to_name.nbuf, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ callee(int *);
int caller() {
  int temp;
  callee(&temp);
}


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

x86 assembly (clang, -O2):
<caller>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <callee@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @caller() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @callee(i32* %2)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @caller() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @callee(i32* %1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_usage() {
  printf("Usage: sbsdump [OPTION]... hostname\n"
         "Dump data in SBS format from a socket.\n"
         "  -c show only aircrafts with a callsign in spotting mode\n"
         "  -h display this help and exit\n"
         "  -l log aircrafts into a data base when in spotting mode\n"
         "  -p set port (default 30003)\n"
         "  -r show messages in raw format\n"
         "  -s show only new aircrafts excluding dups (spotting mode)\n");
}


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

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

LLVM IR (-O0):
@.str = [347 x i8] c"Usage: sbsdump [OPTION]... hostname\0ADump data in SBS format from a socket.\0A -c show only aircrafts with a callsign in spotting mode\0A -h display this help and exit\0A -l log aircrafts into a data base when in spotting mode\0A -p set port (default 30003)\0A -r show messages in raw format\0A -s show only new aircrafts excluding dups (spotting mode)\0A\00"
define void @show_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([347 x i8], [347 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [346 x i8] c"Usage: sbsdump [OPTION]... hostname\0ADump data in SBS format from a socket.\0A -c show only aircrafts with a callsign in spotting mode\0A -h display this help and exit\0A -l log aircrafts into a data base when in spotting mode\0A -p set port (default 30003)\0A -r show messages in raw format\0A -s show only new aircrafts excluding dups (spotting mode)\00"
define void @show_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([346 x i8], [346 x i8]* @str, i64 0, i64 0))
ret void
}
void system_soft_wdt_restart() {}


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

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

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

LLVM IR (-O2):
define void @system_soft_wdt_restart() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xfree(int *);
void supprimer_element(int *element) { xfree(element); }


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

x86 assembly (clang, -O2):
<supprimer_element>:
jmp    1030 <xfree@plt>

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

LLVM IR (-O2):
define void @supprimer_element(i32* %0) {
%2 = tail call i32 @xfree(i32* %0)
ret void
}
isupper(c) char c;
{
  if (c >= 'A' & c <= 'Z')
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x5(%rbp),%ecx
cmp    $0x5a,%ecx
setle  %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1140 <isupper+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <isupper+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
shl    $0x18,%edi
add    $0xbfffffff,%edi
xor    %eax,%eax
cmp    $0x1affffff,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 65
%8 = zext i1 %7 to i32
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
%12 = zext i1 %11 to i32
%13 = and i32 %8, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %1
store i32 1, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @isupper(i32 %0) {
%2 = shl i32 %0, 24
%3 = add i32 %2, -1073741825
%4 = icmp ult i32 %3, 452984831
%5 = zext i1 %4 to i32
ret i32 %5
}
float fmodf(float x, float y) {
  float res = 0.0F;
  asm("1:\tfprem\n\t"
      "fstsw   %%ax\n\t"
      "sahf\n\t"
      "jp      1b\n\t"
      "fstp    %%st(1)"
      : "=t"(res)
      : "0"(x), "u"(y)
      : "ax", "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<fmodf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
flds   -0x10(%rbp)
flds   -0x14(%rbp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     1132 <fmodf+0x32>
fstp   %st(1)
fstps  -0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fmodf>:
movss  %xmm0,-0x4(%rsp)
movss  %xmm1,-0x8(%rsp)
flds   -0x4(%rsp)
flds   -0x8(%rsp)
fxch   %st(1)
fprem
fstsw  %ax
sahf
jp     1116 <fmodf+0x16>
fstp   %st(1)
fstps  -0xc(%rsp)
movss  -0xc(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @fmodf(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
store float 0.000000e+00, float* %5
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float asm "1:\09fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b\0A\09fstp %st(1)", "={st},0,{st(1)},~{ax},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @fmodf(float %0, float %1) {
%3 = tail call float asm "1:\09fprem\0A\09fstsw %ax\0A\09sahf\0A\09jp 1b\0A\09fstp %st(1)", "={st},0,{st(1)},~{ax},~{st(1)},~{dirflag},~{fpsr},~{flags}"(float %0, float %1)
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ LED_GetState();
int /*<<< orphan*/ LED_Init(int, int /*<<< orphan*/);
int /*<<< orphan*/ LED_SetState(int);
int /*<<< orphan*/ delay(int);
int main() {
  LED_Init(15, 0);
  while (1) {
    LED_SetState(!LED_GetState());
    delay(400);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <LED_Init@plt>
mov    $0x0,%al
call   1040 <LED_GetState@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x6(%rbp)
and    $0x1,%al
mov    %al,-0x5(%rbp)
movzbl %al,%edi
call   1060 <LED_SetState@plt>
mov    $0x190,%edi
call   1050 <delay@plt>
jmp    115b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
xor    %esi,%esi
call   1030 <LED_Init@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <LED_GetState@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <LED_SetState@plt>
mov    $0x190,%edi
call   1050 <delay@plt>
jmp    1150 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @LED_Init(i32 15, i32 0)
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @LED_GetState()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @LED_SetState(i32 %7)
%9 = call i32 @delay(i32 400)
br label %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @LED_Init(i32 15, i32 0)
br label %2
2: ; preds = %0, %2
%3 = tail call i32 (...) @LED_GetState()
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @LED_SetState(i32 %5)
%7 = tail call i32 @delay(i32 400)
br label %2
}
/* Variables and functions */
int analyzefrequencies(double *);
int /*<<< orphan*/ dec(char const *, int);
int /*<<< orphan*/ free(double *);
double *letterfreq(char const *);
void decrypt(const char *message) {
  double *freqcount = letterfreq(message);
  int probablekey = analyzefrequencies(freqcount);
  free(freqcount);
  dec(message, probablekey);
}


x86 assembly (clang, -O0):
<decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <letterfreq@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <analyzefrequencies@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <dec@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1060 <letterfreq@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <analyzefrequencies@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <dec@plt>

LLVM IR (-O0):
define void @decrypt(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call double* @letterfreq(i8* %5)
store double* %6, double** %3
%7 = load double*, double** %3
%8 = call i32 @analyzefrequencies(double* %7)
store i32 %8, i32* %4
%9 = load double*, double** %3
%10 = call i32 @free(double* %9)
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = call i32 @dec(i8* %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @decrypt(i8* %0) {
%2 = tail call double* @letterfreq(i8* %0)
%3 = tail call i32 @analyzefrequencies(double* %2)
%4 = tail call i32 @free(double* %2)
%5 = tail call i32 @dec(i8* %0, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int pthread_mutex_lock(int /*<<< orphan*/ *);
int el_mutex_lock(void *hmutex) {
  return pthread_mutex_lock((pthread_mutex_t *)hmutex);
}


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

x86 assembly (clang, -O2):
<el_mutex_lock>:
jmp    1030 <pthread_mutex_lock@plt>

LLVM IR (-O0):
define i32 @el_mutex_lock(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = call i32 @pthread_mutex_lock(i32* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @el_mutex_lock(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @pthread_mutex_lock(i32* %2)
ret i32 %3
}
void set_window_name(char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @set_window_name(i8* nocapture %0, ...) {
ret void
}
void X509_CRL_INFO_free(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CRL_INFO_free() {
ret void
}
void gpioFree() { ; }


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

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

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

LLVM IR (-O2):
define void @gpioFree() {
ret void
}
void _zbar_refcnt_init(void) {}


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

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

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

LLVM IR (-O2):
define void @_zbar_refcnt_init() {
ret void
}
unsigned int f41(unsigned int x, unsigned int y) {
  return (x >> y) | (x << ((-y) & (8 * sizeof(unsigned int) - 1)));
}


x86 assembly (clang, -O0):
<f41>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    -0x4(%rbp),%edx
xor    %ecx,%ecx
sub    -0x8(%rbp),%ecx
mov    %ecx,%ecx
and    $0x1f,%rcx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f41>:
mov    %esi,%ecx
mov    %edi,%eax
ror    %cl,%eax
ret

LLVM IR (-O0):
define i32 @f41(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = lshr i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 0, %9
%11 = zext i32 %10 to i64
%12 = and i64 %11, 31
%13 = trunc i64 %12 to i32
%14 = shl i32 %8, %13
%15 = or i32 %7, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @f41(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = sub i32 0, %1
%5 = and i32 %4, 31
%6 = shl i32 %0, %5
%7 = or i32 %6, %3
ret i32 %7
}
__attribute__((always_)) int brotli_min_int(int a, int b) {
  return a < b ? a : b;
}


x86 assembly (clang, -O0):
<brotli_min_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1121 <brotli_min_int+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <brotli_min_int+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<brotli_min_int>:
mov    %esi,%eax
cmp    %esi,%edi
cmovl  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @brotli_min_int(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void pal_mem_free(void *Buffer) { free(Buffer); }


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

x86 assembly (clang, -O2):
<pal_mem_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @pal_mem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
scalar_t__ rozofs_get_service_port_export_master_diag();
uint16_t rozofs_get_service_port_export_slave_diag(int idx) {
  return rozofs_get_service_port_export_master_diag() + idx;
}


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

x86 assembly (clang, -O2):
<rozofs_get_service_port_export_slave_diag>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rozofs_get_service_port_export_master_diag@plt>
movslq %ebx,%rcx
add    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @rozofs_get_service_port_export_slave_diag(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i64 (...) @rozofs_get_service_port_export_master_diag()
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = add nsw i64 %3, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @rozofs_get_service_port_export_slave_diag(i32 %0) {
%2 = tail call i64 (...) @rozofs_get_service_port_export_master_diag()
%3 = sext i32 %0 to i64
%4 = add nsw i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ get();
int /*<<< orphan*/ put();
int main(int argc, char **argv) {
  put();
  get();
  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)
mov    $0x0,%al
call   1030 <put@plt>
mov    $0x0,%al
call   1040 <get@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <put@plt>
xor    %eax,%eax
call   1040 <get@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @put()
%7 = call i32 (...) @get()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @put()
%4 = tail call i32 (...) @get()
ret i32 0
}
void kol_wnd_caption(char *s) { asm("int $0x40" ::"a"(71), "b"(1), "c"(s)); }


x86 assembly (clang, -O0):
<kol_wnd_caption>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x47,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<kol_wnd_caption>:
push   %rbx
mov    %rdi,%rcx
mov    $0x47,%eax
mov    $0x1,%ebx
int    $0x40
pop    %rbx
ret

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

LLVM IR (-O2):
define void @kol_wnd_caption(i8* %0) {
tail call void asm sideeffect "int $$0x40", "{ax},{bx},{cx},~{dirflag},~{fpsr},~{flags}"(i32 71, i32 1, i8* %0)
ret void
}
/* Type definitions */
struct stat {
  long long st_size;
};

/* Variables and functions */
scalar_t__ fstat(int, struct stat *);
long long get_file_size(int filedes) {
  struct stat st;
  if (fstat(filedes, &st) < 0)
    return -1;
  else
    return st.st_size;
}


x86 assembly (clang, -O0):
<get_file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1030 <fstat@plt>
cmp    $0x0,%rax
jge    113e <get_file_size+0x2e>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1146 <get_file_size+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_file_size>:
push   %rax
mov    %rsp,%rsi
call   1030 <fstat@plt>
mov    %rax,%rcx
mov    $0xffffffffffffffff,%rax
test   %rcx,%rcx
js     112c <get_file_size+0x1c>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @get_file_size(i32 %0) {
%2 = alloca i64
%3 = alloca i32
%4 = alloca %struct.stat
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i64 @fstat(i32 %5, %struct.stat* %4)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i64 -1, i64* %2
br label %12
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i64, i64* %10
store i64 %11, i64* %2
br label %12
12: ; preds = %9, %8
%13 = load i64, i64* %2
ret i64 %13
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @get_file_size(i32 %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @fstat(i32 %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, -1
%8 = select i1 %7, i64 %6, i64 -1
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ mpgdecoder_init(void *);
void default_mpgdecoder_init(void *ctx) { mpgdecoder_init(ctx); }


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

x86 assembly (clang, -O2):
<default_mpgdecoder_init>:
jmp    1030 <mpgdecoder_init@plt>

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

LLVM IR (-O2):
define void @default_mpgdecoder_init(i8* %0) {
%2 = tail call i32 @mpgdecoder_init(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fscanf(int /*<<< orphan*/ *, char *, char *);
char is_task(FILE *file) {
  char x;
  int res = fscanf(file, "- [%c]%*[ ]", &x);
  if (res == 1 && (x == ' ' || x == 'x'))
    return x;
  return 0;
}


x86 assembly (clang, -O0):
<is_task>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x11(%rbp),%rdx
call   1030 <fscanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jne    1162 <is_task+0x52>
movsbl -0x11(%rbp),%eax
cmp    $0x20,%eax
je     1157 <is_task+0x47>
movsbl -0x11(%rbp),%eax
cmp    $0x78,%eax
jne    1162 <is_task+0x52>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1166 <is_task+0x56>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_task>:
push   %rax
lea    0xee8(%rip),%rsi
lea    0x7(%rsp),%rdx
call   1030 <fscanf@plt>
cmp    $0x1,%eax
jne    1142 <is_task+0x32>
mov    0x7(%rsp),%al
cmp    $0x20,%al
sete   %cl
shl    $0x5,%cl
cmp    $0x78,%al
movzbl %cl,%ecx
mov    $0x78,%eax
cmovne %ecx,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"- [%c]%*[ ]\00"
define signext i8 @is_task(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fscanf(i32* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %20
10: ; preds = %1
%11 = load i8, i8* %4
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 32
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 120
br i1 %17, label %18, label %20
18: ; preds = %14, %10
%19 = load i8, i8* %4
store i8 %19, i8* %2
br label %21
20: ; preds = %14, %1
store i8 0, i8* %2
br label %21
21: ; preds = %20, %18
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
@.str = [12 x i8] c"- [%c]%*[ ]\00"
define signext i8 @is_task(i32* nocapture %0) {
%2 = alloca i8
%3 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i8, i8* %2
%7 = icmp eq i8 %6, 32
%8 = select i1 %7, i8 32, i8 0
%9 = icmp eq i8 %6, 120
%10 = select i1 %9, i8 120, i8 %8
br label %11
11: ; preds = %1, %5
%12 = phi i8 [ %10, %5 ], [ 0, %1 ]
ret i8 %12
}
/* Variables and functions */
int /*<<< orphan*/ iothub_registrymanager_sample_run();
int main(void) {
  iothub_registrymanager_sample_run();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @iothub_registrymanager_sample_run()
ret i32 0
}
trputs(s) char *s;
{}


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

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

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

LLVM IR (-O2):
define i32 @trputs(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ bucketsort(double *, int);
void sort(double array[], int array_size) { bucketsort(array, array_size); }


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

x86 assembly (clang, -O2):
<sort>:
jmp    1030 <bucketsort@plt>

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

LLVM IR (-O2):
define void @sort(double* %0, i32 %1) {
%3 = tail call i32 @bucketsort(double* %0, i32 %1)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};

/* Variables and functions */
size_t strftime(char *restrict s, size_t maxsize, const char *restrict format,
                const struct tm *restrict timeptr) {
  return 0;
}


x86 assembly (clang, -O0):
<strftime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.tm = type { i32 }
define i64 @strftime(i8* noalias %0, i64 %1, i8* noalias %2, %struct.tm* noalias %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca %struct.tm*
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store %struct.tm* %3, %struct.tm** %8
ret i64 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i64 @strftime(i8* noalias nocapture readnone %0, i64 %1, i8* noalias nocapture readnone %2, %struct.tm* noalias nocapture readnone %3) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ board_flash_get_datafs_size();
int /*<<< orphan*/ dbg(char *, ...);
int /*<<< orphan*/ sysGetPsiSize();
int /*<<< orphan*/ sysPersistentSet(char *, int /*<<< orphan*/,
                                    int /*<<< orphan*/);
int board_flash_write_datafs(char *buf, int buf_size) {
  dbg("sysGetPsiSize(): %d\n", sysGetPsiSize());
  dbg("flashing...\n");
  sysPersistentSet(buf, board_flash_get_datafs_size(), 0);
  return 1;
}


x86 assembly (clang, -O0):
<board_flash_write_datafs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <sysGetPsiSize@plt>
mov    %eax,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <dbg@plt>
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1040 <dbg@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <board_flash_get_datafs_size@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1050 <sysPersistentSet@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<board_flash_write_datafs>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <sysGetPsiSize@plt>
lea    0xeae(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <dbg@plt>
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <dbg@plt>
xor    %eax,%eax
call   1060 <board_flash_get_datafs_size@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %edx,%edx
call   1050 <sysPersistentSet@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"sysGetPsiSize(): %d\0A\00"
@.str.1 = [13 x i8] c"flashing...\0A\00"
define i32 @board_flash_write_datafs(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (...) @sysGetPsiSize()
%6 = call i32 (i8*, ...) @dbg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 (i8*, ...) @dbg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %3
%9 = call i32 (...) @board_flash_get_datafs_size()
%10 = call i32 @sysPersistentSet(i8* %8, i32 %9, i32 0)
ret i32 1
}

LLVM IR (-O2):
@.str = [21 x i8] c"sysGetPsiSize(): %d\0A\00"
@.str.1 = [13 x i8] c"flashing...\0A\00"
define i32 @board_flash_write_datafs(i8* %0, i32 %1) {
%3 = tail call i32 (...) @sysGetPsiSize()
%4 = tail call i32 (i8*, ...) @dbg(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, ...) @dbg(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @board_flash_get_datafs_size()
%7 = tail call i32 @sysPersistentSet(i8* %0, i32 %6, i32 0)
ret i32 1
}
char *ev_api_name(void) { return "select"; }


x86 assembly (clang, -O0):
<ev_api_name>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ev_api_name>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"select\00"
define i8* @ev_api_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"select\00"
define i8* @ev_api_name() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
void INT3_intr(void) {}


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

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

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

LLVM IR (-O2):
define void @INT3_intr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1;
  f(i);
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f@plt>
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <f@plt>
lea    0xece(%rip),%rdi
mov    $0x1,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
struct btf_type {
  int dummy;
};
typedef int /*<<< orphan*/ __u8;
typedef int /*<<< orphan*/ __u32;

/* Variables and functions */
int /*<<< orphan*/ BTF_INT_BITS(int /*<<< orphan*/);
__u8 btf_int_bits(const struct btf_type *t) {
  return BTF_INT_BITS(*(__u32 *)(t + 1));
}


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

x86 assembly (clang, -O2):
<btf_int_bits>:
mov    0x4(%rdi),%edi
jmp    1030 <BTF_INT_BITS@plt>

LLVM IR (-O0):
%struct.btf_type = type { i32 }
define i32 @btf_int_bits(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to i32*
%6 = load i32, i32* %5
%7 = call i32 @BTF_INT_BITS(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
define i32 @btf_int_bits(%struct.btf_type* nocapture %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @BTF_INT_BITS(i32 %3)
ret i32 %4
}
/* Variables and functions */
scalar_t__ isnan(double);
int /*<<< orphan*/ printf(char *);
double weighted_average(double a1, double a2, double weight) {
  double a3 = weight * a1 + (1 - weight) * a2;
  if (isnan(a3)) {
    printf("IS NAN!!!\n");
    a3 = 0;
  }
  return a3;
}


x86 assembly (clang, -O0):
<weighted_average>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xeb7(%rip),%xmm1
subsd  -0x18(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     1188 <weighted_average+0x68>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<weighted_average>:
push   %rax
movsd  0xed7(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm1,%xmm3
mulsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
movsd  %xmm0,(%rsp)
call   1040 <isnan@plt>
movsd  (%rsp),%xmm0
test   %rax,%rax
je     115c <weighted_average+0x3c>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"IS NAN!!!\0A\00"
define double @weighted_average(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%8 = load double, double* %6
%9 = load double, double* %4
%10 = load double, double* %6
%11 = fsub double 1.000000e+00, %10
%12 = load double, double* %5
%13 = fmul double %11, %12
%14 = call double @llvm.fmuladd.f64(double %8, double %9, double %13)
store double %14, double* %7
%15 = load double, double* %7
%16 = call i64 @isnan(double %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %3
%19 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store double 0.000000e+00, double* %7
br label %20
20: ; preds = %18, %3
%21 = load double, double* %7
ret double %21
}

LLVM IR (-O2):
@str = [10 x i8] c"IS NAN!!!\00"
define double @weighted_average(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %4, %1
%6 = tail call double @llvm.fmuladd.f64(double %2, double %0, double %5)
%7 = tail call i64 @isnan(double %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %3
%12 = phi double [ 0.000000e+00, %9 ], [ %6, %3 ]
ret double %12
}
/* Variables and functions */
int strlen(char *);
int /*<<< orphan*/ substr(char *, char *, int, int);
void extension(char *res, char *name) {
  int n, m;
  m = strlen(name);
  n = m;
  do
    n--;
  while (name[n] != '.');
  substr(res, name, n, m - n);
}


x86 assembly (clang, -O0):
<extension>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    1142 <extension+0x22>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
call   1040 <substr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extension>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
movslq %eax,%rcx
lea    (%rcx,%rbx,1),%rdx
add    $0xffffffffffffffff,%rdx
xor    %ecx,%ecx
nop
cmpb   $0x2e,(%rdx,%rcx,1)
lea    -0x1(%rcx),%rcx
jne    1140 <extension+0x20>
add    %ecx,%eax
neg    %ecx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <substr@plt>

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

LLVM IR (-O2):
define void @extension(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = sext i32 %3 to i64
br label %5
5: ; preds = %5, %2
%6 = phi i64 [ %7, %5 ], [ %4, %2 ]
%7 = add i64 %6, -1
%8 = getelementptr inbounds i8, i8* %1, i64 %7
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 46
br i1 %10, label %11, label %5
11: ; preds = %5
%12 = trunc i64 %7 to i32
%13 = sub nsw i32 %3, %12
%14 = tail call i32 @substr(i8* %0, i8* %1, i32 %12, i32 %13)
ret void
}
int verify_benchmark(int r) {
  int expected = 4950;
  if (r != expected)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<verify_benchmark>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1356,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1126 <verify_benchmark+0x26>
movl   $0x0,-0x4(%rbp)
jmp    112d <verify_benchmark+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_benchmark>:
xor    %eax,%eax
cmp    $0x1356,%edi
sete   %al
ret

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

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