xunge/DecIR huggingface dataset:
/* Variables and functions */
char *strrchr(char const *, char);
const char *util_basename(const char *path) {
  const char *r = strrchr(path, '/');
  if (r)
    return r + 1;
  else
    return path;
}


x86 assembly (clang, -O0):
<util_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     114a <util_basename+0x3a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1152 <util_basename+0x42>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @util_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int numxwidth(unsigned long n) {
  int width = 0;
  do {
    width++;
  } while ((n /= 16) > 0);
  return width;
}


x86 assembly (clang, -O0):
<numxwidth>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x4,%rax
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
ja     110f <numxwidth+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numxwidth>:
xor    %eax,%eax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
shr    $0x4,%rcx
cmp    $0xf,%rdi
mov    %rcx,%rdi
ja     1110 <numxwidth+0x10>
ret

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

LLVM IR (-O2):
define i32 @numxwidth(i64 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = lshr i64 %3, 4
%7 = icmp ult i64 %3, 16
br i1 %7, label %8, label %2
8: ; preds = %2
ret i32 %5
}
void SystemInit(void) { ; }


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

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

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

LLVM IR (-O2):
define void @SystemInit() {
ret void
}
/* Variables and functions */
int getNthNumber(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int s = 0;
  int n = 3;
  s = getNthNumber(n);
  printf("%d\n", s);
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @getNthNumber(i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void InterruptSignalHandler(int sigtype) {
  fprintf(stdout, "\nInterrupted by SIGINT, exiting.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<InterruptSignalHandler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
lea    0xec5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<InterruptSignalHandler>:
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):
@stdout = global i32 0
@.str = [34 x i8] c"\0AInterrupted by SIGINT, exiting.\0A\00"
define void @InterruptSignalHandler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [34 x i8] c"\0AInterrupted by SIGINT, exiting.\0A\00"
define void @InterruptSignalHandler(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
int strlen2(char s[]) {
  int i;
  while (s[i] != '\0')
    ++i;
  return i;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     112b <strlen2+0x2b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1108 <strlen2+0x8>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen2>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <strlen2+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen2(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ writeByte(unsigned int, unsigned int);
void writeWord(unsigned addr, unsigned value) {
  writeByte(addr, value & 0xFF);
  writeByte(addr + 1, (value >> 8) & 0xFF);
}


x86 assembly (clang, -O0):
<writeWord>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
and    $0xff,%esi
call   1030 <writeByte@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
shr    $0x8,%esi
and    $0xff,%esi
call   1030 <writeByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeWord>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %edi,%ebx
movzbl %al,%esi
mov    %eax,%ebp
call   1030 <writeByte@plt>
add    $0x1,%ebx
mov    %ebp,%eax
movzbl %ah,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <writeByte@plt>

LLVM IR (-O0):
define void @writeWord(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 = and i32 %6, 255
%8 = call i32 @writeByte(i32 %5, i32 %7)
%9 = load i32, i32* %3
%10 = add i32 %9, 1
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = call i32 @writeByte(i32 %10, i32 %13)
ret void
}

LLVM IR (-O2):
define void @writeWord(i32 %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 @writeByte(i32 %0, i32 %3)
%5 = add i32 %0, 1
%6 = lshr i32 %1, 8
%7 = and i32 %6, 255
%8 = tail call i32 @writeByte(i32 %5, i32 %7)
ret void
}
/* Variables and functions */
int getnybble(int /*<<< orphan*/);
int getbyte(char **pp) {
  char *p = *pp;
  int answer;
  answer = getnybble(*p++);
  answer = (answer << 4) | getnybble(*p++);
  *pp = p;
  return answer;
}


x86 assembly (clang, -O0):
<getbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <getnybble@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <getnybble@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getbyte>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    (%rdi),%rbx
movsbl (%rbx),%edi
call   1030 <getnybble@plt>
mov    %eax,%ebp
shl    $0x4,%ebp
movsbl 0x1(%rbx),%edi
add    $0x2,%rbx
call   1030 <getnybble@plt>
or     %ebp,%eax
mov    %rbx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @getbyte(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %3
%9 = load i8, i8* %7
%10 = sext i8 %9 to i32
%11 = call i32 @getnybble(i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = shl i32 %12, 4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = call i32 @getnybble(i32 %17)
%19 = or i32 %13, %18
store i32 %19, i32* %4
%20 = load i8*, i8** %3
%21 = load i8**, i8*** %2
store i8* %20, i8** %21
%22 = load i32, i32* %4
ret i32 %22
}

LLVM IR (-O2):
define i32 @getbyte(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = tail call i32 @getnybble(i32 %5)
%7 = shl i32 %6, 4
%8 = getelementptr inbounds i8, i8* %2, i64 2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = tail call i32 @getnybble(i32 %10)
%12 = or i32 %11, %7
store i8* %8, i8** %0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ alias_for_target();
int /*<<< orphan*/ asm_for_target();
int /*<<< orphan*/ inunit2();
int /*<<< orphan*/ target();
int main(void) {
  target();
  alias_for_target();
  asm_for_target();
  inunit2();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <target@plt>
xor    %eax,%eax
call   1030 <alias_for_target@plt>
xor    %eax,%eax
call   1060 <asm_for_target@plt>
xor    %eax,%eax
call   1040 <inunit2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @target()
%3 = call i32 (...) @alias_for_target()
%4 = call i32 (...) @asm_for_target()
%5 = call i32 (...) @inunit2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @target()
%2 = tail call i32 (...) @alias_for_target()
%3 = tail call i32 (...) @asm_for_target()
%4 = tail call i32 (...) @inunit2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ is_pulse(int);
int is_space(int data) { return (!is_pulse(data)); }


x86 assembly (clang, -O0):
<is_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <is_pulse@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_space(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @is_pulse(i32 %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @is_space(i32 %0) {
%2 = tail call i32 @is_pulse(i32 %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ logger(int /*<<< orphan*/, char *, float);
float read_float(char const *);
float read_mysql_float(const char *buf) {
  float f;
  f = read_float(buf);
  logger(0, "FLOAT: %f\n", f);
  return f;
}


x86 assembly (clang, -O0):
<read_mysql_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <read_float@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
xor    %edi,%edi
lea    0xeb8(%rip),%rsi
call   1040 <logger@plt>
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_mysql_float>:
push   %rax
call   1030 <read_float@plt>
movss  %xmm0,0x4(%rsp)
lea    0xecd(%rip),%rsi
xor    %edi,%edi
call   1040 <logger@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"FLOAT: %f\0A\00"
define float @read_mysql_float(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call float @read_float(i8* %4)
store float %5, float* %3
%6 = load float, float* %3
%7 = call i32 @logger(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %6)
%8 = load float, float* %3
ret float %8
}

LLVM IR (-O2):
@.str = [11 x i8] c"FLOAT: %f\0A\00"
define float @read_mysql_float(i8* %0) {
%2 = tail call float @read_float(i8* %0)
%3 = tail call i32 @logger(i32 0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %2)
ret float %2
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
scalar_t__ nanosleep(struct timespec const *, struct timespec *);
int thrd_sleep(const struct timespec *time_point, struct timespec *remaining) {
  if (nanosleep(time_point, remaining) == 0) {
    return (0);
  }
  if (errno == EINTR) {
    return (-1);
  }
  return (-2);
}


x86 assembly (clang, -O0):
<thrd_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
cmp    $0x0,%rax
jne    1143 <thrd_sleep+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1170 <thrd_sleep+0x60>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
jne    1169 <thrd_sleep+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <thrd_sleep+0x60>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrd_sleep>:
push   %rax
call   1030 <nanosleep@plt>
mov    0x2ec3(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2eb1(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%rcx
sete   %sil
or     $0xfffffffe,%esi
xor    %ecx,%ecx
test   %rax,%rax
cmovne %esi,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @thrd_sleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
%5 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %4
store %struct.timespec* %1, %struct.timespec** %5
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = load %struct.timespec*, %struct.timespec** %5
%8 = call i64 @nanosleep(%struct.timespec* %6, %struct.timespec* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %17
11: ; preds = %2
%12 = load i64, i64* @errno
%13 = load i64, i64* @EINTR
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 -1, i32* %3
br label %17
16: ; preds = %11
store i32 -2, i32* %3
br label %17
17: ; preds = %16, %15, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @thrd_sleep(%struct.timespec* %0, %struct.timespec* %1) {
%3 = tail call i64 @nanosleep(%struct.timespec* %0, %struct.timespec* %1)
%4 = icmp eq i64 %3, 0
%5 = load i64, i64* @errno
%6 = load i64, i64* @EINTR
%7 = icmp eq i64 %5, %6
%8 = select i1 %7, i32 -1, i32 -2
%9 = select i1 %4, i32 0, i32 %8
ret i32 %9
}
/* Variables and functions */
int fb_GfxFlip(int, int);
int fb_GfxPageCopy(int from_page, int to_page) {
  return fb_GfxFlip(from_page, to_page);
}


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

x86 assembly (clang, -O2):
<fb_GfxPageCopy>:
jmp    1030 <fb_GfxFlip@plt>

LLVM IR (-O0):
define i32 @fb_GfxPageCopy(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 @fb_GfxFlip(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @fb_GfxPageCopy(i32 %0, i32 %1) {
%3 = tail call i32 @fb_GfxFlip(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gpio_unfreeze();
int /*<<< orphan*/ spi_unfreeze();
void operation_spi_stop() {
  spi_unfreeze();
  gpio_unfreeze();
}


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

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

LLVM IR (-O0):
define void @operation_spi_stop() {
%1 = call i32 (...) @spi_unfreeze()
%2 = call i32 (...) @gpio_unfreeze()
ret void
}

LLVM IR (-O2):
define void @operation_spi_stop() {
%1 = tail call i32 (...) @spi_unfreeze()
%2 = tail call i32 (...) @gpio_unfreeze()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, char const *, int);
int sbus_extract_integer(const char *p_str) {
  int n_res = 0;
  memcpy((void *)&n_res, p_str, sizeof(int));
  return n_res;
}


x86 assembly (clang, -O0):
<sbus_extract_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sbus_extract_integer>:
push   %rax
mov    %rdi,%rsi
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @sbus_extract_integer(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @memcpy(i8* %3, i8* %0, i32 4)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_initialize_supports(int nbr) {
  int fail, *b;
  double *c;
  fail = _ada_use_c2phc4c(240, &nbr, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_initialize_supports>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xf0,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_initialize_supports>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0xf0,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_initialize_supports(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca double*
store i32 %0, i32* %2
%6 = load i32*, i32** %4
%7 = load double*, double** %5
%8 = call i32 @_ada_use_c2phc4c(i32 240, i32* %2, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @celcon_initialize_supports(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc4c(i32 240, i32* %2, i32* undef, double* undef, i32 0)
ret i32 %3
}
long SIO1shutdown() { return 0; }


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

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

LLVM IR (-O0):
define i64 @SIO1shutdown() {
ret i64 0
}

LLVM IR (-O2):
define i64 @SIO1shutdown() {
ret i64 0
}
/* Variables and functions */
scalar_t__ isspace(char);
char *trimSpace(char *ptr, char *start) {
  char *p = ptr - 1;
  while (p > start && isspace(*p))
    --p;
  return p + 1;
}


x86 assembly (clang, -O0):
<trimSpace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jbe    1155 <trimSpace+0x45>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1165 <trimSpace+0x55>
jmp    1176 <trimSpace+0x66>
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    112c <trimSpace+0x1c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trimSpace>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
add    $0xffffffffffffffff,%rdi
nopl   0x0(%rax,%rax,1)
mov    %rdi,%rbx
cmp    %r14,%rdi
jbe    1139 <trimSpace+0x29>
movsbl (%rbx),%edi
call   1030 <isspace@plt>
lea    -0x1(%rbx),%rdi
test   %rax,%rax
jne    1120 <trimSpace+0x10>
add    $0x1,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @trimSpace(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 = getelementptr inbounds i8, i8* %6, i64 -1
store i8* %7, i8** %5
br label %8
8: ; preds = %19, %2
%9 = load i8*, i8** %5
%10 = load i8*, i8** %4
%11 = icmp ugt i8* %9, %10
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = call i64 @isspace(i8 signext %14)
%16 = icmp ne i64 %15, 0
br label %17
17: ; preds = %12, %8
%18 = phi i1 [ false, %8 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %5
%21 = getelementptr inbounds i8, i8* %20, i32 -1
store i8* %21, i8** %5
br label %8
22: ; preds = %17
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 1
ret i8* %24
}

LLVM IR (-O2):
define i8* @trimSpace(i8* %0, i8* readnone %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %5, %7 ]
%5 = getelementptr inbounds i8, i8* %4, i64 -1
%6 = icmp ugt i8* %5, %1
br i1 %6, label %7, label %11
7: ; preds = %3
%8 = load i8, i8* %5
%9 = tail call i64 @isspace(i8 signext %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ cnfImprt(char *const, int, char *);
int /*<<< orphan*/ msgSetr(char *, float);
int /*<<< orphan*/ starFree(char *);
char *starMallocAtomic(int);
void msg_setr_(char *const TOKEN, float *const RVALUE, int TOKEN_length) {
  float rvalue;
  char *token;
  ;
  rvalue = *RVALUE;
  token = starMallocAtomic(TOKEN_length + 1);
  cnfImprt(TOKEN, TOKEN_length, token);
  msgSetr(token, rvalue);
  starFree(token);
}


x86 assembly (clang, -O0):
<msg_setr_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1050 <starMallocAtomic@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1060 <cnfImprt@plt>
mov    -0x20(%rbp),%rdi
movss  -0x18(%rbp),%xmm0
call   1030 <msgSetr@plt>
mov    -0x20(%rbp),%rdi
call   1040 <starFree@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_setr_>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r15d
mov    %rdi,%r14
movss  (%rsi),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0x1(%r15),%edi
call   1050 <starMallocAtomic@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %r15d,%esi
mov    %rax,%rdx
call   1060 <cnfImprt@plt>
mov    %rbx,%rdi
movss  0xc(%rsp),%xmm0
call   1030 <msgSetr@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <starFree@plt>

LLVM IR (-O0):
define void @msg_setr_(i8* %0, float* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca float*
%6 = alloca i32
%7 = alloca float
%8 = alloca i8*
store i8* %0, i8** %4
store float* %1, float** %5
store i32 %2, i32* %6
%9 = load float*, float** %5
%10 = load float, float* %9
store float %10, float* %7
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = call i8* @starMallocAtomic(i32 %12)
store i8* %13, i8** %8
%14 = load i8*, i8** %4
%15 = load i32, i32* %6
%16 = load i8*, i8** %8
%17 = call i32 @cnfImprt(i8* %14, i32 %15, i8* %16)
%18 = load i8*, i8** %8
%19 = load float, float* %7
%20 = call i32 @msgSetr(i8* %18, float %19)
%21 = load i8*, i8** %8
%22 = call i32 @starFree(i8* %21)
ret void
}

LLVM IR (-O2):
define void @msg_setr_(i8* %0, float* nocapture %1, i32 %2) {
%4 = load float, float* %1
%5 = add nsw i32 %2, 1
%6 = tail call i8* @starMallocAtomic(i32 %5)
%7 = tail call i32 @cnfImprt(i8* %0, i32 %2, i8* %6)
%8 = tail call i32 @msgSetr(i8* %6, float %4)
%9 = tail call i32 @starFree(i8* %6)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rand();
void rellenarArrayNumerosAleatorios(uint8_t *const arr, const size_t length) {
  for (size_t i = 0; i < length; i++) {
    *(arr + i) = rand() % 256;
  }
}


x86 assembly (clang, -O0):
<rellenarArrayNumerosAleatorios>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1161 <rellenarArrayNumerosAleatorios+0x51>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <rellenarArrayNumerosAleatorios+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rellenarArrayNumerosAleatorios>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1157 <rellenarArrayNumerosAleatorios+0x47>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0xff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffff00,%ecx
sub    %ecx,%eax
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <rellenarArrayNumerosAleatorios+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @rellenarArrayNumerosAleatorios(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %16, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = srem i32 %11, 256
%13 = load i32*, i32** %3
%14 = load i64, i64* %5
%15 = getelementptr inbounds i32, i32* %13, i64 %14
store i32 %12, i32* %15
br label %16
16: ; preds = %10
%17 = load i64, i64* %5
%18 = add i64 %17, 1
store i64 %18, i64* %5
br label %6
19: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @rellenarArrayNumerosAleatorios(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = srem i32 %7, 256
%9 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %8, i32* %9
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %1
br i1 %11, label %4, label %5
}
float ClampCvar(float min, float max, float value) {
  if (value < min)
    return min;
  if (value > max)
    return max;
  return value;
}


x86 assembly (clang, -O0):
<ClampCvar>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1135 <ClampCvar+0x35>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <ClampCvar+0x5d>
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1153 <ClampCvar+0x53>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <ClampCvar+0x5d>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ClampCvar>:
minss  %xmm2,%xmm1
cmpltss %xmm0,%xmm2
andps  %xmm2,%xmm0
andnps %xmm1,%xmm2
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @ClampCvar(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %7
%9 = load float, float* %5
%10 = fcmp olt float %8, %9
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load float, float* %5
store float %12, float* %4
br label %21
13: ; preds = %3
%14 = load float, float* %7
%15 = load float, float* %6
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load float, float* %6
store float %18, float* %4
br label %21
19: ; preds = %13
%20 = load float, float* %7
store float %20, float* %4
br label %21
21: ; preds = %19, %17, %11
%22 = load float, float* %4
ret float %22
}

LLVM IR (-O2):
define float @ClampCvar(float %0, float %1, float %2) {
%4 = fcmp olt float %2, %0
%5 = fcmp ogt float %2, %1
%6 = select i1 %5, float %1, float %2
%7 = select i1 %4, float %0, float %6
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ f();
int /*<<< orphan*/ g();
int main(int argc, char **argv) {
  f();
  f();
  f();
  g();
}


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

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @f()
%6 = call i32 (...) @f()
%7 = call i32 (...) @f()
%8 = call i32 (...) @g()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @f()
%4 = tail call i32 (...) @f()
%5 = tail call i32 (...) @f()
%6 = tail call i32 (...) @g()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tester();
int main() {
  int i;
  for (i = 0; i < 5; i += 1)
    tester();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1145 <main+0x35>
mov    $0x0,%al
call   1030 <tester@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tester()
%2 = tail call i32 (...) @tester()
%3 = tail call i32 (...) @tester()
%4 = tail call i32 (...) @tester()
%5 = tail call i32 (...) @tester()
ret i32 0
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int lstat(const char *path, struct stat *buf) {
  _exit(-1);
  return -1;
}


x86 assembly (clang, -O0):
<lstat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<lstat>:
push   %rax
mov    $0xffffffff,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @lstat(i8* %0, %struct.stat* %1) {
%3 = alloca i8*
%4 = alloca %struct.stat*
store i8* %0, i8** %3
store %struct.stat* %1, %struct.stat** %4
%5 = call i32 @_exit(i32 -1)
unreachable
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @lstat(i8* nocapture readnone %0, %struct.stat* nocapture readnone %1) {
%3 = tail call i32 @_exit(i32 -1)
unreachable
}
void T32_INTC_IRQHandler(void) {
  while (1) {
  }
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @device_sound_stream_stop() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  void *gc;
};
typedef TYPE_1__ XEDataObject;

/* Variables and functions */
void set_XEDataObject_gc(void *_p, void *_v) {
  ((XEDataObject *)_p)->gc = (void *)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i8* }
define void @set_XEDataObject_gc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i8* %5, i8** %8
ret void
}

LLVM IR (-O2):
define void @set_XEDataObject_gc(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
/* Type definitions */
struct plm_ctx_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ plm_buffer_destroy();
int /*<<< orphan*/ plm_comm_destroy();
int /*<<< orphan*/ plm_event_io_shutdown();
void plm_main_on_work_proc_exit(struct plm_ctx_list *ctx) {
  plm_event_io_shutdown();
  plm_comm_destroy();
  plm_buffer_destroy();
}


x86 assembly (clang, -O0):
<plm_main_on_work_proc_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <plm_event_io_shutdown@plt>
mov    $0x0,%al
call   1040 <plm_comm_destroy@plt>
mov    $0x0,%al
call   1030 <plm_buffer_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plm_main_on_work_proc_exit>:
push   %rax
xor    %eax,%eax
call   1050 <plm_event_io_shutdown@plt>
xor    %eax,%eax
call   1040 <plm_comm_destroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <plm_buffer_destroy@plt>

LLVM IR (-O0):
%struct.plm_ctx_list = type { i32 }
define void @plm_main_on_work_proc_exit(%struct.plm_ctx_list* %0) {
%2 = alloca %struct.plm_ctx_list*
store %struct.plm_ctx_list* %0, %struct.plm_ctx_list** %2
%3 = call i32 (...) @plm_event_io_shutdown()
%4 = call i32 (...) @plm_comm_destroy()
%5 = call i32 (...) @plm_buffer_destroy()
ret void
}

LLVM IR (-O2):
%struct.plm_ctx_list = type { i32 }
define void @plm_main_on_work_proc_exit(%struct.plm_ctx_list* nocapture readnone %0) {
%2 = tail call i32 (...) @plm_event_io_shutdown()
%3 = tail call i32 (...) @plm_comm_destroy()
%4 = tail call i32 (...) @plm_buffer_destroy()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void b_float_print_32(int idx, int *cells, int size) {
  float value = cells[idx] / 100.0;
  printf("%.2f", value);
}


x86 assembly (clang, -O0):
<b_float_print_32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_float_print_32>:
movslq %edi,%rax
cvtsi2sdl (%rsi,%rax,4),%xmm0
divsd  0xee0(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xedd(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%.2f\00"
define void @b_float_print_32(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca float
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
%13 = sitofp i32 %12 to double
%14 = fdiv double %13, 1.000000e+02
%15 = fptrunc double %14 to float
store float %15, float* %7
%16 = load float, float* %7
%17 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %16)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.2f\00"
define void @b_float_print_32(i32 %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = load i32, i32* %5
%7 = sitofp i32 %6 to double
%8 = fdiv double %7, 1.000000e+02
%9 = fptrunc double %8 to float
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x;
  *(long *)(&x) = 0x1b70ac60412100;
  printf("%f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0x1b70ac60412100,%rax
mov    %rax,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 0x1B70AC60412100)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ a_sizeof(char *);
int /*<<< orphan*/ p_sizeof(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char s[] = "hello, world";
  printf("sizeof(s) = [%ld]\n\n", sizeof(s));
  a_sizeof(s);
  p_sizeof(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xeb8(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xeb3(%rip),%al
mov    %al,-0x5(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
lea    -0x11(%rbp),%rdi
call   1040 <a_sizeof@plt>
lea    -0x11(%rbp),%rdi
call   1050 <p_sizeof@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movabs $0x646c726f77202c,%rax
mov    %rax,0x5(%rsp)
movabs $0x77202c6f6c6c6568,%rax
2c 20 77
mov    %rax,(%rsp)
lea    0xeb4(%rip),%rdi
mov    $0xd,%esi
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <a_sizeof@plt>
mov    %rbx,%rdi
call   1050 <p_sizeof@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [13 x i8] c"hello, world\00"
@.str = [20 x i8] c"sizeof(s) = [%ld]\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
store i32 0, i32* %1
%3 = bitcast [13 x i8]* %2 to i8*
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 13)
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%6 = call i32 @a_sizeof(i8* %5)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%8 = call i32 @p_sizeof(i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [13 x i8] c"hello, world\00"
@.str = [20 x i8] c"sizeof(s) = [%ld]\0A\0A\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 13)
%4 = call i32 @a_sizeof(i8* %2)
%5 = call i32 @p_sizeof(i8* %2)
ret i32 0
}
unsigned long ADCDataRegularGet(unsigned long ulBase, unsigned long ulADCMode) {
  unsigned long ulReturn = 0;
  ;
  ;
  if (ulADCMode == 0x00000001) {
    ulReturn =
        (*((volatile unsigned long *)(ulBase + 0x0000004C))) & 0x0000FFFF;
  } else {
    ulReturn = (*((volatile unsigned long *)(0x40012400 + 0x0000004C)));
  }
  return ulReturn;
}


x86 assembly (clang, -O0):
<ADCDataRegularGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1136 <ADCDataRegularGet+0x36>
mov    -0x8(%rbp),%rax
mov    0x4c(%rax),%rax
and    $0xffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1142 <ADCDataRegularGet+0x42>
mov    $0x4001244c,%eax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCDataRegularGet>:
cmp    $0x1,%rsi
jne    110e <ADCDataRegularGet+0xe>
mov    0x4c(%rdi),%rax
movzwl %ax,%eax
ret
mov    0x4001244c,%rax
40
ret

LLVM IR (-O0):
define i64 @ADCDataRegularGet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
store i64 0, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %3
%10 = add i64 %9, 76
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = and i64 %12, 65535
store i64 %13, i64* %5
br label %16
14: ; preds = %2
%15 = load volatile i64, i64* inttoptr (i64 1073816652 to i64*)
store i64 %15, i64* %5
br label %16
16: ; preds = %14, %8
%17 = load i64, i64* %5
ret i64 %17
}

LLVM IR (-O2):
define i64 @ADCDataRegularGet(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = add i64 %0, 76
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 65535
br label %11
9: ; preds = %2
%10 = load volatile i64, i64* inttoptr (i64 1073816652 to i64*)
br label %11
11: ; preds = %9, %4
%12 = phi i64 [ %8, %4 ], [ %10, %9 ]
ret i64 %12
}
int rtl839x_dma_if_rx_ring_size(int i) { return (0x6038) + ((i >> 3) << 2); }


x86 assembly (clang, -O0):
<rtl839x_dma_if_rx_ring_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
shl    $0x2,%eax
add    $0x6038,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtl839x_dma_if_rx_ring_size>:
sar    %edi
lea    0x6038(%rdi),%eax
and    $0xfffffffc,%eax
ret

LLVM IR (-O0):
define i32 @rtl839x_dma_if_rx_ring_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 3
%5 = shl i32 %4, 2
%6 = add nsw i32 24632, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @rtl839x_dma_if_rx_ring_size(i32 %0) {
%2 = ashr i32 %0, 1
%3 = add nsw i32 %2, 24632
%4 = and i32 %3, -4
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sendwait(int, char *, int);
int /*<<< orphan*/ socketclose(int);
void logger_disconnect(int sock) {
  if (sock == -1) {
    goto error;
  };
  char byte = 0xfa;
  sendwait(sock, &byte, 1);
  socketclose(sock);
error:
  return;
}


x86 assembly (clang, -O0):
<logger_disconnect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    113a <logger_disconnect+0x1a>
jmp    1157 <logger_disconnect+0x37>
movb   $0xfa,-0x5(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x5(%rbp),%rsi
mov    $0x1,%edx
call   1030 <sendwait@plt>
mov    -0x4(%rbp),%edi
call   1040 <socketclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_disconnect>:
cmp    $0xffffffff,%edi
je     114c <logger_disconnect+0x2c>
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
movb   $0xfa,0xf(%rsp)
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
call   1030 <sendwait@plt>
mov    %ebx,%edi
call   1040 <socketclose@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define void @logger_disconnect(i32 %0) {
%2 = alloca i8
%3 = icmp eq i32 %0, -1
br i1 %3, label %7, label %4
4: ; preds = %1
store i8 -6, i8* %2
%5 = call i32 @sendwait(i32 %0, i8* %2, i32 1)
%6 = call i32 @socketclose(i32 %0)
br label %7
7: ; preds = %1, %4
ret void
}
int unix_probe(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @unix_probe() {
ret i32 0
}
int _close(int fd) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @_close(i32 %0) {
ret i32 0
}