xunge/DecIR huggingface dataset:
_swp(w, a, b) char *a, *b;
unsigned w;
{
  char swapbuf[513];
  movmem(a, swapbuf, w);
  movmem(b, a, w);
  movmem(swapbuf, b, w);
}


x86 assembly (clang, -O0):
<_swp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x220(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <movmem@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <movmem@plt>
lea    -0x220(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%edx
mov    $0x0,%al
call   1030 <movmem@plt>
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsp,%r15
mov    %rsi,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <movmem@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <movmem@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <movmem@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @_swp(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [513 x i8]
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%9 = load i8*, i8** %6
%10 = getelementptr inbounds [513 x i8], [513 x i8]* %8, i64 0, i64 0
%11 = load i32, i32* %5
%12 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @movmem to i32 (i8*, i8*, i32, ...)*)(i8* %9, i8* %10, i32 %11)
%13 = load i8*, i8** %7
%14 = load i8*, i8** %6
%15 = load i32, i32* %5
%16 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @movmem to i32 (i8*, i8*, i32, ...)*)(i8* %13, i8* %14, i32 %15)
%17 = getelementptr inbounds [513 x i8], [513 x i8]* %8, i64 0, i64 0
%18 = load i8*, i8** %7
%19 = load i32, i32* %5
%20 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @movmem to i32 (i8*, i8*, i32, ...)*)(i8* %17, i8* %18, i32 %19)
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @_swp(i32 %0, i8* %1, i8* %2) {
%4 = alloca [513 x i8]
%5 = getelementptr inbounds [513 x i8], [513 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @movmem to i32 (i8*, i8*, i32, ...)*)(i8* %1, i8* %5, i32 %0)
%7 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @movmem to i32 (i8*, i8*, i32, ...)*)(i8* %2, i8* %1, i32 %0)
%8 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @movmem to i32 (i8*, i8*, i32, ...)*)(i8* %5, i8* %2, i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stdout;
char *strerror(int);
void print_errno_message(int errnum) {
  char const *s;
  s = strerror(errnum);
  fprintf(stdout, " (%s)", s);
}


x86 assembly (clang, -O0):
<print_errno_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <strerror@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_errno_message>:
push   %rax
call   1040 <strerror@plt>
mov    0x2eb3(%rip),%rcx
mov    (%rcx),%edi
lea    0xeca(%rip),%rsi
mov    %rax,%rdx
pop    %rax
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [6 x i8] c" (%s)\00"
define void @print_errno_message(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @strerror(i32 %4)
store i8* %5, i8** %3
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %3
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [6 x i8] c" (%s)\00"
define void @print_errno_message(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ _random_16_func(int /*<<< orphan*/, int /*<<< orphan*/);
int16_t AMCRandom16(int16_t min, int16_t max) {
  return _random_16_func(min, max);
}


x86 assembly (clang, -O0):
<AMCRandom16>:
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 <_random_16_func@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AMCRandom16>:
jmp    1030 <_random_16_func@plt>

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

LLVM IR (-O2):
define i32 @AMCRandom16(i32 %0, i32 %1) {
%3 = tail call i32 @_random_16_func(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
char *P_tmpdir;
char *malloc(int);
char *mktemp(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
char *emptyFileName() {
  char *vlineFilename = malloc(sizeof(char) * 512);
  sprintf(vlineFilename, "%s", P_tmpdir);
  strcat(vlineFilename, "/XXXXXX");
  vlineFilename = mktemp(vlineFilename);
  return vlineFilename;
}


x86 assembly (clang, -O0):
<emptyFileName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x200,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e87(%rip),%rax
mov    (%rax),%rdx
lea    0xe95(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
call   1060 <mktemp@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyFileName>:
push   %rbx
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    0x2e93(%rip),%rax
mov    (%rax),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <mktemp@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@P_tmpdir = global i8* null
@.str.1 = [8 x i8] c"/XXXXXX\00"
define i8* @emptyFileName() {
%1 = alloca i8*
%2 = call i8* @malloc(i32 512)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = load i8*, i8** @P_tmpdir
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %1
%7 = call i32 @strcat(i8* %6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = load i8*, i8** %1
%9 = call i8* @mktemp(i8* %8)
store i8* %9, i8** %1
%10 = load i8*, i8** %1
ret i8* %10
}

LLVM IR (-O2):
@P_tmpdir = global i8* null
@.str.1 = [8 x i8] c"/XXXXXX\00"
define i8* @emptyFileName() {
%1 = tail call dereferenceable_or_null(512) i8* @malloc(i32 512)
%2 = load i8*, i8** @P_tmpdir
%3 = tail call i8* @strcpy(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
%4 = tail call i32 @strcat(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* @mktemp(i8* %1)
ret i8* %5
}
void PRCMAudioClockEnable(void) {
  (*((volatile unsigned long
          *)(((unsigned long)(0x40082000 + 0x000000D0) & 0xF0000000) |
             0x02000000 |
             (((unsigned long)(0x40082000 + 0x000000D0) & 0x000FFFFF) << 5) |
             ((0) << 2)))) = 1;
}


x86 assembly (clang, -O0):
<PRCMAudioClockEnable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x43041a00,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMAudioClockEnable>:
movq   $0x1,0x43041a00
ret

LLVM IR (-O0):
define void @PRCMAudioClockEnable() {
store volatile i64 1, i64* inttoptr (i64 1124342272 to i64*)
ret void
}

LLVM IR (-O2):
define void @PRCMAudioClockEnable() {
store volatile i64 1, i64* inttoptr (i64 1124342272 to i64*)
ret void
}
/* Variables and functions */
scalar_t__ unlikely(int);
int dl_prio(int prio) {
  if (unlikely(prio < 0)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<dl_prio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <unlikely@plt>
cmp    $0x0,%rax
je     1142 <dl_prio+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <dl_prio+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dl_prio>:
push   %rax
shr    $0x1f,%edi
call   1030 <unlikely@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @dl_prio(i32 %0) {
%2 = lshr i32 %0, 31
%3 = tail call i64 @unlikely(i32 %2)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void Unoff1(void) {}


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

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

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

LLVM IR (-O2):
define void @Unoff1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mrf_write_short(int, int);
void mrf_set_interrupts(void) { mrf_write_short(0x32, 0b11110110); }


x86 assembly (clang, -O0):
<mrf_set_interrupts>:
push   %rbp
mov    %rsp,%rbp
mov    $0x32,%edi
mov    $0xf6,%esi
call   1030 <mrf_write_short@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mrf_set_interrupts>:
mov    $0x32,%edi
mov    $0xf6,%esi
jmp    1030 <mrf_write_short@plt>

LLVM IR (-O0):
define void @mrf_set_interrupts() {
%1 = call i32 @mrf_write_short(i32 50, i32 246)
ret void
}

LLVM IR (-O2):
define void @mrf_set_interrupts() {
%1 = tail call i32 @mrf_write_short(i32 50, i32 246)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
void scanfSample2() {
  char result[20];
  scanf("%10s", result);
  printf("%s\n", result);
}


x86 assembly (clang, -O0):
<scanfSample2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rsi
lea    0xecd(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanfSample2>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
lea    0xec7(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%10s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @scanfSample2() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%10s\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @scanfSample2() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
__attribute__((no)) void func_7(void) {}


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

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

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

LLVM IR (-O2):
define void @func_7() {
ret void
}
/* Variables and functions */
double fabs(double);
double floor(double);
double s_linear(double y, double A) {
  double result = fabs(y - A) / fabs(floor(A - y) + A);
  if (result > 1)
    result = 1;
  if (result < 0)
    result = 0;
  return result;
}


x86 assembly (clang, -O0):
<s_linear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movaps 0xedd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <floor@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm1
movaps 0xeb1(%rip),%xmm2
pand   %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1190 <s_linear+0x80>
movsd  0xe75(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11a6 <s_linear+0x96>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_linear>:
sub    $0x28,%rsp
movsd  %xmm1,0x8(%rsp)
movapd %xmm0,%xmm2
movapd %xmm1,%xmm0
subsd  %xmm2,%xmm0
subsd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
call   1030 <floor@plt>
addsd  0x8(%rsp),%xmm0
movapd 0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
andpd  0xeb3(%rip),%xmm1
movsd  0xebb(%rip),%xmm0
minsd  %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @s_linear(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fsub double %6, %7
%9 = call double @llvm.fabs.f64(double %8)
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = call double @llvm.floor.f64(double %12)
%14 = load double, double* %4
%15 = fadd double %13, %14
%16 = call double @llvm.fabs.f64(double %15)
%17 = fdiv double %9, %16
store double %17, double* %5
%18 = load double, double* %5
%19 = fcmp ogt double %18, 1.000000e+00
br i1 %19, label %20, label %21
20: ; preds = %2
store double 1.000000e+00, double* %5
br label %21
21: ; preds = %20, %2
%22 = load double, double* %5
%23 = fcmp olt double %22, 0.000000e+00
br i1 %23, label %24, label %25
24: ; preds = %21
store double 0.000000e+00, double* %5
br label %25
25: ; preds = %24, %21
%26 = load double, double* %5
ret double %26
}

LLVM IR (-O2):
define double @s_linear(double %0, double %1) {
%3 = fsub double %0, %1
%4 = fsub double %1, %0
%5 = tail call double @llvm.floor.f64(double %4)
%6 = fadd double %5, %1
%7 = fdiv double %3, %6
%8 = tail call double @llvm.fabs.f64(double %7)
%9 = fcmp ogt double %8, 1.000000e+00
%10 = select i1 %9, double 1.000000e+00, double %8
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int system(char *);
int if_up(char *name) {
  char buf[128];
  snprintf(buf, sizeof(buf), "ifconfig %s up", name);
  int ret = system(buf);
  if (ret != 0) {
    printf("Could not bring up interface %s\n", name);
  }
  return ret;
}


x86 assembly (clang, -O0):
<if_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x80,%esi
lea    0xeaa(%rip),%rdx
call   1050 <snprintf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x94(%rbp)
je     118a <if_up+0x5a>
mov    -0x8(%rbp),%rsi
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
mov    -0x94(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_up>:
push   %rbp
push   %rbx
sub    $0x88,%rsp
mov    %rdi,%rbx
lea    0xebd(%rip),%rdx
mov    %rsp,%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
mov    %rbx,%rcx
call   1050 <snprintf@plt>
mov    %rbp,%rdi
call   1030 <system@plt>
mov    %eax,%ebp
test   %eax,%eax
je     1173 <if_up+0x43>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x88,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ifconfig %s up\00"
@.str.1 = [33 x i8] c"Could not bring up interface %s\0A\00"
define i32 @if_up(i8* %0) {
%2 = alloca i8*
%3 = alloca [128 x i8]
%4 = alloca i32
store i8* %0, i8** %2
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %2
%7 = call i32 @snprintf(i8* %5, i32 128, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%9 = call i32 @system(i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %12, %1
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"ifconfig %s up\00"
@.str.1 = [33 x i8] c"Could not bring up interface %s\0A\00"
define i32 @if_up(i8* %0) {
%2 = alloca [128 x i8]
%3 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 128, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @system(i8* %3)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %1
ret i32 %5
}
void unw_save_vfp_as_X() {}


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

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

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

LLVM IR (-O2):
define void @unw_save_vfp_as_X() {
ret void
}
void gtk_text_iter_in_range() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_in_range() {
ret void
}
int __svgalib_rendition_inis1(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @__svgalib_rendition_inis1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a_printFn(char *);
void A_Done(void) { a_printFn("Allocator done\n"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"Allocator done\0A\00"
define void @A_Done() {
%1 = call i32 @a_printFn(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Allocator done\0A\00"
define void @A_Done() {
%1 = tail call i32 @a_printFn(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
unsigned char xor_no_mask(struct libwebsocket *wsi, unsigned char c) {
  return c;
}


x86 assembly (clang, -O0):
<xor_no_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_no_mask>:
mov    %esi,%eax
ret

LLVM IR (-O0):
%struct.libwebsocket = type opaque
define zeroext i8 @xor_no_mask(%struct.libwebsocket* %0, i8 zeroext %1) {
%3 = alloca %struct.libwebsocket*
%4 = alloca i8
store %struct.libwebsocket* %0, %struct.libwebsocket** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
%struct.libwebsocket = type opaque
define zeroext i8 @xor_no_mask(%struct.libwebsocket* nocapture readnone %0, i8 returned zeroext %1) {
ret i8 %1
}
int _sputc(int c, void *input_string) {
  char **string_ptr = (char **)input_string;
  *(*string_ptr)++ = (char)c;
  return c;
}


x86 assembly (clang, -O0):
<_sputc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rdx
mov    (%rdx),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sputc>:
mov    %edi,%eax
mov    (%rsi),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rsi)
mov    %al,(%rcx)
ret

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

LLVM IR (-O2):
define i32 @_sputc(i32 returned %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i8**
%4 = trunc i32 %0 to i8
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %6, i8** %3
store i8 %4, i8* %5
ret i32 %0
}
void mdp4_overlay0_done_mddi(struct mdp_dma_data *dma) {}


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

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

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

LLVM IR (-O2):
%struct.mdp_dma_data = type opaque
define void @mdp4_overlay0_done_mddi(%struct.mdp_dma_data* nocapture %0) {
ret void
}
char *version(void) { return "v1.0.0"; }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"v1.0.0\00"
define i8* @version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
char *strchr(char *, char);
void replTerm(char *c) {
  char *p;
  if ((p = strchr(c, '\n')) != NULL)
    *p = '\0';
}


x86 assembly (clang, -O0):
<replTerm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113f <replTerm+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<replTerm>:
push   %rax
mov    $0xa,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1123 <replTerm+0x13>
movb   $0x0,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @replTerm(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strchr(i8* %4, i8 signext 10)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8*, i8** %3
store i8 0, i8* %8
br label %9
9: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @replTerm(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 10)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
store i8 0, i8* %2
br label %5
5: ; preds = %4, %1
ret void
}
/* Variables and functions */
unsigned int readRange(char **, char *, unsigned short *, unsigned int *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *);
unsigned int strlen(char *);
unsigned int readInternalRange(char *first, unsigned short *rangeLength,
                               unsigned int *range) {
  unsigned int length = strlen(first);
  return readRange(&first, first + length - 1, rangeLength, range, NULL, NULL);
}


x86 assembly (clang, -O0):
<readInternalRange>:
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   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x1c(%rbp),%eax
add    %rax,%rsi
add    $0xffffffffffffffff,%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   1040 <readRange@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readInternalRange>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %rdi,0x8(%rsp)
call   1030 <strlen@plt>
mov    %eax,%eax
lea    (%rbx,%rax,1),%rsi
add    $0xffffffffffffffff,%rsi
lea    0x8(%rsp),%rdi
mov    %r15,%rdx
mov    %r14,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <readRange@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @readInternalRange(i8* %0, i16* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i16* %1, i16** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %7
%10 = load i8*, i8** %4
%11 = load i32, i32* %7
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = getelementptr inbounds i8, i8* %13, i64 -1
%15 = load i16*, i16** %5
%16 = load i32*, i32** %6
%17 = call i32 @readRange(i8** %4, i8* %14, i16* %15, i32* %16, i32* null, i32* null)
ret i32 %17
}

LLVM IR (-O2):
define i32 @readInternalRange(i8* %0, i16* %1, i32* %2) {
%4 = alloca i8*
store i8* %0, i8** %4
%5 = tail call i32 @strlen(i8* %0)
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = getelementptr inbounds i8, i8* %7, i64 -1
%9 = call i32 @readRange(i8** %4, i8* %8, i16* %1, i32* %2, i32* null, i32* null)
ret i32 %9
}
double read_PCSab16Number(char *p) {
  unsigned long o32;
  o32 = 256 * (unsigned long)((unsigned char *)p)[0] +
        (unsigned long)((unsigned char *)p)[1];
  return ((double)o32 / 256.0) - 128.0;
}


x86 assembly (clang, -O0):
<read_PCSab16Number>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
shl    $0x30,%rax
bswap  %rax
mov    %rax,-0x10(%rbp)
movaps 0xeef(%rip),%xmm1
movq   -0x10(%rbp),%xmm0
punpckldq %xmm1,%xmm0
movapd 0xeee(%rip),%xmm1
subpd  %xmm1,%xmm0
movaps %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0xebf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xeab(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_PCSab16Number>:
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
cvtsi2sd %eax,%xmm0
mulsd  0xeec(%rip),%xmm0
addsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @read_PCSab16Number(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = mul i64 256, %7
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = add i64 %8, %12
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = uitofp i64 %14 to double
%16 = fdiv double %15, 2.560000e+02
%17 = fsub double %16, 1.280000e+02
ret double %17
}

LLVM IR (-O2):
define double @read_PCSab16Number(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i64
%4 = shl nuw nsw i64 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = or i64 %4, %7
%9 = uitofp i64 %8 to double
%10 = fmul double %9, 3.906250e-03
%11 = fadd double %10, -1.280000e+02
ret double %11
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int genrand_res53();
uint64_t randomMT() { return genrand_res53() * 0x100000000000000; }


x86 assembly (clang, -O0):
<randomMT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <genrand_res53@plt>
cltq
shl    $0x38,%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @randomMT() {
%1 = call i32 (...) @genrand_res53()
%2 = sext i32 %1 to i64
%3 = mul nsw i64 %2, 72057594037927936
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @randomMT() {
%1 = tail call i32 (...) @genrand_res53()
ret i32 0
}
/* Variables and functions */
int accept(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ warn(char *);
void stream_server(int listenfd) {
  int acceptfd;
  while (1) {
    acceptfd = accept(listenfd, NULL, NULL);
    if (acceptfd < 0) {
      warn("stream_server: accept");
      continue;
    }
    sleep(1);
    close(acceptfd);
  }
}


x86 assembly (clang, -O0):
<stream_server>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rsi
call   1050 <accept@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1178 <stream_server+0x38>
lea    0xe92(%rip),%rdi
call   1030 <warn@plt>
jmp    114b <stream_server+0xb>
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
jmp    114b <stream_server+0xb>

x86 assembly (clang, -O2):
<stream_server>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xeb3(%rip),%r14
jmp    1163 <stream_server+0x23>
nop
mov    %eax,%ebp
mov    $0x1,%edi
call   1060 <sleep@plt>
mov    %ebp,%edi
call   1040 <close@plt>
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <accept@plt>
test   %eax,%eax
jns    1150 <stream_server+0x10>
mov    %r14,%rdi
call   1030 <warn@plt>
jmp    1163 <stream_server+0x23>

LLVM IR (-O0):
@.str = [22 x i8] c"stream_server: accept\00"
define void @stream_server(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %1, %9, %11
%5 = load i32, i32* %2
%6 = call i32 @accept(i32 %5, i32* null, i32* null)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 @warn(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %4
11: ; preds = %4
%12 = call i32 @sleep(i32 1)
%13 = load i32, i32* %3
%14 = call i32 @close(i32 %13)
br label %4
}

LLVM IR (-O2):
@.str = [22 x i8] c"stream_server: accept\00"
define void @stream_server(i32 %0) {
br label %2
2: ; preds = %7, %1
%3 = tail call i32 @accept(i32 %0, i32* null, i32* null)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @warn(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %8
br label %2
8: ; preds = %2
%9 = tail call i32 @sleep(i32 1)
%10 = tail call i32 @close(i32 %3)
br label %7
}
void foo258() {}


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

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

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

LLVM IR (-O2):
define void @foo258() {
ret void
}
void nmi_isr(void) {
  for (;;) {
  }
}


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

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

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

LLVM IR (-O2):
define void @nmi_isr() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *util_strdup(const char *s) {
  char *ret = (char *)malloc(strlen(s) + 1);
  if (!ret)
    return ret;
  strcpy(ret, s);
  return ret;
}


x86 assembly (clang, -O0):
<util_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <util_strdup+0x3d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <util_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <util_strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @util_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @strcpy(i8* %5, i8* %0)
br label %9
9: ; preds = %1, %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ logger_buffer_search_buffer(void *);
int /*<<< orphan*/ logger_stop(int /*<<< orphan*/, int);
int logger_buffer_closing_signal_cb(void *data, const char *signal,
                                    const char *type_data, void *signal_data) {
  (void)data;
  (void)signal;
  (void)type_data;
  logger_stop(logger_buffer_search_buffer(signal_data), 1);
  return 0;
}


x86 assembly (clang, -O0):
<logger_buffer_closing_signal_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1040 <logger_buffer_search_buffer@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <logger_stop@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logger_buffer_closing_signal_cb>:
push   %rax
mov    %rcx,%rdi
call   1040 <logger_buffer_search_buffer@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <logger_stop@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @logger_buffer_closing_signal_cb(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @logger_buffer_search_buffer(i8* %12)
%14 = call i32 @logger_stop(i32 %13, i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @logger_buffer_closing_signal_cb(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i32 @logger_buffer_search_buffer(i8* %3)
%6 = tail call i32 @logger_stop(i32 %5, i32 1)
ret i32 0
}
void stripspaces(char *name) {
  char *p, *non_space;
  non_space = name;
  for (p = name; *p; p++)
    if (*p != ' ')
      non_space = p;
  if (name[0])
    non_space[1] = '\0';
}


x86 assembly (clang, -O0):
<stripspaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1153 <stripspaces+0x53>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     113d <stripspaces+0x3d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1142 <stripspaces+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <stripspaces+0x18>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <stripspaces+0x68>
mov    -0x18(%rbp),%rax
movb   $0x0,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stripspaces>:
mov    %rdi,%rcx
mov    %rdi,%rax
jmp    1114 <stripspaces+0x14>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
movzbl (%rcx),%edx
cmp    $0x20,%dl
je     1110 <stripspaces+0x10>
test   %dl,%dl
je     1125 <stripspaces+0x25>
mov    %rcx,%rax
jmp    1110 <stripspaces+0x10>
cmpb   $0x0,(%rdi)
je     112e <stripspaces+0x2e>
movb   $0x0,0x1(%rax)
ret

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

LLVM IR (-O2):
define void @stripspaces(i8* nocapture %0) {
br label %2
2: ; preds = %7, %1
%3 = phi i8* [ %0, %1 ], [ %9, %7 ]
%4 = phi i8* [ %0, %1 ], [ %8, %7 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %10
i8 32, label %7
]
6: ; preds = %2
br label %7
7: ; preds = %2, %6
%8 = phi i8* [ %3, %6 ], [ %4, %2 ]
%9 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
10: ; preds = %2
%11 = load i8, i8* %0
%12 = icmp eq i8 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = getelementptr inbounds i8, i8* %4, i64 1
store i8 0, i8* %14
br label %15
15: ; preds = %13, %10
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void print_trace(FILE *f) { (void)f; }


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

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

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

LLVM IR (-O2):
define void @print_trace(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  char ch = 'A';
  int x = 300;
  double y = 2.2;
  y = ch + x + y;
  printf("value of y: %f", y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movl   $0x12c,-0xc(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsbl -0x5(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%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 = [15 x i8] c"value of y: %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca double
store i32 0, i32* %1
store i8 65, i8* %2
store i32 300, i32* %3
store double 2.200000e+00, double* %4
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i32, i32* %3
%8 = add nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = load double, double* %4
%11 = fadd double %9, %10
store double %11, double* %4
%12 = load double, double* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"value of y: %f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double 3.672000e+02)
ret i32 0
}
/* Variables and functions */
int countOnes(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("%d\n", countOnes(99));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x63,%edi
call   1040 <countOnes@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(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @countOnes(i32 99)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @countOnes(i32 99)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Line155(long, long, long, long, unsigned long);
void line(long x, long y, long w, long h, unsigned long c) {
  Line155(x, y, w, h, c);
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <Line155@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
jmp    1030 <Line155@plt>

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

LLVM IR (-O2):
define void @line(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i32 @Line155(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4)
ret void
}
/* Variables and functions */
int **foo(int **);
int bar(void) {
  int i = 0, j = 1;
  int *p, **q;
  p = &i;
  q = foo(&p);
  *q = &j;
  return *p;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1030 <foo@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
lea    -0x8(%rbp),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
sub    $0x18,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x1,0x8(%rsp)
lea    0xc(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <foo@plt>
lea    0x8(%rsp),%rcx
mov    %rcx,(%rax)
mov    0x10(%rsp),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @bar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%6 = bitcast i32** %3 to i8*
store i32* %1, i32** %3
%7 = call i32** @foo(i32** %3)
store i32* %2, i32** %7
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdout;
void wait_attach(void) {
  printf("PID %d ready for attach\n", getpid());
  fflush(stdout);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<wait_attach>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1157 <wait_attach+0x27>

x86 assembly (clang, -O2):
<wait_attach>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1160 <wait_attach+0x30>

LLVM IR (-O0):
@.str = [25 x i8] c"PID %d ready for attach\0A\00"
@stdout = global i32 0
define void @wait_attach() {
%1 = call i32 (...) @getpid()
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
br label %5
5: ; preds = %0, %5
br label %5
}

LLVM IR (-O2):
@.str = [25 x i8] c"PID %d ready for attach\0A\00"
@stdout = global i32 0
define void @wait_attach() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
br label %5
5: ; preds = %0, %5
br label %5
}
/* Variables and functions */
int /*<<< orphan*/ coloration(char *, char *);
int /*<<< orphan*/ systemePoints(int /*<<< orphan*/, int /*<<< orphan*/, int);
void defaiteBatailleNavale(int modeDeJeux) {
  coloration("Dommage ! Vous avez perdu.\n", "31");
  systemePoints(0, 0, modeDeJeux);
}


x86 assembly (clang, -O0):
<defaiteBatailleNavale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <coloration@plt>
mov    -0x4(%rbp),%edx
xor    %esi,%esi
mov    %esi,%edi
call   1040 <systemePoints@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<defaiteBatailleNavale>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
lea    0xeeb(%rip),%rsi
call   1030 <coloration@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %ebx,%edx
pop    %rbx
jmp    1040 <systemePoints@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Dommage ! Vous avez perdu.\0A\00"
@.str.1 = [3 x i8] c"31\00"
define void @defaiteBatailleNavale(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @coloration(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @systemePoints(i32 0, i32 0, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Dommage ! Vous avez perdu.\0A\00"
@.str.1 = [3 x i8] c"31\00"
define void @defaiteBatailleNavale(i32 %0) {
%2 = tail call i32 @coloration(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @systemePoints(i32 0, i32 0, i32 %0)
ret void
}
void validptr(void *p) { return; }


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

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

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

LLVM IR (-O2):
define void @validptr(i8* nocapture %0) {
ret void
}