xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t lpm4_248_search(uint32_t ip, uint16_t *big, uint16_t *little) {
  uint16_t v = big[ip >> 8];
  if (v > 0x8000) {
    return little[((v - 0x8000) << 8) + (ip & 0xff)];
  } else {
    return v;
  }
}


x86 assembly (clang, -O0):
<lpm4_248_search>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x8000,-0x1c(%rbp)
jle    1158 <lpm4_248_search+0x58>
mov    -0x18(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x8000,%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%edx
and    $0xff,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x4(%rbp)
jmp    115e <lpm4_248_search+0x5e>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lpm4_248_search>:
mov    %edi,%eax
sar    $0x8,%eax
cltq
mov    (%rsi,%rax,4),%eax
cmp    $0x8001,%eax
jl     1124 <lpm4_248_search+0x24>
shl    $0x8,%eax
movzbl %dil,%ecx
add    %ecx,%eax
add    $0xff800000,%eax
cltq
mov    (%rdx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @lpm4_248_search(i32 %0, i32* %1, i32* %2) {
%4 = alloca i32
%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
%9 = load i32*, i32** %6
%10 = load i32, i32* %5
%11 = ashr i32 %10, 8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
store i32 %14, i32* %8
%15 = load i32, i32* %8
%16 = icmp sgt i32 %15, 32768
br i1 %16, label %17, label %28
17: ; preds = %3
%18 = load i32*, i32** %7
%19 = load i32, i32* %8
%20 = sub nsw i32 %19, 32768
%21 = shl i32 %20, 8
%22 = load i32, i32* %5
%23 = and i32 %22, 255
%24 = add nsw i32 %21, %23
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %18, i64 %25
%27 = load i32, i32* %26
store i32 %27, i32* %4
br label %30
28: ; preds = %3
%29 = load i32, i32* %8
store i32 %29, i32* %4
br label %30
30: ; preds = %28, %17
%31 = load i32, i32* %4
ret i32 %31
}

LLVM IR (-O2):
define i32 @lpm4_248_search(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = ashr i32 %0, 8
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %1, i64 %5
%7 = load i32, i32* %6
%8 = icmp sgt i32 %7, 32768
br i1 %8, label %9, label %17
9: ; preds = %3
%10 = shl i32 %7, 8
%11 = add i32 %10, -8388608
%12 = and i32 %0, 255
%13 = or i32 %11, %12
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %2, i64 %14
%16 = load i32, i32* %15
br label %17
17: ; preds = %3, %9
%18 = phi i32 [ %16, %9 ], [ %7, %3 ]
ret i32 %18
}
/* Variables and functions */
scalar_t__ isalnum(int);
int ISIDNUM(int ch) { return isalnum(ch) || ch == '_'; }


x86 assembly (clang, -O0):
<ISIDNUM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <ISIDNUM+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISIDNUM>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ISIDNUM(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isalnum(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @ISIDNUM(i32 %0) {
%2 = tail call i64 @isalnum(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ show_all();
int menu_list(void) {
  ;
  show_all();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @menu_list() {
%1 = call i32 (...) @show_all()
ret i32 0
}

LLVM IR (-O2):
define i32 @menu_list() {
%1 = tail call i32 (...) @show_all()
ret i32 0
}
int parent(int i) { return i >> 1; }


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

x86 assembly (clang, -O2):
<parent>:
mov    %edi,%eax
sar    %eax
ret

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

LLVM IR (-O2):
define i32 @parent(i32 %0) {
%2 = ashr i32 %0, 1
ret i32 %2
}
/* Variables and functions */
bool nrf53_errata_27(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_27() {
ret i32 0
}
/* Variables and functions */
int tolower(char);
int isVowel(char c) {
  switch (tolower(c)) {
  case 'a':
  case 'e':
  case 'i':
  case 'o':
  case 'u':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isVowel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <tolower@plt>
mov    %eax,%ecx
mov    %ecx,-0xc(%rbp)
sub    $0x61,%eax
je     117e <isVowel+0x6e>
jmp    113a <isVowel+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x65,%eax
je     117e <isVowel+0x6e>
jmp    114b <isVowel+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x69,%eax
je     117e <isVowel+0x6e>
jmp    115c <isVowel+0x4c>
mov    -0xc(%rbp),%eax
sub    $0x6f,%eax
je     117e <isVowel+0x6e>
jmp    116d <isVowel+0x5d>
mov    -0xc(%rbp),%eax
sub    $0x75,%eax
jne    118a <isVowel+0x7a>
jmp    117e <isVowel+0x6e>
movl   $0x1,-0x4(%rbp)
jmp    1191 <isVowel+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isVowel>:
push   %rax
call   1030 <tolower@plt>
add    $0xffffff9f,%eax
ror    %eax
xor    %ecx,%ecx
cmp    $0xa,%eax
ja     112e <isVowel+0x1e>
cltq
lea    0xed5(%rip),%rcx
mov    (%rcx,%rax,4),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @isVowel(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = call i32 @tolower(i8 signext %4)
switch i32 %5, label %7 [
i32 97, label %6
i32 101, label %6
i32 105, label %6
i32 111, label %6
i32 117, label %6
]
6: ; preds = %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %8
7: ; preds = %1
store i32 0, i32* %2
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
@switch.table.isVowel = [11 x i32] [i32 1, i32 0, i32 1, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1]
define i32 @isVowel(i8 signext %0) {
%2 = tail call i32 @tolower(i8 signext %0)
%3 = add i32 %2, -97
%4 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %3, i32 31)
%5 = icmp ult i32 %4, 11
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds [11 x i32], [11 x i32]* @switch.table.isVowel, i64 0, i64 %7
%9 = load i32, i32* %8
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
void RTRandS32(void) {}


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

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

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

LLVM IR (-O2):
define void @RTRandS32() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: wc [-c | -m] [-Llw] [file ...]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: wc [-c | -m] [-Llw] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: wc [-c | -m] [-Llw] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int dll_fputc(int, int /*<<< orphan*/ *);
int __wrap_fputc(int c, FILE *stream) { return dll_fputc(c, stream); }


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

x86 assembly (clang, -O2):
<__wrap_fputc>:
jmp    1030 <dll_fputc@plt>

LLVM IR (-O0):
define i32 @__wrap_fputc(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 = call i32 @dll_fputc(i32 %5, i32* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @__wrap_fputc(i32 %0, i32* %1) {
%3 = tail call i32 @dll_fputc(i32 %0, i32* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void error_and_exit(char error_text[]) {
  fprintf(stderr, "Runtime error!\n");
  fprintf(stderr, "%s\n", error_text);
  fprintf(stderr, "Now exiting!\n");
  exit(1);
}


x86 assembly (clang, -O0):
<error_and_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error_and_exit>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb2(%rip),%r14
mov    (%r14),%edi
lea    0xec8(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xec7(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Runtime error!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [14 x i8] c"Now exiting!\0A\00"
define void @error_and_exit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %2
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Runtime error!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [14 x i8] c"Now exiting!\0A\00"
define void @error_and_exit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
int db_coord_size(int n) {
  if (n > 8 && n < 11) {
    return 16;
  } else {
    return 8;
  }
}


x86 assembly (clang, -O0):
<db_coord_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jle    1127 <db_coord_size+0x27>
cmpl   $0xb,-0x8(%rbp)
jge    1127 <db_coord_size+0x27>
movl   $0x10,-0x4(%rbp)
jmp    112e <db_coord_size+0x2e>
movl   $0x8,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_coord_size>:
add    $0xfffffff7,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
lea    0x8(,%rax,8),%eax
ret

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

LLVM IR (-O2):
define i32 @db_coord_size(i32 %0) {
%2 = add i32 %0, -9
%3 = icmp ult i32 %2, 2
%4 = select i1 %3, i32 16, i32 8
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ FromLE32(int /*<<< orphan*/ const);
uint32_t ReadUnalignedLE32(const uint32_t *p) { return FromLE32(*p); }


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

x86 assembly (clang, -O2):
<ReadUnalignedLE32>:
mov    (%rdi),%edi
jmp    1030 <FromLE32@plt>

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

LLVM IR (-O2):
define i32 @ReadUnalignedLE32(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @FromLE32(i32 %2)
ret i32 %3
}
int is_white(c)
int c;
{
  if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_white>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
je     112f <is_white+0x2f>
cmpl   $0x9,-0x8(%rbp)
je     112f <is_white+0x2f>
cmpl   $0xd,-0x8(%rbp)
je     112f <is_white+0x2f>
cmpl   $0xa,-0x8(%rbp)
jne    113b <is_white+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_white+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_white>:
cmp    $0x20,%edi
ja     111d <is_white+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    111d <is_white+0x1d>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_white(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 32
br i1 %5, label %15, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 9
br i1 %8, label %15, label %9
9: ; preds = %6
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 13
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 10
br i1 %14, label %15, label %16
15: ; preds = %12, %9, %6, %1
store i32 1, i32* %2
br label %17
16: ; preds = %12
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 @is_white(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %3
i32 13, label %3
i32 10, label %3
i32 9, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ print_load_error(char *);
void check_if_loaded(FILE *file, char *filename) {
  if (file == NULL) {
    print_load_error(filename);
  }
}


x86 assembly (clang, -O0):
<check_if_loaded>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <check_if_loaded+0x24>
mov    -0x10(%rbp),%rdi
call   1030 <print_load_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_if_loaded>:
test   %rdi,%rdi
je     1116 <check_if_loaded+0x6>
ret
mov    %rsi,%rdi
jmp    1030 <print_load_error@plt>

LLVM IR (-O0):
define void @check_if_loaded(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 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @print_load_error(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @check_if_loaded(i32* readnone %0, i8* %1) {
%3 = icmp eq i32* %0, null
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @print_load_error(i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(char *, int, char *);
void main(void) { g("toto", 3, "tata"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x3,%esi
lea    0xede(%rip),%rdx
call   1030 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
lea    0xee7(%rip),%rdx
mov    $0x3,%esi
jmp    1030 <g@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"toto\00"
@.str.1 = [5 x i8] c"tata\00"
define void @main() {
%1 = call i32 @g(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"toto\00"
@.str.1 = [5 x i8] c"tata\00"
define void @main() {
%1 = tail call i32 @g(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct BoolExpr {
  int dummy;
};
struct BX_Dict {
  int dummy;
};

/* Variables and functions */
struct BoolExpr *BX_IncRef(struct BoolExpr *);
struct BoolExpr *_const_compose(struct BoolExpr *c, struct BX_Dict *var2ex) {
  return BX_IncRef(c);
}


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

x86 assembly (clang, -O2):
<_const_compose>:
jmp    1030 <BX_IncRef@plt>

LLVM IR (-O0):
%struct.BoolExpr = type { i32 }
%struct.BX_Dict = type { i32 }
define %struct.BoolExpr* @_const_compose(%struct.BoolExpr* %0, %struct.BX_Dict* %1) {
%3 = alloca %struct.BoolExpr*
%4 = alloca %struct.BX_Dict*
store %struct.BoolExpr* %0, %struct.BoolExpr** %3
store %struct.BX_Dict* %1, %struct.BX_Dict** %4
%5 = load %struct.BoolExpr*, %struct.BoolExpr** %3
%6 = call %struct.BoolExpr* @BX_IncRef(%struct.BoolExpr* %5)
ret %struct.BoolExpr* %6
}

LLVM IR (-O2):
%struct.BoolExpr = type { i32 }
%struct.BX_Dict = type { i32 }
define %struct.BoolExpr* @_const_compose(%struct.BoolExpr* %0, %struct.BX_Dict* nocapture readnone %1) {
%3 = tail call %struct.BoolExpr* @BX_IncRef(%struct.BoolExpr* %0)
ret %struct.BoolExpr* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void coreCli_modules() { printf("soon..."); }


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

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

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

LLVM IR (-O2):
@.str = [8 x i8] c"soon...\00"
define void @coreCli_modules() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void popreal16array(char *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 16));
}


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

x86 assembly (clang, -O2):
<popreal16array>:
shl    $0x4,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @popreal16array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @popreal16array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
/* Variables and functions */
int floor(int /*<<< orphan*/);
int /*<<< orphan*/ log10(double);
int intlen(int i) {
  if (i < 0)
    return 1 + intlen(-i);
  else if (i == 0)
    return 1;
  else
    return floor(log10((double)i)) + 1;
}


x86 assembly (clang, -O0):
<intlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    115a <intlen+0x2a>
xor    %edi,%edi
sub    -0x8(%rbp),%edi
call   1030 <intlen@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1187 <intlen+0x57>
cmpl   $0x0,-0x8(%rbp)
jne    1170 <intlen+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1187 <intlen+0x57>
cvtsi2sdl -0x8(%rbp),%xmm0
call   1040 <log10@plt>
mov    %eax,%edi
call   1050 <floor@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlen>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
js     112b <intlen+0xb>
mov    %edi,%eax
jmp    113b <intlen+0x1b>
xor    %ebx,%ebx
mov    %edi,%eax
nop
neg    %eax
add    $0x1,%ebx
test   %edi,%edi
mov    %eax,%edi
jg     1130 <intlen+0x10>
test   %eax,%eax
je     1154 <intlen+0x34>
cvtsi2sd %eax,%xmm0
call   1030 <log10@plt>
mov    %eax,%edi
call   1040 <floor@plt>
add    $0x1,%eax
jmp    1159 <intlen+0x39>
mov    $0x1,%eax
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @intlen(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = sub nsw i32 0, %4
%7 = add nuw nsw i32 %5, 1
%8 = icmp sgt i32 %4, 0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
%11 = phi i32 [ %0, %1 ], [ %6, %3 ]
%12 = icmp eq i32 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %9
%14 = sitofp i32 %11 to double
%15 = tail call i32 @log10(double %14)
%16 = tail call i32 @floor(i32 %15)
%17 = add nsw i32 %16, 1
br label %18
18: ; preds = %9, %13
%19 = phi i32 [ %17, %13 ], [ 1, %9 ]
%20 = add nsw i32 %19, %10
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void __VERIFIER_error(void) { assert(0); }


x86 assembly (clang, -O0):
<__VERIFIER_error>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__VERIFIER_error() {
%1 = call i32 @assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @__VERIFIER_error() {
%1 = tail call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int FUTEX_PRIVATE_FLAG;
int FUTEX_WAKE;
int /*<<< orphan*/ INT_MAX;
int /*<<< orphan*/ futex(int *, int, int /*<<< orphan*/, int /*<<< orphan*/ *,
                         int /*<<< orphan*/ *, int /*<<< orphan*/);
void muggle_futex_wake_all(int *futex_addr) {
  futex(futex_addr, FUTEX_WAKE | FUTEX_PRIVATE_FLAG, INT_MAX, NULL, NULL, 0);
}


x86 assembly (clang, -O0):
<muggle_futex_wake_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea8(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <futex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<muggle_futex_wake_all>:
mov    0x2eb1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <futex@plt>

LLVM IR (-O0):
@FUTEX_WAKE = global i32 0
@FUTEX_PRIVATE_FLAG = global i32 0
@INT_MAX = global i32 0
define void @muggle_futex_wake_all(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @FUTEX_WAKE
%5 = load i32, i32* @FUTEX_PRIVATE_FLAG
%6 = or i32 %4, %5
%7 = load i32, i32* @INT_MAX
%8 = call i32 @futex(i32* %3, i32 %6, i32 %7, i32* null, i32* null, i32 0)
ret void
}

LLVM IR (-O2):
@FUTEX_WAKE = global i32 0
@FUTEX_PRIVATE_FLAG = global i32 0
@INT_MAX = global i32 0
define void @muggle_futex_wake_all(i32* %0) {
%2 = load i32, i32* @FUTEX_WAKE
%3 = load i32, i32* @FUTEX_PRIVATE_FLAG
%4 = or i32 %3, %2
%5 = load i32, i32* @INT_MAX
%6 = tail call i32 @futex(i32* %0, i32 %4, i32 %5, i32* null, i32* null, i32 0)
ret void
}
/* Variables and functions */
char *malloc(unsigned int);
int /*<<< orphan*/ memcpy(char *, char const *, unsigned int);
unsigned int strlen(char const *);
char *strdup(const char *s) {
  char *new;
  unsigned int len = strlen(s);
  new = malloc(len + 1);
  memcpy(new, s, len + 1);
  return new;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
add    $0x1,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = add i32 %7, 1
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = add i32 %12, 1
%14 = call i32 @memcpy(i8* %10, i8* %11, i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add i32 %2, 1
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 @memcpy(i8* %4, i8* %0, i32 %3)
ret i8* %4
}
int test_imm_13uint16_mem(unsigned short *val) {
  return ((*val) & (0x13 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_13uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x13,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_13uint16_mem>:
testb  $0x13,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_13uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 19
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct tipc_msg {
  int dummy;
};

/* Variables and functions */
int msg_hdr_sz(struct tipc_msg *);
int msg_short(struct tipc_msg *m) { return msg_hdr_sz(m) == 24; }


x86 assembly (clang, -O0):
<msg_short>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <msg_hdr_sz@plt>
cmp    $0x18,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_short>:
push   %rax
call   1030 <msg_hdr_sz@plt>
xor    %ecx,%ecx
cmp    $0x18,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tipc_msg = type { i32 }
define i32 @msg_short(%struct.tipc_msg* %0) {
%2 = alloca %struct.tipc_msg*
store %struct.tipc_msg* %0, %struct.tipc_msg** %2
%3 = load %struct.tipc_msg*, %struct.tipc_msg** %2
%4 = call i32 @msg_hdr_sz(%struct.tipc_msg* %3)
%5 = icmp eq i32 %4, 24
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
%struct.tipc_msg = type { i32 }
define i32 @msg_short(%struct.tipc_msg* %0) {
%2 = tail call i32 @msg_hdr_sz(%struct.tipc_msg* %0)
%3 = icmp eq i32 %2, 24
%4 = zext i1 %3 to i32
ret i32 %4
}
int freq2freqbin(float fs, int fft_len, float f) {
  float delta_f;
  float freqbin;
  delta_f = fs / fft_len;
  freqbin = f / delta_f;
  return freqbin;
}


x86 assembly (clang, -O0):
<freq2freqbin>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<freq2freqbin>:
cvtsi2ss %edi,%xmm2
divss  %xmm2,%xmm0
divss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
ret

LLVM IR (-O0):
define i32 @freq2freqbin(float %0, i32 %1, float %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %4
store i32 %1, i32* %5
store float %2, float* %6
%9 = load float, float* %4
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fdiv float %9, %11
store float %12, float* %7
%13 = load float, float* %6
%14 = load float, float* %7
%15 = fdiv float %13, %14
store float %15, float* %8
%16 = load float, float* %8
%17 = fptosi float %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @freq2freqbin(float %0, i32 %1, float %2) {
%4 = sitofp i32 %1 to float
%5 = fdiv float %0, %4
%6 = fdiv float %2, %5
%7 = fptosi float %6 to i32
ret i32 %7
}
void pwmWriteSys(int pin, int value) { return; }


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

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

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

LLVM IR (-O2):
define void @pwmWriteSys(i32 %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t padding(uint32_t length, uint32_t block) {
  uint32_t extra;
  extra = length % block;
  if (extra == 0)
    return 0;
  return block - extra;
}


x86 assembly (clang, -O0):
<padding>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    112a <padding+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1133 <padding+0x33>
mov    -0xc(%rbp),%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<padding>:
mov    %edi,%eax
cltd
idiv   %esi
sub    %edx,%esi
test   %edx,%edx
cmove  %edx,%esi
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @padding(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
%5 = sub nsw i32 %1, %3
%6 = select i1 %4, i32 0, i32 %5
ret i32 %6
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
*reservaMemoria(int nEle) {
  int *aux;
  if ((aux = (int *)calloc(sizeof(int), nEle)) == NULL) {
    printf("\nError en la reserva de memoria\n");
    exit(-1);
  } else {
    printf("\nSe ha reservado memoria para %i elementos\n", nEle);
  }
  return aux;
}


x86 assembly (clang, -O0):
<reservaMemoria>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    116e <reservaMemoria+0x3e>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x4(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reservaMemoria>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0x4,%edi
mov    %ebp,%esi
call   1050 <calloc@plt>
test   %rax,%rax
je     1173 <reservaMemoria+0x33>
mov    %rax,%rbx
lea    0xea0(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0AError en la reserva de memoria\0A\00"
@.str.1 = [44 x i8] c"\0ASe ha reservado memoria para %i elementos\0A\00"
define i32* @reservaMemoria(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 4, i32 %4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %11
%15 = load i32*, i32** %3
ret i32* %15
}

LLVM IR (-O2):
@.str.1 = [44 x i8] c"\0ASe ha reservado memoria para %i elementos\0A\00"
@str = [32 x i8] c"\0AError en la reserva de memoria\00"
define i32* @reservaMemoria(i32 %0) {
%2 = tail call i64 @calloc(i32 4, i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
%8 = inttoptr i64 %2 to i32*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret i32* %8
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iscntrl(int);
int iswcntrl(wint_t c) { return c <= 255 ? iscntrl(c) : 0; }


x86 assembly (clang, -O0):
<iswcntrl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jg     1138 <iswcntrl+0x28>
mov    -0x4(%rbp),%edi
call   1030 <iscntrl@plt>
mov    %eax,-0x8(%rbp)
jmp    1142 <iswcntrl+0x32>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <iswcntrl+0x32>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswcntrl>:
cmp    $0xff,%edi
jg     111d <iswcntrl+0xd>
jmp    1030 <iscntrl@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @iswcntrl(i32 %0) {
%2 = icmp slt i32 %0, 256
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @iscntrl(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
float sqrtf(float);
float foo(float X) { return sqrtf(X); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     111d <foo+0xd>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

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

LLVM IR (-O2):
define float @foo(float %0) {
%2 = tail call float @sqrtf(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ plintf(char *);
void show_syms(void) {
  plintf("(    ,    )    +    -      *    ^    **    / \n");
  plintf("sin  cos  tan  atan  atan2 acos asin\n");
  plintf("exp  ln   log  log10 tanh  cosh sinh \n");
  plintf("max  min  heav flr   mod   sign sqrt \n");
  plintf("t    pi   ran  \n");
}


x86 assembly (clang, -O0):
<show_syms>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf08(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf22(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf3d(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf58(%rip),%rdi
call   1030 <plintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_syms>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf0b(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf25(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf40(%rip),%rdi
call   1030 <plintf@plt>
lea    0xf5b(%rip),%rdi
pop    %rax
jmp    1030 <plintf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"( , ) + - * ^ ** / \0A\00"
@.str.1 = [38 x i8] c"sin cos tan atan atan2 acos asin\0A\00"
@.str.2 = [39 x i8] c"exp ln log log10 tanh cosh sinh \0A\00"
@.str.3 = [39 x i8] c"max min heav flr mod sign sqrt \0A\00"
@.str.4 = [17 x i8] c"t pi ran \0A\00"
define void @show_syms() {
%1 = call i32 @plintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @plintf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @plintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @plintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @plintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"( , ) + - * ^ ** / \0A\00"
@.str.1 = [38 x i8] c"sin cos tan atan atan2 acos asin\0A\00"
@.str.2 = [39 x i8] c"exp ln log log10 tanh cosh sinh \0A\00"
@.str.3 = [39 x i8] c"max min heav flr mod sign sqrt \0A\00"
@.str.4 = [17 x i8] c"t pi ran \0A\00"
define void @show_syms() {
%1 = tail call i32 @plintf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @plintf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @plintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @plintf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @plintf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int ffl2c(int lval, char *cval, int *status) {
  if (*status > 0)
    return (*status);
  if (lval)
    strcpy(cval, "T");
  else
    strcpy(cval, "F");
  return (*status);
}


x86 assembly (clang, -O0):
<ffl2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
jle    113e <ffl2c+0x2e>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1176 <ffl2c+0x66>
cmpl   $0x0,-0x8(%rbp)
je     115d <ffl2c+0x4d>
mov    -0x10(%rbp),%rdi
lea    0xead(%rip),%rsi
call   1030 <strcpy@plt>
jmp    116d <ffl2c+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffl2c>:
push   %rbx
mov    (%rdx),%eax
test   %eax,%eax
jle    1119 <ffl2c+0x9>
pop    %rbx
ret
mov    %rdx,%rbx
test   %edi,%edi
lea    0xedd(%rip),%rcx
lea    0xed4(%rip),%rax
cmove  %rcx,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
mov    (%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"F\00"
define i32 @ffl2c(i32 %0, i8* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i32*, i32** %7
%13 = load i32, i32* %12
store i32 %13, i32* %4
br label %26
14: ; preds = %3
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i8*, i8** %6
%19 = call i32 @strcpy(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %23
20: ; preds = %14
%21 = load i8*, i8** %6
%22 = call i32 @strcpy(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %20, %17
%24 = load i32*, i32** %7
%25 = load i32, i32* %24
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %11
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
@.str = [2 x i8] c"T\00"
@.str.1 = [2 x i8] c"F\00"
define i32 @ffl2c(i32 %0, i8* %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = icmp eq i32 %0, 0
%8 = select i1 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%9 = tail call i32 @strcpy(i8* %1, i8* %8)
%10 = load i32, i32* %2
br label %11
11: ; preds = %3, %6
%12 = phi i32 [ %10, %6 ], [ %4, %3 ]
ret i32 %12
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
scalar_t__ stat(char const *, struct stat *);
int fexists(const char *str) {
  struct stat buffer;
  return (stat(str, &buffer) == 0);
}


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

x86 assembly (clang, -O2):
<fexists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fexists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fexists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ halt2();
int test6() { 1, halt2(); }


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

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

LLVM IR (-O0):
define i32 @test6() {
%1 = alloca i32
%2 = call i32 (...) @halt2()
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test6() {
%1 = tail call i32 (...) @halt2()
ret i32 undef
}
void foo() {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <foo+0x9>
jmp    1109 <foo+0x9>

x86 assembly (clang, -O2):
<foo>:
jmp    1100 <foo>

LLVM IR (-O0):
define void @foo() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @foo() {
br label %1
1: ; preds = %0, %1
br label %1
}
float f(float x) { return x / 2 + x / 3; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeee(%rip),%xmm1
divss  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
movss  0xed9(%rip),%xmm2
divss  %xmm2,%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movss  0xef8(%rip),%xmm1
mulss  %xmm0,%xmm1
divss  0xef0(%rip),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+00
%5 = load float, float* %2
%6 = fdiv float %5, 3.000000e+00
%7 = fadd float %4, %6
ret float %7
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = fmul float %0, 5.000000e-01
%3 = fdiv float %0, 3.000000e+00
%4 = fadd float %2, %3
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_INFO;
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int);
void quit(int signal) {
  syslog(LOG_INFO, "shutdown, signal %d", signal);
  closelog();
  exit(0);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xeb2(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    %edi,%edx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1040 <syslog@plt>
xor    %eax,%eax
call   1030 <closelog@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_INFO = global i32 0
@.str = [20 x i8] c"shutdown, signal %d\00"
define void @quit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @LOG_INFO
%4 = load i32, i32* %2
%5 = call i32 @syslog(i32 %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (...) @closelog()
%7 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@LOG_INFO = global i32 0
@.str = [20 x i8] c"shutdown, signal %d\00"
define void @quit(i32 %0) {
%2 = load i32, i32* @LOG_INFO
%3 = tail call i32 @syslog(i32 %2, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 (...) @closelog()
%5 = tail call i32 @exit(i32 0)
unreachable
}