xunge/DecIR huggingface dataset:
void plugin_destroy(struct instance *instance) {}


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

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

LLVM IR (-O0):
%struct.instance = type opaque
define void @plugin_destroy(%struct.instance* %0) {
%2 = alloca %struct.instance*
store %struct.instance* %0, %struct.instance** %2
ret void
}

LLVM IR (-O2):
%struct.instance = type opaque
define void @plugin_destroy(%struct.instance* nocapture %0) {
ret void
}
void *xrealloc(ptr, size) void *ptr;
int size;
{
  void *result = (void *)realloc(ptr, size);
  if (!result)
    fatal("Malloc failed");
  return result;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1159 <xrealloc+0x39>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
movslq %esi,%rsi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113f <xrealloc+0x1f>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Malloc failed\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = call i8* @realloc(i8* %6, i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = icmp ne i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %2
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
@.str = [14 x i8] c"Malloc failed\00"
define i8* @xrealloc(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = tail call i8* @realloc(i8* %0, i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int load_u8(char const *, int, int);
uint16_t load_u16(const char *icc, int length, int offset) {
  return load_u8(icc, length, offset + 1) +
         (load_u8(icc, length, offset + 0) << 8);
}


x86 assembly (clang, -O0):
<load_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
call   1030 <load_u8@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x0,%edx
call   1030 <load_u8@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
shl    $0x8,%ecx
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<load_u16>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0x1(%r14),%edx
call   1030 <load_u8@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <load_u8@plt>
shl    $0x8,%eax
add    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @load_u16(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = add nsw i32 %9, 1
%11 = call i32 @load_u8(i8* %7, i32 %8, i32 %10)
%12 = load i8*, i8** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 0
%16 = call i32 @load_u8(i8* %12, i32 %13, i32 %15)
%17 = shl i32 %16, 8
%18 = add nsw i32 %11, %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @load_u16(i8* %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, 1
%5 = tail call i32 @load_u8(i8* %0, i32 %1, i32 %4)
%6 = tail call i32 @load_u8(i8* %0, i32 %1, i32 %2)
%7 = shl i32 %6, 8
%8 = add nsw i32 %7, %5
ret i32 %8
}
/* Variables and functions */
double __ieee754_log2(double);
double log2(double d) { return __ieee754_log2(d); }


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

x86 assembly (clang, -O2):
<log2>:
jmp    1030 <__ieee754_log2@plt>

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

LLVM IR (-O2):
define double @log2(double %0) {
%2 = tail call double @__ieee754_log2(double %0)
ret double %2
}
/* Variables and functions */
int syscall(int, int, char const *, int, char const *, unsigned int);
int missing_renameat2(int oldfd, const char *oldname, int newfd,
                      const char *newname, unsigned flags) {
  return syscall(316, oldfd, oldname, newfd, newname, flags);
}


x86 assembly (clang, -O0):
<missing_renameat2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0x13c,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<missing_renameat2>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x13c,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @missing_renameat2(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 316, i32 %11, i8* %12, i32 %13, i8* %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @missing_renameat2(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @syscall(i32 316, i32 %0, i8* %1, i32 %2, i8* %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ IniAf();
int /*<<< orphan*/ IniClk();
int /*<<< orphan*/ IniCmd();
void IniSetAf(void) {
  IniCmd();
  IniClk();
  IniAf();
}


x86 assembly (clang, -O0):
<IniSetAf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <IniCmd@plt>
mov    $0x0,%al
call   1030 <IniClk@plt>
mov    $0x0,%al
call   1040 <IniAf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<IniSetAf>:
push   %rax
xor    %eax,%eax
call   1050 <IniCmd@plt>
xor    %eax,%eax
call   1030 <IniClk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <IniAf@plt>

LLVM IR (-O0):
define void @IniSetAf() {
%1 = call i32 (...) @IniCmd()
%2 = call i32 (...) @IniClk()
%3 = call i32 (...) @IniAf()
ret void
}

LLVM IR (-O2):
define void @IniSetAf() {
%1 = tail call i32 (...) @IniCmd()
%2 = tail call i32 (...) @IniClk()
%3 = tail call i32 (...) @IniAf()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void display_contents(uint8_t *kadr, int elem) {
  int i;
  for (i = 0; i < elem; i += 16) {
    printf("%x ", *kadr);
    kadr++;
  }
}


x86 assembly (clang, -O0):
<display_contents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115e <display_contents+0x4e>
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display_contents+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_contents>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <display_contents+0x36>
mov    %esi,%r15d
mov    %rdi,%rbx
xor    %ebp,%ebp
lea    0xed6(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x4,%rbx
add    $0x10,%ebp
cmp    %r15d,%ebp
jl     1130 <display_contents+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x \00"
define void @display_contents(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2, %4
%5 = phi i32 [ %10, %4 ], [ 0, %2 ]
%6 = phi i32* [ %9, %4 ], [ %0, %2 ]
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = add nuw nsw i32 %5, 16
%11 = icmp slt i32 %10, %1
br i1 %11, label %4, label %12
12: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getchar();
int scanf(char *, double *);
int get_value(double *F) {
  while (scanf("%lf", F) != 1)
    getchar();
  return 0;
}


x86 assembly (clang, -O0):
<get_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1151 <get_value+0x31>
mov    $0x0,%al
call   1030 <getchar@plt>
jmp    112c <get_value+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_value>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
je     1167 <get_value+0x47>
lea    0xebe(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    1150 <get_value+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
define i32 @get_value(double* %0) {
%2 = alloca double*
store double* %0, double** %2
br label %3
3: ; preds = %7, %1
%4 = load double*, double** %2
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %4)
%6 = icmp ne i32 %5, 1
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @getchar()
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
define i32 @get_value(double* %0) {
%2 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %0)
%3 = icmp eq i32 %2, 1
br i1 %3, label %8, label %4
4: ; preds = %1, %4
%5 = tail call i32 (...) @getchar()
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %4
8: ; preds = %4, %1
ret i32 0
}
void XcmsAllocColor() {}


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

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

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

LLVM IR (-O2):
define void @XcmsAllocColor() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gethostname(char *, int);
int /*<<< orphan*/ tracker_cmd(int, char *, int /*<<< orphan*/ *);
void tracker_stop() {
  char self[64];
  gethostname(self, 64);
  tracker_cmd(4, self, NULL);
}


x86 assembly (clang, -O0):
<tracker_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x40(%rbp),%rdi
mov    $0x40,%esi
call   1040 <gethostname@plt>
lea    -0x40(%rbp),%rsi
mov    $0x4,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <tracker_cmd@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracker_stop>:
push   %rbx
sub    $0x40,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1040 <gethostname@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <tracker_cmd@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @tracker_stop() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @gethostname(i8* %2, i32 64)
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%5 = call i32 @tracker_cmd(i32 4, i8* %4, i32* null)
ret void
}

LLVM IR (-O2):
define void @tracker_stop() {
%1 = alloca [64 x i8]
%2 = getelementptr inbounds [64 x i8], [64 x i8]* %1, i64 0, i64 0
%3 = call i32 @gethostname(i8* %2, i32 64)
%4 = call i32 @tracker_cmd(i32 4, i8* %2, i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int64_t printheader(int64_t n) {
  printf("P3\n400\n400\n60\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"P3\0A400\0A400\0A60\0A\00"
define i32 @printheader(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [14 x i8] c"P3\0A400\0A400\0A60\00"
define i32 @printheader(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint64_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
float throughput(int64_t usecs, uint64_t size) {
  float bits = (float)size * 8.0;
  float secs = (float)usecs / 1000000.0;
  return (bits / secs) / 1000000.0;
}


x86 assembly (clang, -O0):
<throughput>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cvtsi2ssq -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
divss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea0(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<throughput>:
cvtsi2ss %rsi,%xmm0
mulss  0xef3(%rip),%xmm0
cvtsi2ss %rdi,%xmm1
movss  0xeea(%rip),%xmm2
divss  %xmm2,%xmm1
divss  %xmm1,%xmm0
divss  %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @throughput(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca float
%6 = alloca float
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = sitofp i64 %7 to float
%9 = fpext float %8 to double
%10 = fmul double %9, 8.000000e+00
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load i64, i64* %3
%13 = sitofp i64 %12 to float
%14 = fpext float %13 to double
%15 = fdiv double %14, 1.000000e+06
%16 = fptrunc double %15 to float
store float %16, float* %6
%17 = load float, float* %5
%18 = load float, float* %6
%19 = fdiv float %17, %18
%20 = fpext float %19 to double
%21 = fdiv double %20, 1.000000e+06
%22 = fptrunc double %21 to float
ret float %22
}

LLVM IR (-O2):
define float @throughput(i64 %0, i64 %1) {
%3 = sitofp i64 %1 to float
%4 = fmul float %3, 8.000000e+00
%5 = sitofp i64 %0 to float
%6 = fdiv float %5, 1.000000e+06
%7 = fdiv float %4, %6
%8 = fdiv float %7, 1.000000e+06
ret float %8
}
void assaisoner(char c, int x, int y, char *buffer) {
  if (x >= 0 && x < 80 && y >= 0 && y < 24)
    buffer[x + y * 80] = c;
}


x86 assembly (clang, -O0):
<assaisoner>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1152 <assaisoner+0x52>
cmpl   $0x50,-0x8(%rbp)
jge    1152 <assaisoner+0x52>
cmpl   $0x0,-0xc(%rbp)
jl     1152 <assaisoner+0x52>
cmpl   $0x18,-0xc(%rbp)
jge    1152 <assaisoner+0x52>
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%ecx
imul   $0x50,-0xc(%rbp),%esi
add    %esi,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<assaisoner>:
cmp    $0x4f,%esi
ja     1119 <assaisoner+0x19>
cmp    $0x17,%edx
ja     1119 <assaisoner+0x19>
shl    $0x4,%edx
lea    (%rdx,%rdx,4),%eax
mov    %esi,%edx
add    %rax,%rdx
mov    %dil,(%rcx,%rdx,1)
ret

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

LLVM IR (-O2):
define void @assaisoner(i8 signext %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = icmp ult i32 %1, 80
%6 = icmp ult i32 %2, 24
%7 = and i1 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = mul nuw nsw i32 %2, 80
%10 = add nuw nsw i32 %9, %1
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %3, i64 %11
store i8 %0, i8* %12
br label %13
13: ; preds = %8, %4
ret void
}
const char *__malidrv_build_info(void) {
  return "malidrv:  CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 "
         "REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 "
         "CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Sun "
         "Feb  2 13:06:42 CET 2014 BUILD=DEBUG CPU=ux500 USING_UMP=1 "
         "USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 "
         "USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= "
         "MALI_PLATFORM_FILE=platform/ux500/mali_platform.c "
         "OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 "
         "USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y";
}


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

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

LLVM IR (-O0):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Sun Feb 2 13:06:42 CET 2014 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [471 x i8] c"malidrv: CONFIG=ux500 USING_OS_MEMORY=1 API_VERSION=17 REPO_URL=r3p1-01rel0 REVISION=r3p1-01rel0 CHANGED_REVISION=r3p1-01rel0 CHANGE_DATE=r3p1-01rel0 BUILD_DATE=Sun Feb 2 13:06:42 CET 2014 BUILD=DEBUG CPU=ux500 USING_UMP=1 USING_HWMEM=1 USING_MALI200=0 USING_MALI400=3 USING_MALI400_L2_CACHE=1 USING_GP2=0 KDIR= MALI_PLATFORM_FILE=platform/ux500/mali_platform.c OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=16 USING_PROFILING=0 USING_INTERNAL_PROFILING=0 USING_GPU_UTILIZATION=y\00"
define i8* @__malidrv_build_info() {
ret i8* getelementptr inbounds ([471 x i8], [471 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int mutexattr_settype(int /*<<< orphan*/ *, int);
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type) {
  return mutexattr_settype(attr, type);
}


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

x86 assembly (clang, -O2):
<pthread_mutexattr_settype>:
jmp    1030 <mutexattr_settype@plt>

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

LLVM IR (-O2):
define i32 @pthread_mutexattr_settype(i32* %0, i32 %1) {
%3 = tail call i32 @mutexattr_settype(i32* %0, i32 %1)
ret i32 %3
}
void recover_after_shellout(void) {}


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

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

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

LLVM IR (-O2):
define void @recover_after_shellout() {
ret void
}
int fs_http_mount(struct fs_dir *d) { return 0; }


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

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

LLVM IR (-O0):
%struct.fs_dir = type opaque
define i32 @fs_http_mount(%struct.fs_dir* %0) {
%2 = alloca %struct.fs_dir*
store %struct.fs_dir* %0, %struct.fs_dir** %2
ret i32 0
}

LLVM IR (-O2):
%struct.fs_dir = type opaque
define i32 @fs_http_mount(%struct.fs_dir* nocapture readnone %0) {
ret i32 0
}
double ls_cost_nm9_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<ls_cost_nm9_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm9_sq>:
mulsd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @ls_cost_nm9_sq(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = fmul double %3, %4
ret double %5
}

LLVM IR (-O2):
define double @ls_cost_nm9_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ inter();
int add(int x, int y) {
  inter();
  return x + y;
}


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

x86 assembly (clang, -O2):
<add>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <inter@plt>
add    %ebx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @inter()
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = tail call i32 (...) @inter()
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
struct pcm {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pcm_mmap_appl_forward(struct pcm *, unsigned int);
int /*<<< orphan*/ pcm_sync_ptr(struct pcm *, int /*<<< orphan*/);
int pcm_mmap_commit(struct pcm *pcm, unsigned int offset, unsigned int frames) {
  (void)offset;
  pcm_mmap_appl_forward(pcm, frames);
  pcm_sync_ptr(pcm, 0);
  return frames;
}


x86 assembly (clang, -O0):
<pcm_mmap_commit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <pcm_mmap_appl_forward@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1040 <pcm_sync_ptr@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcm_mmap_commit>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
mov    %edx,%esi
call   1030 <pcm_mmap_appl_forward@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1040 <pcm_sync_ptr@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pcm = type { i32 }
define i32 @pcm_mmap_commit(%struct.pcm* %0, i32 %1, i32 %2) {
%4 = alloca %struct.pcm*
%5 = alloca i32
%6 = alloca i32
store %struct.pcm* %0, %struct.pcm** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load %struct.pcm*, %struct.pcm** %4
%9 = load i32, i32* %6
%10 = call i32 @pcm_mmap_appl_forward(%struct.pcm* %8, i32 %9)
%11 = load %struct.pcm*, %struct.pcm** %4
%12 = call i32 @pcm_sync_ptr(%struct.pcm* %11, i32 0)
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
%struct.pcm = type { i32 }
define i32 @pcm_mmap_commit(%struct.pcm* %0, i32 %1, i32 returned %2) {
%4 = tail call i32 @pcm_mmap_appl_forward(%struct.pcm* %0, i32 %2)
%5 = tail call i32 @pcm_sync_ptr(%struct.pcm* %0, i32 0)
ret i32 %2
}
int tga_decode_8888(unsigned char *input_bytes, unsigned char *output_bytes) {
  output_bytes[0] = (input_bytes[2]);
  output_bytes[1] = (input_bytes[1]);
  output_bytes[2] = (input_bytes[0]);
  output_bytes[3] = (input_bytes[3]);
  return 4;
}


x86 assembly (clang, -O0):
<tga_decode_8888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tga_decode_8888>:
mov    0x2(%rdi),%al
mov    %al,(%rsi)
mov    0x1(%rdi),%al
mov    %al,0x1(%rsi)
mov    (%rdi),%al
mov    %al,0x2(%rsi)
mov    0x3(%rdi),%al
mov    %al,0x3(%rsi)
mov    $0x4,%eax
ret

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

LLVM IR (-O2):
define i32 @tga_decode_8888(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = load i8, i8* %3
store i8 %4, i8* %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %6, i8* %7
%8 = load i8, i8* %0
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret i32 4
}
int ld_gt_rm2(long double a1, long double *a2) { return !(((a1) > (*a2))); }


x86 assembly (clang, -O0):
<ld_gt_rm2>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
mov    %rdi,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ld_gt_rm2>:
fldt   0x8(%rsp)
fldt   (%rdi)
xor    %eax,%eax
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
setbe  %al
ret

LLVM IR (-O0):
define i32 @ld_gt_rm2(x86_fp80 %0, x86_fp80* %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80*
store x86_fp80 %0, x86_fp80* %3
store x86_fp80* %1, x86_fp80** %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80*, x86_fp80** %4
%7 = load x86_fp80, x86_fp80* %6
%8 = fcmp ogt x86_fp80 %5, %7
%9 = xor i1 %8, true
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ld_gt_rm2(x86_fp80 %0, x86_fp80* nocapture %1) {
%3 = load x86_fp80, x86_fp80* %1
%4 = fcmp uge x86_fp80 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int foo(int);
int main(void) {
  int i = 0;
start:
  while (i < 100) {
    if (i == 42)
      goto end;
    i++;
    goto start;
    i++;
  }
end:
  return i + foo(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    112b <main+0x1b>
cmpl   $0x64,-0x8(%rbp)
jge    1152 <main+0x42>
cmpl   $0x2a,-0x8(%rbp)
jne    1144 <main+0x34>
jmp    1157 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
jmp    1157 <main+0x47>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2a,%edi
call   1030 <foo@plt>
add    $0x2a,%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 = %11, %0
br label %4
4: ; preds = %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 42
br i1 %9, label %10, label %11
10: ; preds = %7
br label %15
11: ; preds = %7
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
br label %3
14: ; preds = %4
br label %15
15: ; preds = %14, %10
%16 = load i32, i32* %2
%17 = load i32, i32* %2
%18 = call i32 @foo(i32 %17)
%19 = add nsw i32 %16, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 42)
%2 = add nsw i32 %1, 42
ret i32 %2
}
/* Type definitions */
struct cfg_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int read_character(struct cfg_t *, char *);
void read_character_err(struct cfg_t *cfg, char *character, char *err_msg) {
  if (read_character(cfg, character) < 1) {
    printf("ERROR: %s\n", err_msg);
    exit(1);
  }
  return;
}


x86 assembly (clang, -O0):
<read_character_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <read_character@plt>
cmp    $0x1,%eax
jge    1174 <read_character_err+0x44>
mov    -0x18(%rbp),%rsi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_character_err>:
push   %rbx
mov    %rdx,%rbx
call   1040 <read_character@plt>
test   %eax,%eax
jle    113f <read_character_err+0xf>
pop    %rbx
ret
lea    0xeba(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.cfg_t = type { i32 }
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @read_character_err(%struct.cfg_t* %0, i8* %1, i8* %2) {
%4 = alloca %struct.cfg_t*
%5 = alloca i8*
%6 = alloca i8*
store %struct.cfg_t* %0, %struct.cfg_t** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.cfg_t*, %struct.cfg_t** %4
%8 = load i8*, i8** %5
%9 = call i32 @read_character(%struct.cfg_t* %7, i8* %8)
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.cfg_t = type { i32 }
@.str = [11 x i8] c"ERROR: %s\0A\00"
define void @read_character_err(%struct.cfg_t* %0, i8* %1, i8* %2) {
%4 = tail call i32 @read_character(%struct.cfg_t* %0, i8* %1)
%5 = icmp slt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GETVAL;
int semctl(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int sem_getval(int semid) {
  int ret;
  ret = semctl(semid, 0, GETVAL, 0);
  return ret;
}


x86 assembly (clang, -O0):
<sem_getval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <semctl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sem_getval>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <semctl@plt>

LLVM IR (-O0):
@GETVAL = global i32 0
define i32 @sem_getval(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @GETVAL
%6 = call i32 @semctl(i32 %4, i32 0, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@GETVAL = global i32 0
define i32 @sem_getval(i32 %0) {
%2 = load i32, i32* @GETVAL
%3 = tail call i32 @semctl(i32 %0, i32 0, i32 %2, i32 0)
ret i32 %3
}
double MPHtoKPH(double MPH) {
  double KPH = 1.609344 * MPH;
  return KPH;
}


x86 assembly (clang, -O0):
<MPHtoKPH>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPHtoKPH>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @MPHtoKPH(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 0x3FF9BFDF7E8038A0, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @MPHtoKPH(double %0) {
%2 = fmul double %0, 0x3FF9BFDF7E8038A0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void const *, double);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ stdout;
void set_member_destroy(const void *member, void *arg) {
  { arg = arg; }
  fprintf(stdout, "\tdestroyed=>{object=>0x%p,value=>%.3f}\n", member,
          *(double *)member);
  free((void *)member);
}


x86 assembly (clang, -O0):
<set_member_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xeac(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_member_destroy>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
movsd  (%rbx),%xmm0
lea    0xec8(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [40 x i8] c"\09destroyed=>{object=>0x%p,value=>%.3f}\0A\00"
define void @set_member_destroy(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
store i8* %5, i8** %4
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %3
%8 = load i8*, i8** %3
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %7, double %10)
%12 = load i8*, i8** %3
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [40 x i8] c"\09destroyed=>{object=>0x%p,value=>%.3f}\0A\00"
define void @set_member_destroy(i8* %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = bitcast i8* %0 to double*
%5 = load double, double* %4
%6 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0, double %5)
%7 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgesv_(int *, int *, float *, int *, int *, float *, int *,
                          int *);
void clapack_sgesv(int n, int nrhs, float *a, int lda, int *ipiv, float *b,
                   int ldb, int *info) {
  sgesv_(&n, &nrhs, a, &lda, ipiv, b, &ldb, info);
}


x86 assembly (clang, -O0):
<clapack_sgesv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x18(%rbp),%rax
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
lea    0x10(%rbp),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <sgesv_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clapack_sgesv>:
sub    $0x18,%rsp
mov    0x28(%rsp),%r10
mov    %edi,0x14(%rsp)
mov    %esi,0x10(%rsp)
mov    %ecx,0xc(%rsp)
lea    0x20(%rsp),%rax
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
push   %r10
push   %rax
call   1030 <sgesv_@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define void @clapack_sgesv(i32 %0, i32 %1, float* %2, i32 %3, i32* %4, float* %5, i32 %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca float*
%12 = alloca i32
%13 = alloca i32*
%14 = alloca float*
%15 = alloca i32
%16 = alloca i32*
store i32 %0, i32* %9
store i32 %1, i32* %10
store float* %2, float** %11
store i32 %3, i32* %12
store i32* %4, i32** %13
store float* %5, float** %14
store i32 %6, i32* %15
store i32* %7, i32** %16
%17 = load float*, float** %11
%18 = load i32*, i32** %13
%19 = load float*, float** %14
%20 = load i32*, i32** %16
%21 = call i32 @sgesv_(i32* %9, i32* %10, float* %17, i32* %12, i32* %18, float* %19, i32* %15, i32* %20)
ret void
}

LLVM IR (-O2):
define void @clapack_sgesv(i32 %0, i32 %1, float* %2, i32 %3, i32* %4, float* %5, i32 %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %3, i32* %11
store i32 %6, i32* %12
%13 = call i32 @sgesv_(i32* %9, i32* %10, float* %2, i32* %11, i32* %4, float* %5, i32* %12, i32* %7)
ret void
}
/* Variables and functions */
double fmod(double, int);
double f(double t) {
  if (fmod(t, 1) < 0.5) {
    return -1;
  }
  return 1;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%edi
call   1030 <fmod@plt>
movaps %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    1153 <f+0x43>
movsd  0xec7(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1160 <f+0x50>
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
mov    $0x1,%edi
call   1030 <fmod@plt>
movsd  0xedd(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
lea    0xed5(%rip),%rcx
movsd  (%rcx,%rax,8),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = call double @fmod(double %4, i32 1)
%6 = fcmp olt double %5, 5.000000e-01
br i1 %6, label %7, label %8
7: ; preds = %1
store double -1.000000e+00, double* %2
br label %9
8: ; preds = %1
store double 1.000000e+00, double* %2
br label %9
9: ; preds = %8, %7
%10 = load double, double* %2
ret double %10
}

LLVM IR (-O2):
define double @f(double %0) {
%2 = tail call double @fmod(double %0, i32 1)
%3 = fcmp olt double %2, 5.000000e-01
%4 = select i1 %3, double -1.000000e+00, double 1.000000e+00
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ funca();
void func1(void) {
  funca();
  return;
}


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

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

LLVM IR (-O0):
define void @func1() {
%1 = call i32 (...) @funca()
ret void
}

LLVM IR (-O2):
define void @func1() {
%1 = tail call i32 (...) @funca()
ret void
}
void stripCRLF(char *buf) {
  while (*buf && *buf != '\n' && *buf != '\r') {
    ++buf;
  }
  *buf = '\0';
}


x86 assembly (clang, -O0):
<stripCRLF>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1142 <stripCRLF+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
je     1142 <stripCRLF+0x42>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1152 <stripCRLF+0x52>
jmp    1163 <stripCRLF+0x63>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <stripCRLF+0x8>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripCRLF>:
mov    $0x2401,%eax
jmp    1114 <stripCRLF+0x14>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rdi
movzbl (%rdi),%ecx
cmp    $0xd,%rcx
ja     1110 <stripCRLF+0x10>
bt     %rcx,%rax
jae    1110 <stripCRLF+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @stripCRLF(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 10, label %7
i8 13, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2
store i8 0, i8* %3
ret void
}
/* Type definitions */
typedef int A;

/* Variables and functions */
int f(int const *, int *);
int g() {
  int *p = (struct A *)0;
  return f((const struct A *)0, (int *)0);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <f@plt>

LLVM IR (-O0):
define i32 @g() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i32 @f(i32* null, i32* null)
ret i32 %2
}

LLVM IR (-O2):
define i32 @g() {
%1 = tail call i32 @f(i32* null, i32* null)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ ap_base64decode(char *, char const *);
int ap_base64decode_len(char const *);
scalar_t__ malloc(int);
void b64_decode(const char *data, char *result, int *result_len) {
  *result_len = ap_base64decode_len(data);
  result = (char *)malloc(*result_len + 1);
  ap_base64decode(result, data);
}


x86 assembly (clang, -O0):
<b64_decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <ap_base64decode_len@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <ap_base64decode@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b64_decode>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1050 <ap_base64decode_len@plt>
mov    %eax,(%r14)
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <ap_base64decode@plt>

LLVM IR (-O0):
define void @b64_decode(i8* %0, i8* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = call i32 @ap_base64decode_len(i8* %7)
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = add nsw i32 %11, 1
%13 = call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to i8*
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i32 @ap_base64decode(i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
define void @b64_decode(i8* %0, i8* nocapture readnone %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @ap_base64decode_len(i8* %0)
store i32 %4, i32* %2
%5 = add nsw i32 %4, 1
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @ap_base64decode(i8* %7, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __coverity_alloc__(int);
int /*<<< orphan*/ __coverity_escape__(char const *);
void *cn_cbor_string_create(const char *data, void *context, void *errp) {
  __coverity_alloc__(10);
  __coverity_escape__(data);
}


x86 assembly (clang, -O0):
<cn_cbor_string_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    $0xa,%edi
call   1030 <__coverity_alloc__@plt>
mov    -0x10(%rbp),%rdi
call   1040 <__coverity_escape__@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cn_cbor_string_create>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <__coverity_alloc__@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <__coverity_escape__@plt>

LLVM IR (-O0):
define i8* @cn_cbor_string_create(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 @__coverity_alloc__(i32 10)
%9 = load i8*, i8** %5
%10 = call i32 @__coverity_escape__(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @cn_cbor_string_create(i8* %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 @__coverity_alloc__(i32 10)
%5 = tail call i32 @__coverity_escape__(i8* %0)
ret i8* undef
}