xunge/DecIR huggingface dataset:
/* Variables and functions */
int sl_getc();
int sl_getw() {
  int c0, c1;
  c0 = sl_getc();
  c1 = sl_getc();
  return c0 + (c1 << 8);
}


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

x86 assembly (clang, -O2):
<sl_getw>:
push   %rbx
xor    %eax,%eax
call   1030 <sl_getc@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <sl_getc@plt>
shl    $0x8,%eax
add    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sl_getw() {
%1 = tail call i32 (...) @sl_getc()
%2 = tail call i32 (...) @sl_getc()
%3 = shl i32 %2, 8
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
void *memset(void *, int /*<<< orphan*/, size_t);
void *memclr(void *dst0, size_t length) { return memset(dst0, 0, length); }


x86 assembly (clang, -O0):
<memclr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memclr>:
mov    %rsi,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @memclr(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @memclr(i8* returned writeonly %0, i64 %1) {
tail call void @llvm.memset.p0i8.i64(i8* align 1 %0, i8 0, i64 %1, i1 false)
ret i8* %0
}
void getnstimeofday(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<getnstimeofday>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getnstimeofday>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.getnstimeofday = [15 x i8] c"getnstimeofday\00"
define void @getnstimeofday() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.getnstimeofday, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.getnstimeofday = [15 x i8] c"getnstimeofday\00"
define void @getnstimeofday() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @__func__.getnstimeofday, i64 0, i64 0))
ret void
}
/* Type definitions */
struct _mgmt_listuser_req {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct _mgmt_listuser_req *);
void mgmt_listuser_req_free(struct _mgmt_listuser_req *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<mgmt_listuser_req_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct._mgmt_listuser_req = type { i32 }
define void @mgmt_listuser_req_free(%struct._mgmt_listuser_req* %0) {
%2 = alloca %struct._mgmt_listuser_req*
store %struct._mgmt_listuser_req* %0, %struct._mgmt_listuser_req** %2
%3 = load %struct._mgmt_listuser_req*, %struct._mgmt_listuser_req** %2
%4 = call i32 @free(%struct._mgmt_listuser_req* %3)
ret void
}

LLVM IR (-O2):
%struct._mgmt_listuser_req = type { i32 }
define void @mgmt_listuser_req_free(%struct._mgmt_listuser_req* nocapture %0) {
%2 = tail call i32 @free(%struct._mgmt_listuser_req* %0)
ret void
}
int print_ascii() {
  int i;
  for (i = 1; i < 255; i++) {
    printf("%c%s%i\n", i, "  =>  ", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_ascii>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0xff,-0x4(%rbp)
jge    1155 <print_ascii+0x45>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%ecx
lea    0xec7(%rip),%rdi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <print_ascii+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_ascii>:
push   %r15
push   %r14
push   %rbx
mov    $0x1,%ebx
lea    0xedf(%rip),%r14
lea    0xee0(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1130 <print_ascii+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%c%s%i\0A\00"
@.str.1 = [7 x i8] c" => \00"
define i32 @print_ascii() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 255
br i1 %4, label %5, label %12
5: ; preds = %2
%6 = load i32, i32* %1
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %9
9: ; preds = %5
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %2
12: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%c%s%i\0A\00"
@.str.1 = [7 x i8] c" => \00"
define i32 @print_ascii() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 255
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Variables and functions */
double pow(double, int);
double dist(double v, double mu) {
  double g = 9.81;
  double km_to_m = 1000.0 / 3600.0;
  double braking_distance = pow((v * km_to_m), 2) / (2.0 * mu * g);
  double reaction_distance = v * km_to_m;
  return braking_distance + reaction_distance;
}


x86 assembly (clang, -O0):
<dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xee6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0xea8(%rip),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dist>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
mulsd  0xede(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    $0x2,%edi
call   1030 <pow@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm1,%xmm1
mulsd  0xec4(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @dist(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 9.810000e+00, double* %5
store double 0x3FD1C71C71C71C72, double* %6
%9 = load double, double* %3
%10 = load double, double* %6
%11 = fmul double %9, %10
%12 = call double @pow(double %11, i32 2)
%13 = load double, double* %4
%14 = fmul double 2.000000e+00, %13
%15 = load double, double* %5
%16 = fmul double %14, %15
%17 = fdiv double %12, %16
store double %17, double* %7
%18 = load double, double* %3
%19 = load double, double* %6
%20 = fmul double %18, %19
store double %20, double* %8
%21 = load double, double* %7
%22 = load double, double* %8
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @dist(double %0, double %1) {
%3 = fmul double %0, 0x3FD1C71C71C71C72
%4 = tail call double @pow(double %3, i32 2)
%5 = fmul double %1, 2.000000e+00
%6 = fmul double %5, 9.810000e+00
%7 = fdiv double %4, %6
%8 = fadd double %3, %7
ret double %8
}
/* Variables and functions */
unsigned short *getchrfor(int);
int /*<<< orphan*/ rmescseq(int);
void kb_rmmapping(int keypress) {
  unsigned short *c = getchrfor(keypress);
  *c = 0;
  rmescseq(keypress);
}


x86 assembly (clang, -O0):
<kb_rmmapping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <getchrfor@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movw   $0x0,(%rax)
mov    -0x4(%rbp),%edi
call   1040 <rmescseq@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_rmmapping>:
push   %rbx
mov    %edi,%ebx
call   1030 <getchrfor@plt>
movw   $0x0,(%rax)
mov    %ebx,%edi
pop    %rbx
jmp    1040 <rmescseq@plt>

LLVM IR (-O0):
define void @kb_rmmapping(i32 %0) {
%2 = alloca i32
%3 = alloca i16*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i16* @getchrfor(i32 %4)
store i16* %5, i16** %3
%6 = load i16*, i16** %3
store i16 0, i16* %6
%7 = load i32, i32* %2
%8 = call i32 @rmescseq(i32 %7)
ret void
}

LLVM IR (-O2):
define void @kb_rmmapping(i32 %0) {
%2 = tail call i16* @getchrfor(i32 %0)
store i16 0, i16* %2
%3 = tail call i32 @rmescseq(i32 %0)
ret void
}
int psc_open(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @psc_open() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void net_purge(char *file) {
  unlink(file);
  return;
}


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

x86 assembly (clang, -O2):
<net_purge>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @net_purge(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
/* Type definitions */
struct in_addr {
  int dummy;
};

/* Variables and functions */
char *addr_to_host(struct in_addr *);
char *inet_ntoa(struct in_addr);
char *addr_to_anyname(struct in_addr *addr) {
  char *name;
  if ((name = addr_to_host(addr)) != NULL)
    return name;
  else
    return inet_ntoa(*addr);
}


x86 assembly (clang, -O0):
<addr_to_anyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <addr_to_host@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1150 <addr_to_anyname+0x30>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    115f <addr_to_anyname+0x3f>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <inet_ntoa@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addr_to_anyname>:
push   %rbx
mov    %rdi,%rbx
call   1040 <addr_to_host@plt>
test   %rax,%rax
je     1130 <addr_to_anyname+0x10>
pop    %rbx
ret
mov    (%rbx),%edi
pop    %rbx
jmp    1030 <inet_ntoa@plt>

LLVM IR (-O0):
%struct.in_addr = type { i32 }
define i8* @addr_to_anyname(%struct.in_addr* %0) {
%2 = alloca i8*
%3 = alloca %struct.in_addr*
%4 = alloca i8*
store %struct.in_addr* %0, %struct.in_addr** %3
%5 = load %struct.in_addr*, %struct.in_addr** %3
%6 = call i8* @addr_to_host(%struct.in_addr* %5)
store i8* %6, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %4
store i8* %9, i8** %2
br label %15
10: ; preds = %1
%11 = load %struct.in_addr*, %struct.in_addr** %3
%12 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i8* @inet_ntoa(i32 %13)
store i8* %14, i8** %2
br label %15
15: ; preds = %10, %8
%16 = load i8*, i8** %2
ret i8* %16
}

LLVM IR (-O2):
%struct.in_addr = type { i32 }
define i8* @addr_to_anyname(%struct.in_addr* %0) {
%2 = tail call i8* @addr_to_host(%struct.in_addr* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i8* @inet_ntoa(i32 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ %2, %1 ]
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ xyz(int);
void main() {
  int i;
  for (i = 0; i < 5; i++) {
    xyz(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113f <main+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <xyz@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <main+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <xyz@plt>
mov    $0x1,%edi
call   1030 <xyz@plt>
mov    $0x2,%edi
call   1030 <xyz@plt>
mov    $0x3,%edi
call   1030 <xyz@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <xyz@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @xyz(i32 0)
%2 = tail call i32 @xyz(i32 1)
%3 = tail call i32 @xyz(i32 2)
%4 = tail call i32 @xyz(i32 3)
%5 = tail call i32 @xyz(i32 4)
ret void
}
int second() { return 12; }


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

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

LLVM IR (-O0):
define i32 @second() {
ret i32 12
}

LLVM IR (-O2):
define i32 @second() {
ret i32 12
}
/* Variables and functions */
int /*<<< orphan*/ wait_millisec(unsigned int);
void aging_delay(unsigned int ms) { wait_millisec(ms); }


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

x86 assembly (clang, -O2):
<aging_delay>:
jmp    1030 <wait_millisec@plt>

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

LLVM IR (-O2):
define void @aging_delay(i32 %0) {
%2 = tail call i32 @wait_millisec(i32 %0)
ret void
}
void copyString(char *from, char *to) {
  while (*from != '\0') {
    *(to++) = *(from++);
  }
  *to = '\0';
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1143 <copyString+0x43>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
jmp    110c <copyString+0xc>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
mov    (%rdi),%al
test   %al,%al
je     1121 <copyString+0x21>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
mov    %al,(%rsi)
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <copyString+0x10>
movb   $0x0,(%rsi)
ret

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

LLVM IR (-O2):
define void @copyString(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %1, %2 ]
%8 = phi i8* [ %9, %5 ], [ %0, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %6, i8* %7
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %1, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret void
}
void progress_dir_v0(char *form, int in0, double in1, double in2, double in3,
                     double in4, double in5, int in6, double in7, int in8) {}


x86 assembly (clang, -O0):
<progress_dir_v0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
movsd  %xmm3,-0x30(%rbp)
movsd  %xmm4,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
movsd  %xmm5,-0x48(%rbp)
mov    %ecx,-0x4c(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @progress_dir_v0(i8* %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
%11 = alloca i8*
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca double
%20 = alloca i32
store i8* %0, i8** %11
store i32 %1, i32* %12
store double %2, double* %13
store double %3, double* %14
store double %4, double* %15
store double %5, double* %16
store double %6, double* %17
store i32 %7, i32* %18
store double %8, double* %19
store i32 %9, i32* %20
ret void
}

LLVM IR (-O2):
define void @progress_dir_v0(i8* nocapture %0, i32 %1, double %2, double %3, double %4, double %5, double %6, i32 %7, double %8, i32 %9) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ main3();
int main() { main3(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @main3()
ret i32 0
}
void zzz(void) {}


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

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

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

LLVM IR (-O2):
define void @zzz() {
ret void
}
/* Type definitions */
struct group {
  unsigned long gr_gid;
};

/* Variables and functions */
unsigned long _parse_ul(char *, char const *);
struct group *getgrnam(char const *);
unsigned long _gid(const char *group) {
  struct group *gr = getgrnam(group);
  if (gr != NULL) {
    return gr->gr_gid;
  } else {
    return _parse_ul("group", group);
  }
}


x86 assembly (clang, -O0):
<_gid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <getgrnam@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1154 <_gid+0x34>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1168 <_gid+0x48>
mov    -0x10(%rbp),%rsi
lea    0xea1(%rip),%rdi
call   1030 <_parse_ul@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_gid>:
push   %rbx
mov    %rdi,%rbx
call   1040 <getgrnam@plt>
test   %rax,%rax
je     1133 <_gid+0x13>
mov    (%rax),%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <_parse_ul@plt>

LLVM IR (-O0):
%struct.group = type { i64 }
@.str = [6 x i8] c"group\00"
define i64 @_gid(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca %struct.group*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.group* @getgrnam(i8* %5)
store %struct.group* %6, %struct.group** %4
%7 = load %struct.group*, %struct.group** %4
%8 = icmp ne %struct.group* %7, null
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load %struct.group*, %struct.group** %4
%11 = getelementptr inbounds %struct.group, %struct.group* %10, i32 0, i32 0
%12 = load i64, i64* %11
store i64 %12, i64* %2
br label %16
13: ; preds = %1
%14 = load i8*, i8** %3
%15 = call i64 @_parse_ul(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14)
store i64 %15, i64* %2
br label %16
16: ; preds = %13, %9
%17 = load i64, i64* %2
ret i64 %17
}

LLVM IR (-O2):
%struct.group = type { i64 }
@.str = [6 x i8] c"group\00"
define i64 @_gid(i8* %0) {
%2 = tail call %struct.group* @getgrnam(i8* %0)
%3 = icmp eq %struct.group* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.group, %struct.group* %2, i64 0, i32 0
%6 = load i64, i64* %5
br label %9
7: ; preds = %1
%8 = tail call i64 @_parse_ul(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %9
9: ; preds = %7, %4
%10 = phi i64 [ %6, %4 ], [ %8, %7 ]
ret i64 %10
}
/* Variables and functions */
char tolower(char);
void lower(char *p) {
  for (; *p; ++p)
    *p = tolower(*p);
}


x86 assembly (clang, -O0):
<lower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <lower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <lower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <lower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <lower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @lower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fun3() {
  printf("\nin fun3\n");
  return 4;
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"\0Ain fun3\0A\00"
define i32 @fun3() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 4
}

LLVM IR (-O2):
@str = [9 x i8] c"\0Ain fun3\00"
define i32 @fun3() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ MemCheck_off();
int /*<<< orphan*/ MemCheck_on();
scalar_t__ is_MemCheck_on();
int /*<<< orphan*/ *pop_info();
int CRYPTO_remove_all_info(void) {
  int ret = 0;
  if (is_MemCheck_on()) {
    MemCheck_off();
    while (pop_info() != NULL)
      ret++;
    MemCheck_on();
  }
  return (ret);
}


x86 assembly (clang, -O0):
<CRYPTO_remove_all_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <is_MemCheck_on@plt>
cmp    $0x0,%rax
je     118d <CRYPTO_remove_all_info+0x4d>
mov    $0x0,%al
call   1050 <MemCheck_off@plt>
mov    $0x0,%al
call   1030 <pop_info@plt>
cmp    $0x0,%rax
je     1186 <CRYPTO_remove_all_info+0x46>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1167 <CRYPTO_remove_all_info+0x27>
mov    $0x0,%al
call   1060 <MemCheck_on@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_remove_all_info>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <is_MemCheck_on@plt>
test   %rax,%rax
je     1176 <CRYPTO_remove_all_info+0x36>
xor    %eax,%eax
call   1050 <MemCheck_off@plt>
mov    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <pop_info@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1160 <CRYPTO_remove_all_info+0x20>
xor    %eax,%eax
call   1060 <MemCheck_on@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @CRYPTO_remove_all_info() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @is_MemCheck_on()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %0
%5 = call i32 (...) @MemCheck_off()
br label %6
6: ; preds = %9, %4
%7 = call i32* (...) @pop_info()
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %6
12: ; preds = %6
%13 = call i32 (...) @MemCheck_on()
br label %14
14: ; preds = %12, %0
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
define i32 @CRYPTO_remove_all_info() {
%1 = tail call i64 (...) @is_MemCheck_on()
%2 = icmp eq i64 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 (...) @MemCheck_off()
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ 0, %3 ], [ %9, %5 ]
%7 = tail call i32* (...) @pop_info()
%8 = icmp eq i32* %7, null
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %5
10: ; preds = %5
%11 = tail call i32 (...) @MemCheck_on()
br label %12
12: ; preds = %10, %0
%13 = phi i32 [ %6, %10 ], [ 0, %0 ]
ret i32 %13
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char const *strchr(char const *, char);
char *smtp_extraxt_mbox_user(const char *addr) {
  int len = strchr(addr, '@') - addr;
  char *buf = malloc(sizeof(char) * len + 1);
  memcpy(buf, addr, len);
  buf[len] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<smtp_extraxt_mbox_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1030 <strchr@plt>
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
add    $0x1,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_extraxt_mbox_user>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x40,%esi
call   1030 <strchr@plt>
sub    %r14,%rax
movslq %eax,%r15
lea    0x1(%r15),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1040 <memcpy@plt>
movb   $0x0,(%rbx,%r15,1)
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @smtp_extraxt_mbox_user(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strchr(i8* %5, i8 signext 64)
%7 = load i8*, i8** %2
%8 = ptrtoint i8* %6 to i64
%9 = ptrtoint i8* %7 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = mul i64 1, %13
%15 = add i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = call i8* @malloc(i32 %16)
store i8* %17, i8** %4
%18 = load i8*, i8** %4
%19 = load i8*, i8** %2
%20 = load i32, i32* %3
%21 = call i32 @memcpy(i8* %18, i8* %19, i32 %20)
%22 = load i8*, i8** %4
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %22, i64 %24
store i8 0, i8* %25
%26 = load i8*, i8** %4
ret i8* %26
}

LLVM IR (-O2):
define i8* @smtp_extraxt_mbox_user(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%3 = ptrtoint i8* %2 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = shl i64 %5, 32
%8 = ashr exact i64 %7, 32
%9 = add i32 %6, 1
%10 = tail call i8* @malloc(i32 %9)
%11 = tail call i32 @memcpy(i8* %10, i8* %0, i32 %6)
%12 = getelementptr inbounds i8, i8* %10, i64 %8
store i8 0, i8* %12
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void output_function_xml_pre() {
  printf("<!DOCTYPE xml>\n");
  printf("<responses>\n");
}


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

x86 assembly (clang, -O2):
<output_function_xml_pre>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeeb(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"<!DOCTYPE xml>\0A\00"
@.str.1 = [13 x i8] c"<responses>\0A\00"
define void @output_function_xml_pre() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"<!DOCTYPE xml>\00"
@str.2 = [12 x i8] c"<responses>\00"
define void @output_function_xml_pre() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EX_USAGE;
int /*<<< orphan*/ errx(int /*<<< orphan*/, char *);
void usage() { errx(EX_USAGE, "usage: uhidvkbdd [-d] uhid0"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@EX_USAGE = global i32 0
@.str = [28 x i8] c"usage: uhidvkbdd [-d] uhid0\00"
define void @usage() {
%1 = load i32, i32* @EX_USAGE
%2 = call i32 @errx(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@EX_USAGE = global i32 0
@.str = [28 x i8] c"usage: uhidvkbdd [-d] uhid0\00"
define void @usage() {
%1 = load i32, i32* @EX_USAGE
%2 = tail call i32 @errx(i32 %1, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((swiftcall)) void
context_1(__attribute__((swift_context)) void *self) {}


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

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

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

LLVM IR (-O2):
define swiftcc void @context_1(i8* nocapture swiftself %0) {
ret void
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
scalar_t__ __getutid(struct utmp const *);
struct utmpx *getutxid(const struct utmpx *id) {
  return (struct utmpx *)__getutid((const struct utmp *)id);
}


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

x86 assembly (clang, -O2):
<getutxid>:
jmp    1030 <__getutid@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @getutxid(%struct.utmpx* %0) {
%2 = alloca %struct.utmpx*
store %struct.utmpx* %0, %struct.utmpx** %2
%3 = load %struct.utmpx*, %struct.utmpx** %2
%4 = bitcast %struct.utmpx* %3 to %struct.utmp*
%5 = call i64 @__getutid(%struct.utmp* %4)
%6 = inttoptr i64 %5 to %struct.utmpx*
ret %struct.utmpx* %6
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define %struct.utmpx* @getutxid(%struct.utmpx* %0) {
%2 = bitcast %struct.utmpx* %0 to %struct.utmp*
%3 = tail call i64 @__getutid(%struct.utmp* %2)
%4 = inttoptr i64 %3 to %struct.utmpx*
ret %struct.utmpx* %4
}
/* Variables and functions */
int flat_dev_read(char *, size_t);
int flat_read(char *buf, size_t len) { return flat_dev_read(buf, len); }


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

x86 assembly (clang, -O2):
<flat_read>:
jmp    1030 <flat_dev_read@plt>

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

LLVM IR (-O2):
define i32 @flat_read(i8* %0, i64 %1) {
%3 = tail call i32 @flat_dev_read(i8* %0, i64 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_scalbl();
scalar_t__ scalbl(long double, long double);
void test_scalbl(long double ld1, long double ld2) {
  if (scalbl(ld1, ld2) != scalbl(ld1, ld2))
    link_failure_scalbl();
}


x86 assembly (clang, -O0):
<test_scalbl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <scalbl@plt>
mov    %rax,-0x28(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1030 <scalbl@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     1175 <test_scalbl+0x55>
mov    $0x0,%al
call   1040 <link_failure_scalbl@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_scalbl>:
push   %rbx
sub    $0x40,%rsp
fldt   0x50(%rsp)
fld    %st(0)
fstpt  0x34(%rsp)
fldt   0x60(%rsp)
fld    %st(0)
fstpt  0x28(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
call   1030 <scalbl@plt>
mov    %rax,%rbx
fldt   0x28(%rsp)
fstpt  0x10(%rsp)
fldt   0x34(%rsp)
fstpt  (%rsp)
call   1030 <scalbl@plt>
cmp    %rax,%rbx
jne    1167 <test_scalbl+0x47>
add    $0x40,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
jmp    1040 <link_failure_scalbl@plt>

LLVM IR (-O0):
define void @test_scalbl(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 = call i64 @scalbl(x86_fp80 %5, x86_fp80 %6)
%8 = load x86_fp80, x86_fp80* %3
%9 = load x86_fp80, x86_fp80* %4
%10 = call i64 @scalbl(x86_fp80 %8, x86_fp80 %9)
%11 = icmp ne i64 %7, %10
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (...) @link_failure_scalbl()
br label %14
14: ; preds = %12, %2
ret void
}

LLVM IR (-O2):
define void @test_scalbl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @scalbl(x86_fp80 %0, x86_fp80 %1)
%4 = tail call i64 @scalbl(x86_fp80 %0, x86_fp80 %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_scalbl()
br label %8
8: ; preds = %6, %2
ret void
}
int main() { return main(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
struct passwd *getpwnam(char *);
int main(void) {
  struct passwd *pass;
  pass = getpwnam("root");
  return 0;
}


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

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

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [5 x i8] c"root\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.passwd*
store i32 0, i32* %1
%3 = call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store %struct.passwd* %3, %struct.passwd** %2
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str = [5 x i8] c"root\00"
define i32 @main() {
%1 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ v4lconvert_hm12_to_rgb(unsigned char const *,
                                          unsigned char *, int, int, int);
void v4lconvert_hm12_to_rgb24(const unsigned char *src, unsigned char *dest,
                              int width, int height) {
  v4lconvert_hm12_to_rgb(src, dest, width, height, 1);
}


x86 assembly (clang, -O0):
<v4lconvert_hm12_to_rgb24>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    $0x1,%r8d
call   1030 <v4lconvert_hm12_to_rgb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v4lconvert_hm12_to_rgb24>:
mov    $0x1,%r8d
jmp    1030 <v4lconvert_hm12_to_rgb@plt>

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

LLVM IR (-O2):
define void @v4lconvert_hm12_to_rgb24(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @v4lconvert_hm12_to_rgb(i8* %0, i8* %1, i32 %2, i32 %3, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
void quithander(int s) {
  printf("Received signal %d ...Waiting\n", s);
  sleep(2);
  printf("Leaving quithander");
}


x86 assembly (clang, -O0):
<quithander>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quithander>:
push   %rax
mov    %edi,%esi
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <sleep@plt>
lea    0xedd(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [31 x i8] c"Received signal %d ...Waiting\0A\00"
@.str.1 = [19 x i8] c"Leaving quithander\00"
define void @quithander(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @sleep(i32 2)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
size_t fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int /*<<< orphan*/);
size_t dsettoheader(FILE *f) { return fseek(f, 0, SEEK_SET); }


x86 assembly (clang, -O0):
<dsettoheader>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <fseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@SEEK_SET = global i32 0
define i64 @dsettoheader(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @SEEK_SET
%5 = call i64 @fseek(i32* %3, i32 0, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i64 @dsettoheader(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_SET
%3 = tail call i64 @fseek(i32* %0, i32 0, i32 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ my_cold_memset(void *, int, int);
void t(void *a, int b, int c) {
  if (a)
    my_cold_memset(a, b, 40);
}


x86 assembly (clang, -O0):
<t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     113e <t+0x2e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x28,%edx
call   1030 <my_cold_memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t>:
test   %rdi,%rdi
je     111f <t+0xf>
mov    $0x28,%edx
jmp    1030 <my_cold_memset@plt>
ret

LLVM IR (-O0):
define void @t(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 = icmp ne i8* %7, null
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @my_cold_memset(i8* %10, i32 %11, i32 40)
br label %13
13: ; preds = %9, %3
ret void
}

LLVM IR (-O2):
define void @t(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @my_cold_memset(i8* %0, i32 %1, i32 40)
br label %7
7: ; preds = %5, %3
ret void
}
void AUTHORITY_INFO_ACCESS_new(void) {}


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

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

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

LLVM IR (-O2):
define void @AUTHORITY_INFO_ACCESS_new() {
ret void
}
void cset_test_atomic_open(volatile int *gate) {
  asm volatile("jmp check\n"
               "wait:\n"
               "pause\n"
               "check:\n"
               "mov %[lock], %%eax\n"
               "lock xchg %%eax, %[gate]\n"
               "test %%eax, %%eax\n"
               "jnz wait\n"
               : [gate] "=m"(*gate)
               : [lock] "r"(1)
               : "eax");
}


x86 assembly (clang, -O0):
<cset_test_atomic_open>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
jmp    1118 <check>

x86 assembly (clang, -O2):
<cset_test_atomic_open>:
mov    $0x1,%ecx
jmp    1109 <check>

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

LLVM IR (-O2):
define void @cset_test_atomic_open(i32* %0) {
tail call void asm sideeffect "jmp check\0Await:\0Apause\0Acheck:\0Amov $1, %eax\0Alock xchg %eax, $0\0Atest %eax, %eax\0Ajnz wait\0A", "=*m,r,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0, i32 1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
__attribute__((always_)) uint8_t BME_LAC1_B(volatile uint8_t *addr,
                                            uint8_t bit) {
  return *(volatile uint8_t *)((uint32_t)addr | (1 << 27) | (bit << 21));
}


x86 assembly (clang, -O0):
<BME_LAC1_B>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
or     $0x8000000,%eax
mov    -0xc(%rbp),%ecx
shl    $0x15,%ecx
or     %ecx,%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BME_LAC1_B>:
shl    $0x15,%esi
or     %edi,%esi
movslq %esi,%rax
or     $0x8000000,%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
define i32 @BME_LAC1_B(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 = ptrtoint i32* %5 to i32
%7 = or i32 %6, 134217728
%8 = load i32, i32* %4
%9 = shl i32 %8, 21
%10 = or i32 %7, %9
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
%13 = load volatile i32, i32* %12
ret i32 %13
}

LLVM IR (-O2):
define i32 @BME_LAC1_B(i32* %0, i32 %1) {
%3 = ptrtoint i32* %0 to i64
%4 = trunc i64 %3 to i32
%5 = shl i32 %1, 21
%6 = or i32 %5, %4
%7 = or i32 %6, 134217728
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ create_directory(char *, int);
void aroma_memory_debug_init() { create_directory("/tmp/aroma-memory", 0777); }


x86 assembly (clang, -O0):
<aroma_memory_debug_init>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1ff,%esi
call   1030 <create_directory@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aroma_memory_debug_init>:
lea    0xee9(%rip),%rdi
mov    $0x1ff,%esi
jmp    1030 <create_directory@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"/tmp/aroma-memory\00"
define void @aroma_memory_debug_init() {
%1 = call i32 @create_directory(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 511)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"/tmp/aroma-memory\00"
define void @aroma_memory_debug_init() {
%1 = tail call i32 @create_directory(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 511)
ret void
}