xunge/DecIR huggingface dataset:
int bar() {
  int result = 0;
  for (int i = 0; i < 5566; ++i) {
    result += 1;
  }
  return result;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x15be,-0x8(%rbp)
jge    1136 <bar+0x36>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <bar+0x12>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @bar() {
ret i32 5566
}
/* Type definitions */
struct flashctx {
  int dummy;
};

/* Variables and functions */
int erase_block_82802ab(struct flashctx *, unsigned int, unsigned int);
int stm50_erase_sector(struct flashctx *, unsigned int);
int erase_sector_stm50(struct flashctx *flash, unsigned int addr,
                       unsigned int len) {
  if (len == 4096)
    return stm50_erase_sector(flash, addr);
  else
    return erase_block_82802ab(flash, addr, len);
}


x86 assembly (clang, -O0):
<erase_sector_stm50>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x1000,-0x18(%rbp)
jne    1153 <erase_sector_stm50+0x33>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <stm50_erase_sector@plt>
mov    %eax,-0x4(%rbp)
jmp    1165 <erase_sector_stm50+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <erase_block_82802ab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<erase_sector_stm50>:
cmp    $0x1000,%edx
jne    112d <erase_sector_stm50+0xd>
jmp    1040 <stm50_erase_sector@plt>
jmp    1030 <erase_block_82802ab@plt>

LLVM IR (-O0):
%struct.flashctx = type { i32 }
define i32 @erase_sector_stm50(%struct.flashctx* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.flashctx*
%6 = alloca i32
%7 = alloca i32
store %struct.flashctx* %0, %struct.flashctx** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %7
%9 = icmp eq i32 %8, 4096
br i1 %9, label %10, label %14
10: ; preds = %3
%11 = load %struct.flashctx*, %struct.flashctx** %5
%12 = load i32, i32* %6
%13 = call i32 @stm50_erase_sector(%struct.flashctx* %11, i32 %12)
store i32 %13, i32* %4
br label %19
14: ; preds = %3
%15 = load %struct.flashctx*, %struct.flashctx** %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = call i32 @erase_block_82802ab(%struct.flashctx* %15, i32 %16, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %14, %10
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
%struct.flashctx = type { i32 }
define i32 @erase_sector_stm50(%struct.flashctx* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %2, 4096
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @stm50_erase_sector(%struct.flashctx* %0, i32 %1)
br label %9
7: ; preds = %3
%8 = tail call i32 @erase_block_82802ab(%struct.flashctx* %0, i32 %1, i32 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
int string_to_char(const char **stringp) {
  int result;
  const char *string = *stringp;
  result = ((unsigned char)(*string));
  *stringp += 1;
  return result;
}


x86 assembly (clang, -O0):
<string_to_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_to_char>:
mov    (%rdi),%rcx
movzbl (%rcx),%eax
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

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

LLVM IR (-O2):
define i32 @string_to_char(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %5, i8** %0
ret i32 %4
}
/* Variables and functions */
int abs(int);
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ puti(int);
void putf(double x) {
  int dec = (int)x;
  int fra = abs((int)((x - dec) * 1000000));
  puti(dec);
  putc('.');
  puti(fra);
}


x86 assembly (clang, -O0):
<putf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
subsd  %xmm1,%xmm0
movsd  0xea5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <puti@plt>
mov    $0x2e,%edi
call   1040 <putc@plt>
mov    -0x10(%rbp),%edi
call   1050 <puti@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putf>:
push   %rbx
cvttsd2si %xmm0,%edi
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm1
subsd  %xmm1,%xmm0
mulsd  0xec7(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,%ebx
neg    %ebx
cmovs  %eax,%ebx
call   1040 <puti@plt>
mov    $0x2e,%edi
call   1030 <putc@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <puti@plt>

LLVM IR (-O0):
define void @putf(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store double %0, double* %2
%5 = load double, double* %2
%6 = fptosi double %5 to i32
store i32 %6, i32* %3
%7 = load double, double* %2
%8 = load i32, i32* %3
%9 = sitofp i32 %8 to double
%10 = fsub double %7, %9
%11 = fmul double %10, 1.000000e+06
%12 = fptosi double %11 to i32
%13 = call i32 @abs(i32 %12)
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = call i32 @puti(i32 %14)
%16 = call i32 @putc(i8 signext 46)
%17 = load i32, i32* %4
%18 = call i32 @puti(i32 %17)
ret void
}

LLVM IR (-O2):
define void @putf(double %0) {
%2 = fptosi double %0 to i32
%3 = sitofp i32 %2 to double
%4 = fsub double %0, %3
%5 = fmul double %4, 1.000000e+06
%6 = fptosi double %5 to i32
%7 = tail call i32 @llvm.abs.i32(i32 %6, i1 true)
%8 = tail call i32 @puti(i32 %2)
%9 = tail call i32 @putc(i8 signext 46)
%10 = tail call i32 @puti(i32 %7)
ret void
}
void skipLine(char **pIn) {
  while (1) {
    if (**pIn == 0)
      return;
    if (**pIn == '\n') {
      (*pIn)++;
      return;
    }
    (*pIn)++;
  }
}


x86 assembly (clang, -O0):
<skipLine>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1120 <skipLine+0x20>
jmp    1159 <skipLine+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
jne    1146 <skipLine+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1159 <skipLine+0x59>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <skipLine+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipLine>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
movzbl -0x1(%rax),%ecx
test   %cl,%cl
je     1129 <skipLine+0x29>
cmp    $0xa,%cl
je     1126 <skipLine+0x26>
mov    %rax,(%rdi)
jmp    1110 <skipLine+0x10>
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @skipLine(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %1, %8
%4 = phi i8* [ %2, %1 ], [ %9, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %8 [
i8 0, label %10
i8 10, label %6
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %10
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %9, i8** %0
br label %3
10: ; preds = %3, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0xdf() {
  Assert_real((isupper(223) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              1120, ("isupper should be 0 for 0xdf"));
}


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

x86 assembly (clang, -O2):
<t_isupper_0xdf>:
push   %rax
mov    $0xdf,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x460,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0xdf\00"
define void @t_isupper_0xdf() {
%1 = tail call i64 @isupper(i32 223)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1120, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void c_backtrace_symbols(void **addresses, char **frames, int n_frames) {
  do {
  } while (0);
}


x86 assembly (clang, -O0):
<c_backtrace_symbols>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
jmp    1114 <c_backtrace_symbols+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @c_backtrace_symbols(i8** %0, i8** %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
br label %7
7: ; preds = %3
br label %8
8: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @c_backtrace_symbols(i8** nocapture %0, i8** nocapture %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
void usage() {
  puts("Exemple :");
  puts("\tlocatile http://c.tile.openstreetmap.org/15/17020/11746.png");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Exemple :\00"
@.str.1 = [61 x i8] c"\09locatile http://c.tile.openstreetmap.org/15/17020/11746.png\00"
define void @usage() {
%1 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @puts(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Exemple :\00"
@.str.1 = [61 x i8] c"\09locatile http://c.tile.openstreetmap.org/15/17020/11746.png\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int tui_first_reg_element_no_inline(int);
int tui_first_data_element_no_in_line(int line_no) {
  int first_element_no = (-1);
  if ((first_element_no = tui_first_reg_element_no_inline(line_no)) == -1) {
  }
  return first_element_no;
}


x86 assembly (clang, -O0):
<tui_first_data_element_no_in_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <tui_first_reg_element_no_inline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    113b <tui_first_data_element_no_in_line+0x2b>
jmp    113b <tui_first_data_element_no_in_line+0x2b>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tui_first_data_element_no_in_line>:
jmp    1030 <tui_first_reg_element_no_inline@plt>

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

LLVM IR (-O2):
define i32 @tui_first_data_element_no_in_line(i32 %0) {
%2 = tail call i32 @tui_first_reg_element_no_inline(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void peach() { printf("FRUIT:: This is peach !\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"FRUIT:: This is peach !\0A\00"
define void @peach() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"FRUIT:: This is peach !\00"
define void @peach() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
void print_line_uint16_t(uint32_t i, uint32_t j, uint16_t v, int magma) {
  if (magma)
    printf("A[%u,%u]:=%d;\n", i, j, v);
  else
    printf("%u %u %d\n", i, j, v);
}


x86 assembly (clang, -O0):
<print_line_uint16_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1148 <print_line_uint16_t+0x38>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <print_line_uint16_t+0x4d>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_line_uint16_t>:
mov    %edx,%eax
mov    %esi,%edx
mov    %edi,%esi
test   %ecx,%ecx
lea    0xef0(%rip),%rcx
lea    0xeda(%rip),%rdi
cmove  %rcx,%rdi
mov    %eax,%ecx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [15 x i8] c"A[%u,%u]:=%d;\0A\00"
@.str.1 = [10 x i8] c"%u %u %d\0A\00"
define void @print_line_uint16_t(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
%6 = select i1 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
%7 = tail call i32 @printf(i8* %6, i32 %0, i32 %1, i32 %2)
ret void
}
int fun1171() { return 1171; }


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

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

LLVM IR (-O0):
define i32 @fun1171() {
ret i32 1171
}

LLVM IR (-O2):
define i32 @fun1171() {
ret i32 1171
}
/* Type definitions */
struct timespec {
  long long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
struct timespec setupTSfromMS(long long int time) {
  struct timespec ts;
  ts.tv_sec = 0;
  ts.tv_nsec = time * 1000 * 1000;
  return ts;
}


x86 assembly (clang, -O0):
<setupTSfromMS>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x18(%rbp)
movq   $0x0,-0x8(%rbp)
mov    -0x18(%rbp),%rax
imul   $0xf4240,%rax,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupTSfromMS>:
imul   $0xf4240,%rdi,%rax
xor    %edx,%edx
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define { i64, i64 } @setupTSfromMS(i64 %0) {
%2 = alloca %struct.timespec
%3 = alloca i64
store i64 %0, i64* %3
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 1
store i64 0, i64* %4
%5 = load i64, i64* %3
%6 = mul nsw i64 %5, 1000
%7 = mul nsw i64 %6, 1000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i64 %7, i64* %8
%9 = bitcast %struct.timespec* %2 to { i64, i64 }*
%10 = load { i64, i64 }, { i64, i64 }* %9
ret { i64, i64 } %10
}

LLVM IR (-O2):
define { i64, i64 } @setupTSfromMS(i64 %0) {
%2 = mul i64 %0, 1000000
%3 = insertvalue { i64, i64 } poison, i64 %2, 0
%4 = insertvalue { i64, i64 } %3, i64 0, 1
ret { i64, i64 } %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
void *cleanup_list(void *mem) {
  printf("Czyszczenie pamieci");
  free(mem);
}


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

x86 assembly (clang, -O2):
<cleanup_list>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"Czyszczenie pamieci\00"
define noalias i8* @cleanup_list(i8* nocapture %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @free(i8* %0)
ret i8* undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
uint32_t str_to_tid(const char *str) {
  if (str == NULL)
    return 0;
  if (strcmp(str, "filtered") == 0)
    return 0x3E;
  return -1;
}


x86 assembly (clang, -O0):
<str_to_tid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <str_to_tid+0x23>
movl   $0x0,-0x4(%rbp)
jmp    1160 <str_to_tid+0x50>
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1159 <str_to_tid+0x49>
movl   $0x3e,-0x4(%rbp)
jmp    1160 <str_to_tid+0x50>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_to_tid>:
test   %rdi,%rdi
je     112f <str_to_tid+0x1f>
push   %rax
lea    0xee3(%rip),%rsi
call   1030 <strcmp@plt>
neg    %rax
sbb    %eax,%eax
or     $0x3e,%eax
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"filtered\00"
define i32 @str_to_tid(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = select i1 %5, i32 62, i32 -1
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G40_f(char *s) {
  debug("G40_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G40_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G40_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G40_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G40_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G40_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G40_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void STDcloseFP(FILE *fpFile) { fclose(fpFile); }


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

x86 assembly (clang, -O2):
<STDcloseFP>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @STDcloseFP(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
void swap(void **a, void **b) {
  void *tmp = *a;
  *a = *b;
  *b = tmp;
  return;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rcx,(%rdi)
mov    %rax,(%rsi)
ret

LLVM IR (-O0):
define void @swap(i8** %0, i8** %1) {
%3 = alloca i8**
%4 = alloca i8**
%5 = alloca i8*
store i8** %0, i8*** %3
store i8** %1, i8*** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
store i8* %7, i8** %5
%8 = load i8**, i8*** %4
%9 = load i8*, i8** %8
%10 = load i8**, i8*** %3
store i8* %9, i8** %10
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %4
store i8* %11, i8** %12
ret void
}

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret void
}
void performance_print() {}


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

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

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

LLVM IR (-O2):
define void @performance_print() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bsp_dma_init();
int /*<<< orphan*/ bsp_spi_init();
void bsp_ledsStripes_init() {
  bsp_dma_init();
  bsp_spi_init();
}


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

x86 assembly (clang, -O2):
<bsp_ledsStripes_init>:
push   %rax
xor    %eax,%eax
call   1040 <bsp_dma_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <bsp_spi_init@plt>

LLVM IR (-O0):
define void @bsp_ledsStripes_init() {
%1 = call i32 (...) @bsp_dma_init()
%2 = call i32 (...) @bsp_spi_init()
ret void
}

LLVM IR (-O2):
define void @bsp_ledsStripes_init() {
%1 = tail call i32 (...) @bsp_dma_init()
%2 = tail call i32 (...) @bsp_spi_init()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vpicx_set_framepreddct(uint8_t *p_mp2vpicx) { p_mp2vpicx[7] |= 0x40; }


x86 assembly (clang, -O0):
<mp2vpicx_set_framepreddct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
or     $0x40,%ecx
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vpicx_set_framepreddct>:
orb    $0x40,0x1c(%rdi)
ret

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

LLVM IR (-O2):
define void @mp2vpicx_set_framepreddct(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = or i32 %3, 64
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int inb(int);
int /*<<< orphan*/ outb(int, int);
void NMI_enable() { outb(0x70, inb(0x70) & 0x7F); }


x86 assembly (clang, -O0):
<NMI_enable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x70,%edi
call   1040 <inb@plt>
mov    %eax,%esi
and    $0x7f,%esi
mov    $0x70,%edi
call   1030 <outb@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NMI_enable>:
push   %rax
mov    $0x70,%edi
call   1040 <inb@plt>
and    $0x7f,%eax
mov    $0x70,%edi
mov    %eax,%esi
pop    %rax
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @NMI_enable() {
%1 = call i32 @inb(i32 112)
%2 = and i32 %1, 127
%3 = call i32 @outb(i32 112, i32 %2)
ret void
}

LLVM IR (-O2):
define void @NMI_enable() {
%1 = tail call i32 @inb(i32 112)
%2 = and i32 %1, 127
%3 = tail call i32 @outb(i32 112, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printw(char *);
int cmd_boot(int argc, char *argv[]) {
  printw("Boot command\n");
  return 0;
}


x86 assembly (clang, -O0):
<cmd_boot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printw@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"Boot command\0A\00"
define i32 @cmd_boot(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Boot command\0A\00"
define i32 @cmd_boot(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_SPKI;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_SPKI_it;
int i2d_NETSCAPE_SPKI(NETSCAPE_SPKI *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKI_it);
}


x86 assembly (clang, -O0):
<i2d_NETSCAPE_SPKI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_NETSCAPE_SPKI>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

LLVM IR (-O0):
@NETSCAPE_SPKI_it = global i32 0
define i32 @i2d_NETSCAPE_SPKI(i32* %0, i8** %1) {
%3 = alloca i32*
%4 = alloca i8**
store i32* %0, i32** %3
store i8** %1, i8*** %4
%5 = load i32*, i32** %3
%6 = load i8**, i8*** %4
%7 = call i32 @ASN1_item_i2d(i32* %5, i8** %6, i32* @NETSCAPE_SPKI_it)
ret i32 %7
}

LLVM IR (-O2):
@NETSCAPE_SPKI_it = global i32 0
define i32 @i2d_NETSCAPE_SPKI(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @NETSCAPE_SPKI_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void inputError(void) {
  fprintf(stderr, "Usage: pi [number of digits]\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<inputError>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<inputError>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: pi [number of digits]\0A\00"
define void @inputError() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"Usage: pi [number of digits]\0A\00"
define void @inputError() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
int test_imm_EBint16_reg(short val) {
  return ((val) & (0xEB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_EBint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xeb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_EBint16_reg>:
test   $0xeb,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_EBint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 235
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_EBint16_reg(i16 signext %0) {
%2 = and i16 %0, 235
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ read(int, int *, int);
int /*<<< orphan*/ setNonBlocking(int, int);
void flush_incoming(int socketfd) {
  int c;
  setNonBlocking(socketfd, 1);
  while (read(socketfd, &c, 1) > 0) {
  }
}


x86 assembly (clang, -O0):
<flush_incoming>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1040 <setNonBlocking@plt>
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
cmp    $0x0,%rax
jle    1158 <flush_incoming+0x38>
jmp    1138 <flush_incoming+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flush_incoming>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x1,%esi
call   1040 <setNonBlocking@plt>
lea    0x4(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %rax,%rax
jg     1140 <flush_incoming+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @flush_incoming(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @setNonBlocking(i32 %4, i32 1)
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %2
%8 = call i64 @read(i32 %7, i32* %3, i32 1)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @flush_incoming(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @setNonBlocking(i32 %0, i32 1)
br label %5
5: ; preds = %5, %1
%6 = call i64 @read(i32 %0, i32* %2, i32 1)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __mp_checkheap(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/);
void __mp_check(void) { __mp_checkheap(NULL, NULL, 0); }


x86 assembly (clang, -O0):
<__mp_check>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1030 <__mp_checkheap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mp_check>:
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <__mp_checkheap@plt>

LLVM IR (-O0):
define void @__mp_check() {
%1 = call i32 @__mp_checkheap(i32* null, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
define void @__mp_check() {
%1 = tail call i32 @__mp_checkheap(i32* null, i32* null, i32 0)
ret void
}
/* Variables and functions */
int get_line(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = get_line(line, 1000)) > 0)
    if (len > 80)
      printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1030 <get_line@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @get_line(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @get_line(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
int ft_tolower(int c) {
  if (c >= 'A' && c <= 'Z')
    c -= 'A' - 'a';
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <ft_tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <ft_tolower+0x24>
mov    -0x4(%rbp),%eax
sub    $0xffffffe0,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ft_tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, -32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ parse_channels(char *);
void conf_channel(char *data) { parse_channels(data); }


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

x86 assembly (clang, -O2):
<conf_channel>:
jmp    1030 <parse_channels@plt>

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

LLVM IR (-O2):
define void @conf_channel(i8* %0) {
%2 = tail call i32 @parse_channels(i8* %0)
ret void
}
char *ft_strcp(char *dest, char *src) {
  int i;
  i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  dest[i] = src[i];
  return (dest);
}


x86 assembly (clang, -O0):
<ft_strcp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     114c <ft_strcp+0x4c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <ft_strcp+0x13>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strcp>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1127 <ft_strcp+0x27>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <ft_strcp+0x10>
mov    %edx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret
xor    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @ft_strcp(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 %7, i8* %8
%9 = add nuw nsw i64 %6, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = and i64 %9, 4294967295
br label %15
15: ; preds = %13, %2
%16 = phi i64 [ 0, %2 ], [ %14, %13 ]
%17 = getelementptr inbounds i8, i8* %0, i64 %16
store i8 0, i8* %17
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ sectioning_underscore(char *);
void cm_section(void) { sectioning_underscore("section"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"section\00"
define void @cm_section() {
%1 = call i32 @sectioning_underscore(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"section\00"
define void @cm_section() {
%1 = tail call i32 @sectioning_underscore(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
int test2(int b) { return (b & 4) == 0; }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
xor    %eax,%eax
test   $0x4,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @test2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 4
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
float f(float b) {
  __attribute((vector_size(16))) float c = {0, 0, 0, 0};
  __attribute((vector_size(16))) float d = {0, 0, 0, 0};
  d += c;
  return ((float *)&c)[2];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movaps %xmm0,-0x20(%rbp)
movaps %xmm0,-0x30(%rbp)
movaps -0x20(%rbp),%xmm0
addps  -0x30(%rbp),%xmm0
movaps %xmm0,-0x30(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
%3 = alloca <4 x float>
%4 = alloca <4 x float>
store float %0, float* %2
store <4 x float> zeroinitializer, <4 x float>* %3
store <4 x float> zeroinitializer, <4 x float>* %4
%5 = load <4 x float>, <4 x float>* %3
%6 = load <4 x float>, <4 x float>* %4
%7 = fadd <4 x float> %6, %5
store <4 x float> %7, <4 x float>* %4
%8 = bitcast <4 x float>* %3 to float*
%9 = getelementptr inbounds float, float* %8, i64 2
%10 = load float, float* %9
ret float %10
}

LLVM IR (-O2):
define float @f(float %0) {
ret float 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ rt_InitInfAndNaN(unsigned int);
void quat2rpy_initialize(void) { rt_InitInfAndNaN(8U); }


x86 assembly (clang, -O0):
<quat2rpy_initialize>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
call   1030 <rt_InitInfAndNaN@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat2rpy_initialize>:
mov    $0x8,%edi
jmp    1030 <rt_InitInfAndNaN@plt>

LLVM IR (-O0):
define void @quat2rpy_initialize() {
%1 = call i32 @rt_InitInfAndNaN(i32 8)
ret void
}

LLVM IR (-O2):
define void @quat2rpy_initialize() {
%1 = tail call i32 @rt_InitInfAndNaN(i32 8)
ret void
}