xunge/DecIR huggingface dataset:
void debug_start() {}


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

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

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

LLVM IR (-O2):
define void @debug_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printk(char *, int);
int init_module(void) {
  printk("sizeof(int): %d\n", sizeof(int));
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"sizeof(int): %d\0A\00"
define i32 @init_module() {
%1 = call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"sizeof(int): %d\0A\00"
define i32 @init_module() {
%1 = tail call i32 @printk(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 4)
ret i32 0
}
/* Type definitions */
struct tokenList {
  int dummy;
};
struct outputBuffer {
  int dummy;
};
struct in_addr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inet_ntoa(struct in_addr);
int /*<<< orphan*/ outputString(struct outputBuffer *, struct tokenList *, int,
                                int /*<<< orphan*/);
void outputIpAddr(struct outputBuffer *ob, struct tokenList *toks,
                  int updateField, struct in_addr addr) {
  outputString(ob, toks, updateField, inet_ntoa(addr));
}


x86 assembly (clang, -O0):
<outputIpAddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %ecx,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <inet_ntoa@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    %eax,%ecx
call   1030 <outputString@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outputIpAddr>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %ecx,%edi
call   1040 <inet_ntoa@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <outputString@plt>

LLVM IR (-O0):
%struct.outputBuffer = type { i32 }
%struct.tokenList = type { i32 }
%struct.in_addr = type { i32 }
define void @outputIpAddr(%struct.outputBuffer* %0, %struct.tokenList* %1, i32 %2, i32 %3) {
%5 = alloca %struct.in_addr
%6 = alloca %struct.outputBuffer*
%7 = alloca %struct.tokenList*
%8 = alloca i32
%9 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
store i32 %3, i32* %9
store %struct.outputBuffer* %0, %struct.outputBuffer** %6
store %struct.tokenList* %1, %struct.tokenList** %7
store i32 %2, i32* %8
%10 = load %struct.outputBuffer*, %struct.outputBuffer** %6
%11 = load %struct.tokenList*, %struct.tokenList** %7
%12 = load i32, i32* %8
%13 = getelementptr inbounds %struct.in_addr, %struct.in_addr* %5, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @inet_ntoa(i32 %14)
%16 = call i32 @outputString(%struct.outputBuffer* %10, %struct.tokenList* %11, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.outputBuffer = type { i32 }
%struct.tokenList = type { i32 }
define void @outputIpAddr(%struct.outputBuffer* %0, %struct.tokenList* %1, i32 %2, i32 %3) {
%5 = tail call i32 @inet_ntoa(i32 %3)
%6 = tail call i32 @outputString(%struct.outputBuffer* %0, %struct.tokenList* %1, i32 %2, i32 %5)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int celcon_track_quaddobl_solution_path(int k, int i, int otp) {
  int b[2], fail;
  double *c;
  b[0] = i;
  b[1] = otp;
  fail = _ada_use_c2phc(477, &k, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_track_quaddobl_solution_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x1dd,%edi
lea    -0x4(%rbp),%rsi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_track_quaddobl_solution_path>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
mov    $0x1dd,%edi
call   1030 <_ada_use_c2phc@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @celcon_track_quaddobl_solution_path(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
%8 = alloca i32
%9 = alloca double*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %10, i32* %11
%12 = load i32, i32* %6
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %12, i32* %13
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%15 = load double*, double** %9
%16 = call i32 @_ada_use_c2phc(i32 477, i32* %4, i32* %14, double* %15)
store i32 %16, i32* %8
%17 = load i32, i32* %8
ret i32 %17
}

LLVM IR (-O2):
define i32 @celcon_track_quaddobl_solution_path(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca [2 x i32]
store i32 %0, i32* %4
%6 = bitcast [2 x i32]* %5 to i8*
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
store i32 %1, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
store i32 %2, i32* %8
%9 = call i32 @_ada_use_c2phc(i32 477, i32* %4, i32* %7, double* undef)
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ *XOpenDisplay(int /*<<< orphan*/ *);
int /*<<< orphan*/ skip_test(char *);
Display *open_display(void) {
  Display *display = XOpenDisplay(NULL);
  if (!display)
    skip_test("Unable to open display");
  return display;
}


x86 assembly (clang, -O0):
<open_display>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114c <open_display+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <skip_test@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_display>:
push   %rbx
xor    %edi,%edi
call   1040 <XOpenDisplay@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <open_display+0x1c>
lea    0xec9(%rip),%rdi
call   1030 <skip_test@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Unable to open display\00"
define i32* @open_display() {
%1 = alloca i32*
%2 = call i32* @XOpenDisplay(i32* null)
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 @skip_test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32*, i32** %1
ret i32* %8
}

LLVM IR (-O2):
@.str = [23 x i8] c"Unable to open display\00"
define i32* @open_display() {
%1 = tail call i32* @XOpenDisplay(i32* null)
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @skip_test(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32* %1
}
/* Variables and functions */
void UsageFault_Handler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @UsageFault_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ getgid();
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ perror(char *);
scalar_t__ setgid(int /*<<< orphan*/);
scalar_t__ setuid(int /*<<< orphan*/);
int drop_root(void) {
  if (setuid(getuid()) || setgid(getgid())) {
    perror("Could not drop root privileges.\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<drop_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%edi
call   1070 <setuid@plt>
cmp    $0x0,%rax
jne    1188 <drop_root+0x38>
mov    $0x0,%al
call   1040 <getgid@plt>
mov    %eax,%edi
call   1050 <setgid@plt>
cmp    $0x0,%rax
je     11a0 <drop_root+0x50>
lea    0xe71(%rip),%rdi
call   1060 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a7 <drop_root+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop_root>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%edi
call   1070 <setuid@plt>
test   %rax,%rax
jne    117d <drop_root+0x2d>
xor    %eax,%eax
call   1040 <getgid@plt>
mov    %eax,%edi
call   1050 <setgid@plt>
test   %rax,%rax
jne    117d <drop_root+0x2d>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xe7c(%rip),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%ebx
jmp    1179 <drop_root+0x29>

LLVM IR (-O0):
@.str = [33 x i8] c"Could not drop root privileges.\0A\00"
define i32 @drop_root() {
%1 = alloca i32
%2 = call i32 (...) @getuid()
%3 = call i64 @setuid(i32 %2)
%4 = icmp ne i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %0
%6 = call i32 (...) @getgid()
%7 = call i64 @setgid(i32 %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5, %0
%10 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %12
11: ; preds = %5
store i32 0, i32* %1
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [33 x i8] c"Could not drop root privileges.\0A\00"
define i32 @drop_root() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i64 @setuid(i32 %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = tail call i32 (...) @getgid()
%6 = tail call i64 @setgid(i32 %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %4, %0
%9 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %4, %8
%11 = phi i32 [ -1, %8 ], [ 0, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ sig_catch(int, int /*<<< orphan*/);
void sig_ignore(int sig) { sig_catch(sig, SIG_IGN); }


x86 assembly (clang, -O0):
<sig_ignore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec3(%rip),%rax
mov    (%rax),%esi
call   1030 <sig_catch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_ignore>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <sig_catch@plt>

LLVM IR (-O0):
@SIG_IGN = global i32 0
define void @sig_ignore(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIG_IGN
%5 = call i32 @sig_catch(i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@SIG_IGN = global i32 0
define void @sig_ignore(i32 %0) {
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @sig_catch(i32 %0, i32 %2)
ret void
}
char DBFGetNullCharacter(char chType) {
  switch (chType) {
  case 'N':
  case 'F':
    return '*';
  case 'D':
    return '0';
  case 'L':
    return '?';
  default:
    return ' ';
  }
}


x86 assembly (clang, -O0):
<DBFGetNullCharacter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
add    $0xffffffbc,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0xa,%eax
ja     114f <DBFGetNullCharacter+0x4f>
mov    -0x10(%rbp),%rax
lea    0xed5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x2a,-0x1(%rbp)
jmp    1153 <DBFGetNullCharacter+0x53>
movb   $0x30,-0x1(%rbp)
jmp    1153 <DBFGetNullCharacter+0x53>
movb   $0x3f,-0x1(%rbp)
jmp    1153 <DBFGetNullCharacter+0x53>
movb   $0x20,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DBFGetNullCharacter>:
add    $0xffffffbc,%edi
ror    %edi
lea    0x0(,%rdi,8),%ecx
movabs $0x2a3f20202a30,%rdx
shr    %cl,%rdx
cmp    $0x6,%edi
mov    $0x20,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @DBFGetNullCharacter(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
switch i32 %5, label %9 [
i32 78, label %6
i32 70, label %6
i32 68, label %7
i32 76, label %8
]
6: ; preds = %1, %1
store i8 42, i8* %2
br label %10
7: ; preds = %1
store i8 48, i8* %2
br label %10
8: ; preds = %1
store i8 63, i8* %2
br label %10
9: ; preds = %1
store i8 32, i8* %2
br label %10
10: ; preds = %9, %8, %7, %6
%11 = load i8, i8* %2
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @DBFGetNullCharacter(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -68
%4 = tail call i32 @llvm.fshl.i32(i32 %3, i32 %3, i32 31)
%5 = icmp ult i32 %4, 6
%6 = zext i32 %4 to i48
%7 = shl nuw nsw i48 %6, 3
%8 = lshr i48 46450610285104, %7
%9 = trunc i48 %8 to i8
%10 = select i1 %5, i8 %9, i8 32
ret i8 %10
}
/* Type definitions */
struct timeval {
  double tv_sec;
  scalar_t__ tv_usec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) == 0)
    return tv.tv_sec + ((double)(tv.tv_usec)) / 1e6;
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jne    1154 <get_time+0x44>
movsd  -0x18(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xebe(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    115c <get_time+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
je     112d <get_time+0x1d>
add    $0x18,%rsp
ret
xorps  %xmm0,%xmm0
cvtsi2sdq 0x10(%rsp),%xmm0
divsd  0xec1(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, i64 }
define double @get_time() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %7, %11
store double %12, double* %1
br label %14
13: ; preds = %0
store double 0.000000e+00, double* %1
br label %14
14: ; preds = %13, %5
%15 = load double, double* %1
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { double, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 1.000000e+06
%12 = fadd double %7, %11
br label %13
13: ; preds = %0, %5
%14 = phi double [ %12, %5 ], [ 0.000000e+00, %0 ]
ret double %14
}
double cbrta_newtond(const double a, const double x) {
  return (1.0 / 3.0) * (x / (a * a) + 2 * a);
}


x86 assembly (clang, -O0):
<cbrta_newtond>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x8(%rbp),%xmm1
addsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0xeca(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbrta_newtond>:
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
mulsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @cbrta_newtond(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = fdiv double %5, %8
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %10, double %9)
%12 = fmul double 0x3FD5555555555555, %11
ret double %12
}

LLVM IR (-O2):
define double @cbrta_newtond(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fdiv double %1, %3
%5 = tail call double @llvm.fmuladd.f64(double %0, double 2.000000e+00, double %4)
%6 = fmul double %5, 0x3FD5555555555555
ret double %6
}
int test_imm_02int16_mem(short *val) {
  return ((*val) & (-0x02 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_02int16_mem>:
cmpw   $0x2,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_02int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 2
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ CMP0_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void CMP0_IRQHandler(void) {
  CMP0_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @CMP0_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @CMP0_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @CMP0_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @CMP0_DriverIRQHandler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fini_logging();
void __attribute__((destructor)) bb_fini(void) { fini_logging(); }


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

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

LLVM IR (-O0):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @bb_fini, i8* null }]
define void @bb_fini() {
%1 = call i32 (...) @fini_logging()
ret void
}

LLVM IR (-O2):
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @bb_fini, i8* null }]
define void @bb_fini() {
%1 = tail call i32 (...) @fini_logging()
ret void
}
__attribute__((always_)) void native_swapgs(void) {
  asm volatile("swapgs" ::: "memory");
}


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

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

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

LLVM IR (-O2):
define void @native_swapgs() {
tail call void asm sideeffect "swapgs", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned char minor_code;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
void set_XErrorEvent_minor_code(void *_p, unsigned char _v) {
  ((XErrorEvent *)_p)->minor_code = (unsigned char)_v;
}


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

x86 assembly (clang, -O2):
<set_XErrorEvent_minor_code>:
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XErrorEvent_minor_code(i8* nocapture writeonly %0, i8 zeroext %1) {
store i8 %1, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("fini 123\n");
  return 123;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7b,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [10 x i8] c"fini 123\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 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 123
}

LLVM IR (-O2):
@str = [9 x i8] c"fini 123\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 123
}
/* Variables and functions */
int /*<<< orphan*/ SHUT_RDWR;
int close(int);
int /*<<< orphan*/ perror(char *);
scalar_t__ shutdown(int, int /*<<< orphan*/);
int close_socket(int sockfd) {
  if (shutdown(sockfd, SHUT_RDWR) < 0) {
    perror("shutdown");
    return -1;
  }
  return close(sockfd);
}


x86 assembly (clang, -O0):
<close_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
cmp    $0x0,%rax
jge    116e <close_socket+0x3e>
lea    0xea3(%rip),%rdi
call   1050 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1179 <close_socket+0x49>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_socket>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%esi
call   1030 <shutdown@plt>
test   %rax,%rax
js     114e <close_socket+0x1e>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>
lea    0xeab(%rip),%rdi
call   1050 <perror@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@SHUT_RDWR = global i32 0
@.str = [9 x i8] c"shutdown\00"
define i32 @close_socket(i32 %0) {
%2 = load i32, i32* @SHUT_RDWR
%3 = tail call i64 @shutdown(i32 %0, i32 %2)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = tail call i32 @close(i32 %0)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ -1, %5 ], [ %8, %7 ]
ret i32 %10
}
void demo_foo() { printf("%s\n", __func__); }


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

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

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

LLVM IR (-O2):
@__func__.demo_foo = [9 x i8] c"demo_foo\00"
define void @demo_foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @__func__.demo_foo, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(int);
newline() { output_byte(10); }


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

x86 assembly (clang, -O2):
<newline>:
mov    $0xa,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define i32 @newline() {
%1 = alloca i32
%2 = call i32 @output_byte(i32 10)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @newline() {
%1 = tail call i32 @output_byte(i32 10)
ret i32 undef
}
_Bool streamClose(int descriptor) { return close(descriptor) == 0; }


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

x86 assembly (clang, -O2):
<streamClose>:
push   %rax
xor    %eax,%eax
call   1030 <close@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i1 @streamClose(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %3)
%5 = icmp eq i32 %4, 0
ret i1 %5
}

LLVM IR (-O2):
define zeroext i1 @streamClose(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %0)
%3 = icmp eq i32 %2, 0
ret i1 %3
}
/* Type definitions */
typedef scalar_t__ int8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void print_b_N(int8_t number) { printf("%d\n", (int)number); }


x86 assembly (clang, -O0):
<print_b_N>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%esi
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_b_N>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print_b_N(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int sc_run_unit_tests(int *, char ***);
int main(int argc, char **argv) { return sc_run_unit_tests(&argc, &argv); }


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)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <sc_run_unit_tests@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %rsi,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <sc_run_unit_tests@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
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 @sc_run_unit_tests(i32* %4, i8*** %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @sc_run_unit_tests(i32* %3, i8*** %4)
ret i32 %5
}
/* Variables and functions */
int lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", lengthOfLongestSubstring(argv[1]));
  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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xecf(%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 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 @lengthOfLongestSubstring(i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @lengthOfLongestSubstring(i8* %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ ungetc(int, int /*<<< orphan*/);
int checkForStyle() {
  int c;
  c = getchar();
  if (c == '~') {
    ungetc(c, stdin);
    return 1;
  } else {
    ungetc(c, stdin);
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkForStyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x7e,-0x8(%rbp)
jne    1159 <checkForStyle+0x39>
mov    -0x8(%rbp),%edi
mov    0x2ea2(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
movl   $0x1,-0x4(%rbp)
jmp    1171 <checkForStyle+0x51>
mov    -0x8(%rbp),%edi
mov    0x2e85(%rip),%rax
mov    (%rax),%esi
call   1040 <ungetc@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkForStyle>:
push   %rbx
xor    %eax,%eax
call   1030 <getchar@plt>
xor    %ebx,%ebx
cmp    $0x7e,%eax
sete   %bl
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1040 <ungetc@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
define i32 @checkForStyle() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getchar()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 126
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load i32, i32* %2
%8 = load i32, i32* @stdin
%9 = call i32 @ungetc(i32 %7, i32 %8)
store i32 1, i32* %1
br label %14
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* @stdin
%13 = call i32 @ungetc(i32 %11, i32 %12)
store i32 0, i32* %1
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @checkForStyle() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 126
%3 = load i32, i32* @stdin
%4 = zext i1 %2 to i32
%5 = tail call i32 @ungetc(i32 %1, i32 %3)
ret i32 %4
}
float log2f(float x) {
  float r;
  if (!x)
    return __pole_error(1);
  __asm__ __volatile__("fld1; fyl2x" : "=t"(r) : "0"(x));
  return r;
}


x86 assembly (clang, -O0):
<log2f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    114e <log2f+0x3e>
jp     114e <log2f+0x3e>
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <__pole_error@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1176 <log2f+0x66>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
flds   -0x10(%rbp)
fld1
fyl2x
fstps  -0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2f>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    111b <log2f+0xb>
jnp    1133 <log2f+0x23>
movss  %xmm0,0x4(%rsp)
flds   0x4(%rsp)
fld1
fyl2x
fstps  (%rsp)
movss  (%rsp),%xmm0
pop    %rax
ret
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <__pole_error@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @log2f(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %3
%5 = load float, float* %3
%6 = fcmp une float %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = call i32 (i32, ...) bitcast (i32 (...)* @__pole_error to i32 (i32, ...)*)(i32 1)
%9 = sitofp i32 %8 to float
store float %9, float* %2
br label %14
10: ; preds = %1
%11 = load float, float* %3
%12 = call float asm sideeffect "fld1; fyl2x", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %11)
store float %12, float* %4
%13 = load float, float* %4
store float %13, float* %2
br label %14
14: ; preds = %10, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @log2f(float %0) {
%2 = fcmp une float %0, 0.000000e+00
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @__pole_error to i32 (i32, ...)*)(i32 1)
%5 = sitofp i32 %4 to float
br label %8
6: ; preds = %1
%7 = tail call float asm sideeffect "fld1; fyl2x", "={st},0,~{dirflag},~{fpsr},~{flags}"(float %0)
br label %8
8: ; preds = %6, %3
%9 = phi float [ %7, %6 ], [ %5, %3 ]
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fmuld(int s1, int s2, int d) {
  assem_debug("fmuld d%d,d%d,d%d\n", d, s1, s2);
  output_w32(0xee200b00 | ((d & 7) << 12) | ((s1 & 7) << 16) | (s2 & 7));
}


x86 assembly (clang, -O0):
<emit_fmuld>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebf(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0xc(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xee200b00,%edi
mov    -0x4(%rbp),%eax
and    $0x7,%eax
shl    $0x10,%eax
or     %eax,%edi
mov    -0x8(%rbp),%eax
and    $0x7,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fmuld>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xece(%rip),%rdi
mov    %edx,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1030 <assem_debug@plt>
and    $0x7,%r14d
shl    $0xc,%r14d
and    $0x7,%ebp
shl    $0x10,%ebp
and    $0x7,%ebx
or     %ebp,%ebx
lea    (%r14,%rbx,1),%edi
add    $0xee200b00,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"fmuld d%d,d%d,d%d\0A\00"
define void @emit_fmuld(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @assem_debug(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8, i32 %9)
%11 = load i32, i32* %6
%12 = and i32 %11, 7
%13 = shl i32 %12, 12
%14 = or i32 -299889920, %13
%15 = load i32, i32* %4
%16 = and i32 %15, 7
%17 = shl i32 %16, 16
%18 = or i32 %14, %17
%19 = load i32, i32* %5
%20 = and i32 %19, 7
%21 = or i32 %18, %20
%22 = call i32 @output_w32(i32 %21)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"fmuld d%d,d%d,d%d\0A\00"
define void @emit_fmuld(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @assem_debug(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %0, i32 %1)
%5 = shl i32 %2, 12
%6 = and i32 %5, 28672
%7 = shl i32 %0, 16
%8 = and i32 %7, 458752
%9 = and i32 %1, 7
%10 = or i32 %8, %9
%11 = or i32 %10, %6
%12 = or i32 %11, -299889920
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
main() {
  int i = 0;
  do
    ;
  while (i < 5);
  printf(i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    112b <main+0x1b>
cmpl   $0x5,-0x8(%rbp)
jl     1126 <main+0x16>
movslq -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int foo();
long long bar22() {
  int result = foo();
  return result;
}


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

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

LLVM IR (-O0):
define i64 @bar22() {
%1 = alloca i32
%2 = call i32 (...) @foo()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
ret i64 %4
}

LLVM IR (-O2):
define i64 @bar22() {
%1 = tail call i32 (...) @foo()
%2 = sext i32 %1 to i64
ret i64 %2
}
void rwsem_down_write_failed(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<rwsem_down_write_failed>:
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):
<rwsem_down_write_failed>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

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

LLVM IR (-O2):
@__func__.rwsem_down_write_failed = [24 x i8] c"rwsem_down_write_failed\00"
define void @rwsem_down_write_failed() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__func__.rwsem_down_write_failed, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *s) {
  fprintf(stderr, "%s", s);
  fprintf(stderr, "Usage: stripex [-f] files ...\n");
  fprintf(stderr, "strip GNU-binutils aexec header from executables\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebf(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xece(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"Usage: stripex [-f] files ...\0A\00"
@.str.2 = [50 x i8] c"strip GNU-binutils aexec header from executables\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [31 x i8] c"Usage: stripex [-f] files ...\0A\00"
@.str.2 = [50 x i8] c"strip GNU-binutils aexec header from executables\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clearLCDLine(int);
int /*<<< orphan*/ displayLCDString(int, int /*<<< orphan*/, char *);
void init_lcd(void) {
  clearLCDLine(0);
  clearLCDLine(1);
  displayLCDString(0, 0, "BATTERY COR=X.XX");
  displayLCDString(1, 0, "BAC=X.XX PE=X.XX");
}


x86 assembly (clang, -O0):
<init_lcd>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <clearLCDLine@plt>
mov    $0x1,%edi
call   1030 <clearLCDLine@plt>
xor    %esi,%esi
lea    0xec2(%rip),%rdx
mov    %esi,%edi
call   1040 <displayLCDString@plt>
mov    $0x1,%edi
xor    %esi,%esi
lea    0xebe(%rip),%rdx
call   1040 <displayLCDString@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_lcd>:
push   %rax
xor    %edi,%edi
call   1030 <clearLCDLine@plt>
mov    $0x1,%edi
call   1030 <clearLCDLine@plt>
lea    0xec7(%rip),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <displayLCDString@plt>
lea    0xec8(%rip),%rdx
mov    $0x1,%edi
xor    %esi,%esi
pop    %rax
jmp    1040 <displayLCDString@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"BATTERY COR=X.XX\00"
@.str.1 = [17 x i8] c"BAC=X.XX PE=X.XX\00"
define void @init_lcd() {
%1 = call i32 @clearLCDLine(i32 0)
%2 = call i32 @clearLCDLine(i32 1)
%3 = call i32 @displayLCDString(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @displayLCDString(i32 1, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"BATTERY COR=X.XX\00"
@.str.1 = [17 x i8] c"BAC=X.XX PE=X.XX\00"
define void @init_lcd() {
%1 = tail call i32 @clearLCDLine(i32 0)
%2 = tail call i32 @clearLCDLine(i32 1)
%3 = tail call i32 @displayLCDString(i32 0, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @displayLCDString(i32 1, i32 0, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct List {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clear(struct List *);
int /*<<< orphan*/ free(struct List *);
int destroy(struct List *lst) {
  if (lst == 0)
    return -1;
  clear(lst);
  free(lst);
  return 0;
}


x86 assembly (clang, -O0):
<destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <destroy+0x23>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <destroy+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <clear@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy>:
test   %rdi,%rdi
je     113a <destroy+0x1a>
push   %rbx
mov    %rdi,%rbx
call   1040 <clear@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.List = type { i32 }
define i32 @destroy(%struct.List* %0) {
%2 = alloca i32
%3 = alloca %struct.List*
store %struct.List* %0, %struct.List** %3
%4 = load %struct.List*, %struct.List** %3
%5 = icmp eq %struct.List* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %12
7: ; preds = %1
%8 = load %struct.List*, %struct.List** %3
%9 = call i32 @clear(%struct.List* %8)
%10 = load %struct.List*, %struct.List** %3
%11 = call i32 @free(%struct.List* %10)
store i32 0, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.List = type { i32 }
define i32 @destroy(%struct.List* %0) {
%2 = icmp eq %struct.List* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @clear(%struct.List* %0)
%5 = tail call i32 @free(%struct.List* %0)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int htonl(int);
uint32_t htolel(uint32_t hdata) {
  uint32_t bedata = htonl(hdata);
  return (((bedata >> 0) & 0xff) << 24) | (((bedata >> 8) & 0xff) << 16) |
         (((bedata >> 16) & 0xff) << 8) | (((bedata >> 24) & 0xff) << 0);
}


x86 assembly (clang, -O0):
<htolel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x0,%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htolel>:
push   %rax
call   1030 <htonl@plt>
bswap  %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @htolel(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @htonl(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = ashr i32 %6, 0
%8 = and i32 %7, 255
%9 = shl i32 %8, 24
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i32, i32* %3
%16 = ashr i32 %15, 16
%17 = and i32 %16, 255
%18 = shl i32 %17, 8
%19 = or i32 %14, %18
%20 = load i32, i32* %3
%21 = ashr i32 %20, 24
%22 = and i32 %21, 255
%23 = shl i32 %22, 0
%24 = or i32 %19, %23
ret i32 %24
}

LLVM IR (-O2):
define i32 @htolel(i32 %0) {
%2 = tail call i32 @htonl(i32 %0)
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
ret i32 %3
}