xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int VISIT;

/* Variables and functions */
#define leaf 129
#define preorder 128
int /*<<< orphan*/ printf(char *, int);
void action(const void *nodep, const VISIT which, const int depth) {
  int *datap;
  switch (which) {
  case preorder:
  case leaf:
    datap = *(int **)nodep;
    printf("%6d\n", *datap);
    break;
  default:
    break;
  }
}


x86 assembly (clang, -O0):
<action>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffff80,%eax
sub    $0x1,%eax
ja     1158 <action+0x48>
jmp    1136 <action+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    115d <action+0x4d>
jmp    115d <action+0x4d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<action>:
and    $0xfffffffe,%esi
cmp    $0x80,%esi
jne    112c <action+0x1c>
mov    (%rdi),%rax
mov    (%rax),%esi
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%6d\0A\00"
define void @action(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
switch i32 %8, label %16 [
i32 128, label %9
i32 129, label %9
]
9: ; preds = %3, %3
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32**
%12 = load i32*, i32** %11
store i32* %12, i32** %7
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %17
16: ; preds = %3
br label %17
17: ; preds = %16, %9
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%6d\0A\00"
define void @action(i8* nocapture %0, i32 %1, i32 %2) {
%4 = and i32 %1, -2
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = bitcast i8* %0 to i32**
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %3, %6
ret void
}
void SPUstopChannels2(unsigned short channels) {}


x86 assembly (clang, -O0):
<SPUstopChannels2>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @SPUstopChannels2(i16 zeroext %0) {
ret void
}
int test_imm_C4uint8_mem(unsigned char *val) {
  return ((*val) & (0xC4 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_C4uint8_mem>:
testb  $0xc4,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C4uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 196
%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_C4uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -60
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int accept(int, struct sockaddr *, int *);
int /*<<< orphan*/ perror(char *);
int acceptConnection(int sockfd, struct sockaddr *clientAddress) {
  int addrlen = sizeof(*clientAddress);
  int clientfd = accept(sockfd, clientAddress, &addrlen);
  if (clientfd == -1) {
    perror("accept client sock error:");
    return -1;
  }
  return clientfd;
}


x86 assembly (clang, -O0):
<acceptConnection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <accept@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0xffffffff,-0x18(%rbp)
jne    116b <acceptConnection+0x4b>
lea    0xea6(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <acceptConnection+0x51>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acceptConnection>:
push   %rbx
sub    $0x10,%rsp
movl   $0x4,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1040 <accept@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1146 <acceptConnection+0x26>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
jmp    113e <acceptConnection+0x1e>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [26 x i8] c"accept client sock error:\00"
define i32 @acceptConnection(i32 %0, %struct.sockaddr* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 4, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = call i32 @accept(i32 %8, %struct.sockaddr* %9, i32* %6)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %17
15: ; preds = %2
%16 = load i32, i32* %7
store i32 %16, i32* %3
br label %17
17: ; preds = %15, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [26 x i8] c"accept client sock error:\00"
define i32 @acceptConnection(i32 %0, %struct.sockaddr* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 4, i32* %3
%5 = call i32 @accept(i32 %0, %struct.sockaddr* %1, i32* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @perror(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %2, %7
ret i32 %5
}
/* Variables and functions */
float ANTweenTimingFunctionBounceOut(float, int /*<<< orphan*/, float, float);
float ANTweenTimingFunctionBounceIn(float time, float begin, float change,
                                    float duration) {
  return change -
         ANTweenTimingFunctionBounceOut(duration - time, 0, change, duration) +
         begin;
}


x86 assembly (clang, -O0):
<ANTweenTimingFunctionBounceIn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm2
xor    %edi,%edi
call   1030 <ANTweenTimingFunctionBounceOut@plt>
movaps %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
subss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ANTweenTimingFunctionBounceIn>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
movaps %xmm3,%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
xor    %edi,%edi
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
call   1030 <ANTweenTimingFunctionBounceOut@plt>
movss  (%rsp),%xmm1
subss  %xmm0,%xmm1
addss  0x4(%rsp),%xmm1
movaps %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @ANTweenTimingFunctionBounceIn(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %8
%11 = load float, float* %5
%12 = fsub float %10, %11
%13 = load float, float* %7
%14 = load float, float* %8
%15 = call float @ANTweenTimingFunctionBounceOut(float %12, i32 0, float %13, float %14)
%16 = fsub float %9, %15
%17 = load float, float* %6
%18 = fadd float %16, %17
ret float %18
}

LLVM IR (-O2):
define float @ANTweenTimingFunctionBounceIn(float %0, float %1, float %2, float %3) {
%5 = fsub float %3, %0
%6 = tail call float @ANTweenTimingFunctionBounceOut(float %5, i32 0, float %2, float %3)
%7 = fsub float %2, %6
%8 = fadd float %7, %1
ret float %8
}
/* Type definitions */
struct rb_root {
  int dummy;
};
struct rb_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __rb_insert(struct rb_node *, struct rb_root *,
                               void (*)(struct rb_node *, struct rb_node *));
void __rb_insert_augmented(struct rb_node *node, struct rb_root *root,
                           void (*augment_rotate)(struct rb_node *old,
                                                  struct rb_node *new)) {
  __rb_insert(node, root, augment_rotate);
}


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

x86 assembly (clang, -O2):
<__rb_insert_augmented>:
jmp    1030 <__rb_insert@plt>

LLVM IR (-O0):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @__rb_insert_augmented(%struct.rb_node* %0, %struct.rb_root* %1, void (%struct.rb_node*, %struct.rb_node*)* %2) {
%4 = alloca %struct.rb_node*
%5 = alloca %struct.rb_root*
%6 = alloca void (%struct.rb_node*, %struct.rb_node*)*
store %struct.rb_node* %0, %struct.rb_node** %4
store %struct.rb_root* %1, %struct.rb_root** %5
store void (%struct.rb_node*, %struct.rb_node*)* %2, void (%struct.rb_node*, %struct.rb_node*)** %6
%7 = load %struct.rb_node*, %struct.rb_node** %4
%8 = load %struct.rb_root*, %struct.rb_root** %5
%9 = load void (%struct.rb_node*, %struct.rb_node*)*, void (%struct.rb_node*, %struct.rb_node*)** %6
%10 = call i32 @__rb_insert(%struct.rb_node* %7, %struct.rb_root* %8, void (%struct.rb_node*, %struct.rb_node*)* %9)
ret void
}

LLVM IR (-O2):
%struct.rb_node = type { i32 }
%struct.rb_root = type { i32 }
define void @__rb_insert_augmented(%struct.rb_node* %0, %struct.rb_root* %1, void (%struct.rb_node*, %struct.rb_node*)* %2) {
%4 = tail call i32 @__rb_insert(%struct.rb_node* %0, %struct.rb_root* %1, void (%struct.rb_node*, %struct.rb_node*)* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glFinish();
void Finish(void) { glFinish(); }


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

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

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

LLVM IR (-O2):
define void @Finish() {
%1 = tail call i32 (...) @glFinish()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long long, int, long long);
int fun_call_align_ll_3(long long a, int b, long long c) {
  printf("a = %lld, b = %d, c = %lld\n", a, b, c);
  return a + b + c;
}


x86 assembly (clang, -O0):
<fun_call_align_ll_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
add    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun_call_align_ll_3>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
lea    0xedc(%rip),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
mov    %rbx,%rcx
call   1030 <printf@plt>
add    %r14d,%ebp
add    %ebp,%ebx
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"a = %lld, b = %d, c = %lld\0A\00"
define i32 @fun_call_align_ll_3(i64 %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
store i64 %0, i64* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = load i64, i64* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %7, i32 %8, i64 %9)
%11 = load i64, i64* %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = add nsw i64 %11, %13
%15 = load i64, i64* %6
%16 = add nsw i64 %14, %15
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [28 x i8] c"a = %lld, b = %d, c = %lld\0A\00"
define i32 @fun_call_align_ll_3(i64 %0, i32 %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i64 %0, i32 %1, i64 %2)
%5 = zext i32 %1 to i64
%6 = add i64 %5, %0
%7 = add i64 %6, %2
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  int /*<<< orphan*/ tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ round(double);
scalar_t__ trunc(double);
void dtime2timeval(double dtime, struct timeval *tvp) {
  ((tvp)->tv_sec) = trunc(dtime);
  ((tvp)->tv_usec) =
      round((double)1000000L * (dtime - (double)((tvp)->tv_sec)));
}


x86 assembly (clang, -O0):
<dtime2timeval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <trunc@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movsd  -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%rax
cvtsi2sdq (%rax),%xmm0
subsd  %xmm0,%xmm1
movsd  0xea1(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1040 <round@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtime2timeval>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm0,0x8(%rsp)
call   1030 <trunc@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
mov    %rax,(%rbx)
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
mulsd  0xeb0(%rip),%xmm1
movapd %xmm1,%xmm0
call   1040 <round@plt>
mov    %eax,0x8(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define void @dtime2timeval(double %0, %struct.timeval* %1) {
%3 = alloca double
%4 = alloca %struct.timeval*
store double %0, double* %3
store %struct.timeval* %1, %struct.timeval** %4
%5 = load double, double* %3
%6 = call i64 @trunc(double %5)
%7 = load %struct.timeval*, %struct.timeval** %4
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
store i64 %6, i64* %8
%9 = load double, double* %3
%10 = load %struct.timeval*, %struct.timeval** %4
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %10, i32 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = fsub double %9, %13
%15 = fmul double 1.000000e+06, %14
%16 = call i32 @round(double %15)
%17 = load %struct.timeval*, %struct.timeval** %4
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %17, i32 0, i32 1
store i32 %16, i32* %18
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define void @dtime2timeval(double %0, %struct.timeval* nocapture writeonly %1) {
%3 = tail call i64 @trunc(double %0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i64 %3, i64* %4
%5 = sitofp i64 %3 to double
%6 = fsub double %0, %5
%7 = fmul double %6, 1.000000e+06
%8 = tail call i32 @round(double %7)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i32 %8, i32* %9
ret void
}
/* Variables and functions */
unsigned int SEGGER_RTT_ReadNoLock(unsigned int, void *, unsigned int);
unsigned SEGGER_RTT_Read(unsigned BufferIndex, void *pBuffer,
                         unsigned BufferSize) {
  unsigned NumBytesRead;
  volatile unsigned SavedState;
  ;
  NumBytesRead = SEGGER_RTT_ReadNoLock(BufferIndex, pBuffer, BufferSize);
  ;
  return NumBytesRead;
}


x86 assembly (clang, -O0):
<SEGGER_RTT_Read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <SEGGER_RTT_ReadNoLock@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_RTT_Read>:
jmp    1030 <SEGGER_RTT_ReadNoLock@plt>

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

LLVM IR (-O2):
define i32 @SEGGER_RTT_Read(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @SEGGER_RTT_ReadNoLock(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ __cpuid(int /*<<< orphan*/, int, int, int, int);
__attribute__((no)) const char *get_cpu_id(void) {
  static char cpuAux[12];
  int *p;
  int a, b, c, d;
  __cpuid(0, a, b, c, d);
  p = (int *)cpuAux;
  *p++ = b;
  *p++ = d;
  *p = c;
  return cpuAux;
}


x86 assembly (clang, -O0):
<get_cpu_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
xor    %edi,%edi
call   1030 <__cpuid@plt>
lea    0x2ef6(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
lea    0x2eba(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_id>:
push   %rax
xor    %edi,%edi
call   1030 <__cpuid@plt>
lea    0x2f0d(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@get_cpu_id.cpuAux = internal global [12 x i8] zeroinitializer
define i8* @get_cpu_id() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = call i32 @__cpuid(i32 0, i32 %6, i32 %7, i32 %8, i32 %9)
store i32* bitcast ([12 x i8]* @get_cpu_id.cpuAux to i32*), i32** %1
%11 = load i32, i32* %3
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %1
store i32 %11, i32* %12
%14 = load i32, i32* %5
%15 = load i32*, i32** %1
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %1
store i32 %14, i32* %15
%17 = load i32, i32* %4
%18 = load i32*, i32** %1
store i32 %17, i32* %18
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @get_cpu_id.cpuAux, i64 0, i64 0)
}

LLVM IR (-O2):
@get_cpu_id.cpuAux = internal global [12 x i8] zeroinitializer
define i8* @get_cpu_id() {
%1 = tail call i32 @__cpuid(i32 0, i32 undef, i32 undef, i32 undef, i32 undef)
ret i8* getelementptr inbounds ([12 x i8], [12 x i8]* @get_cpu_id.cpuAux, i64 0, i64 0)
}
int ubi_dbg_check_write(struct ubi_device *ubi, const void *buf, int pnum,
                        int offset, int len) {
  return 0;
}


x86 assembly (clang, -O0):
<ubi_dbg_check_write>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ubi_device = type opaque
define i32 @ubi_dbg_check_write(%struct.ubi_device* %0, i8* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca %struct.ubi_device*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store %struct.ubi_device* %0, %struct.ubi_device** %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 0
}

LLVM IR (-O2):
%struct.ubi_device = type opaque
define i32 @ubi_dbg_check_write(%struct.ubi_device* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ collate_all_tiles();
int /*<<< orphan*/ tile_all_conns();
int /*<<< orphan*/ tile_all_fills();
int /*<<< orphan*/ tile_all_node_textures();
void tile() {
  if (!tile_all_conns())
    return;
  if (!tile_all_node_textures())
    return;
  if (!tile_all_fills())
    return;
  collate_all_tiles();
}


x86 assembly (clang, -O0):
<tile>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <tile_all_conns@plt>
cmp    $0x0,%eax
jne    1159 <tile+0x19>
jmp    118a <tile+0x4a>
mov    $0x0,%al
call   1040 <tile_all_node_textures@plt>
cmp    $0x0,%eax
jne    116e <tile+0x2e>
jmp    118a <tile+0x4a>
mov    $0x0,%al
call   1030 <tile_all_fills@plt>
cmp    $0x0,%eax
jne    1183 <tile+0x43>
jmp    118a <tile+0x4a>
mov    $0x0,%al
call   1060 <collate_all_tiles@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tile>:
push   %rax
xor    %eax,%eax
call   1050 <tile_all_conns@plt>
test   %eax,%eax
je     116a <tile+0x2a>
xor    %eax,%eax
call   1040 <tile_all_node_textures@plt>
test   %eax,%eax
je     116a <tile+0x2a>
xor    %eax,%eax
call   1030 <tile_all_fills@plt>
test   %eax,%eax
je     116a <tile+0x2a>
xor    %eax,%eax
pop    %rcx
jmp    1060 <collate_all_tiles@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @tile() {
%1 = call i32 (...) @tile_all_conns()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %14
4: ; preds = %0
%5 = call i32 (...) @tile_all_node_textures()
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %4
br label %14
8: ; preds = %4
%9 = call i32 (...) @tile_all_fills()
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %8
br label %14
12: ; preds = %8
%13 = call i32 (...) @collate_all_tiles()
br label %14
14: ; preds = %12, %11, %7, %3
ret void
}

LLVM IR (-O2):
define void @tile() {
%1 = tail call i32 (...) @tile_all_conns()
%2 = icmp eq i32 %1, 0
br i1 %2, label %11, label %3
3: ; preds = %0
%4 = tail call i32 (...) @tile_all_node_textures()
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i32 (...) @tile_all_fills()
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (...) @collate_all_tiles()
br label %11
11: ; preds = %6, %3, %0, %9
ret void
}
/* Type definitions */
struct platform_device {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
struct platform_device *to_platform_device(struct device *);
int /*<<< orphan*/ usb_hcd_ppc_soc_remove(struct platform_device *);
int ehci_hcd_ppc_soc_drv_remove(struct device *dev) {
  struct platform_device *pdev = to_platform_device(dev);
  usb_hcd_ppc_soc_remove(pdev);
  return 0;
}


x86 assembly (clang, -O0):
<ehci_hcd_ppc_soc_drv_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <to_platform_device@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <usb_hcd_ppc_soc_remove@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehci_hcd_ppc_soc_drv_remove>:
push   %rax
call   1040 <to_platform_device@plt>
mov    %rax,%rdi
call   1030 <usb_hcd_ppc_soc_remove@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.platform_device = type { i32 }
define i32 @ehci_hcd_ppc_soc_drv_remove(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca %struct.platform_device*
store %struct.device* %0, %struct.device** %2
%4 = load %struct.device*, %struct.device** %2
%5 = call %struct.platform_device* @to_platform_device(%struct.device* %4)
store %struct.platform_device* %5, %struct.platform_device** %3
%6 = load %struct.platform_device*, %struct.platform_device** %3
%7 = call i32 @usb_hcd_ppc_soc_remove(%struct.platform_device* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.platform_device = type { i32 }
define i32 @ehci_hcd_ppc_soc_drv_remove(%struct.device* %0) {
%2 = tail call %struct.platform_device* @to_platform_device(%struct.device* %0)
%3 = tail call i32 @usb_hcd_ppc_soc_remove(%struct.platform_device* %2)
ret i32 0
}
int is_supported_size(int size) {
  switch (size) {
  case 1024:
  case 512:
  case 256:
  case 128:
  case 64:
  case 32:
  case 16:
  case 8:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_supported_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x8,%eax
je     119a <is_supported_size+0x9a>
jmp    111b <is_supported_size+0x1b>
mov    -0xc(%rbp),%eax
sub    $0x10,%eax
je     119a <is_supported_size+0x9a>
jmp    112c <is_supported_size+0x2c>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     119a <is_supported_size+0x9a>
jmp    113d <is_supported_size+0x3d>
mov    -0xc(%rbp),%eax
sub    $0x40,%eax
je     119a <is_supported_size+0x9a>
jmp    114e <is_supported_size+0x4e>
mov    -0xc(%rbp),%eax
sub    $0x80,%eax
je     119a <is_supported_size+0x9a>
jmp    1161 <is_supported_size+0x61>
mov    -0xc(%rbp),%eax
sub    $0x100,%eax
je     119a <is_supported_size+0x9a>
jmp    1174 <is_supported_size+0x74>
mov    -0xc(%rbp),%eax
sub    $0x200,%eax
je     119a <is_supported_size+0x9a>
jmp    1187 <is_supported_size+0x87>
mov    -0xc(%rbp),%eax
sub    $0x400,%eax
jne    11a6 <is_supported_size+0xa6>
jmp    119a <is_supported_size+0x9a>
movl   $0x1,-0x4(%rbp)
jmp    11ad <is_supported_size+0xad>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_supported_size>:
mov    $0x1,%eax
cmp    $0x7f,%edi
jg     1123 <is_supported_size+0x23>
add    $0xfffffff8,%edi
cmp    $0x38,%edi
ja     114d <is_supported_size+0x4d>
movabs $0x100000001000101,%rcx
bt     %rdi,%rcx
jae    114d <is_supported_size+0x4d>
ret
cmp    $0x1ff,%edi
jg     113d <is_supported_size+0x3d>
cmp    $0x80,%edi
je     1122 <is_supported_size+0x22>
cmp    $0x100,%edi
je     1122 <is_supported_size+0x22>
jmp    114d <is_supported_size+0x4d>
cmp    $0x200,%edi
je     1122 <is_supported_size+0x22>
cmp    $0x400,%edi
je     1122 <is_supported_size+0x22>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_supported_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1024, label %5
i32 512, label %5
i32 256, label %5
i32 128, label %5
i32 64, label %5
i32 32, label %5
i32 16, label %5
i32 8, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_supported_size(i32 %0) {
switch i32 %0, label %2 [
i32 1024, label %3
i32 512, label %3
i32 256, label %3
i32 128, label %3
i32 64, label %3
i32 32, label %3
i32 16, label %3
i32 8, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
void fake_free(struct hnode *node, void *unused) {}


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

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

LLVM IR (-O0):
%struct.hnode = type opaque
define void @fake_free(%struct.hnode* %0, i8* %1) {
%3 = alloca %struct.hnode*
%4 = alloca i8*
store %struct.hnode* %0, %struct.hnode** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
%struct.hnode = type opaque
define void @fake_free(%struct.hnode* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
char *mempmove(char *, char const *, scalar_t__);
scalar_t__ strlen(char const *);
char *stpmove(char *whither, const char *whence) {
  return mempmove(whither, whence, strlen(whence) + 1) - 1;
}


x86 assembly (clang, -O0):
<stpmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
call   1030 <mempmove@plt>
add    $0xffffffffffffffff,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stpmove>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <mempmove@plt>
add    $0xffffffffffffffff,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @stpmove(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @mempmove(i8* %5, i8* %6, i64 %9)
%11 = getelementptr inbounds i8, i8* %10, i64 -1
ret i8* %11
}

LLVM IR (-O2):
define i8* @stpmove(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @mempmove(i8* %0, i8* %1, i64 %4)
%6 = getelementptr inbounds i8, i8* %5, i64 -1
ret i8* %6
}
/* Variables and functions */
int width(char *, char *);
int tabs(char *s, char *os) { return width(s, os) / 8; }


x86 assembly (clang, -O0):
<tabs>:
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 <width@plt>
mov    $0x8,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabs>:
push   %rax
call   1030 <width@plt>
lea    0x7(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0x3,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @tabs(i8* %0, i8* %1) {
%3 = tail call i32 @width(i8* %0, i8* %1)
%4 = sdiv i32 %3, 8
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ EPOLL_CTL_ADD;
int epoll_mod_internal(int, int /*<<< orphan*/, int, int /*<<< orphan*/,
                       void *);
int epoll_add(int epfd, int fd, uint32_t events, void *ptr) {
  return epoll_mod_internal(epfd, EPOLL_CTL_ADD, fd, events, ptr);
}


x86 assembly (clang, -O0):
<epoll_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
call   1030 <epoll_mod_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<epoll_add>:
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2eca(%rip),%rax
mov    (%rax),%esi
jmp    1030 <epoll_mod_internal@plt>

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

LLVM IR (-O2):
@EPOLL_CTL_ADD = global i32 0
define i32 @epoll_add(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = load i32, i32* @EPOLL_CTL_ADD
%6 = tail call i32 @epoll_mod_internal(i32 %0, i32 %5, i32 %1, i32 %2, i8* %3)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ execve(char *, char **, int /*<<< orphan*/ *);
int main() {
  char *name[2];
  name[0] = "/bin/sh";
  name[1] = NULL;
  execve(name[0], name, NULL);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
mov    %rdi,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <execve@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i8*]
store i32 0, i32* %1
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 1
store i8* null, i8** %4
%5 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds [2 x i8*], [2 x i8*]* %2, i64 0, i64 0
%8 = call i32 @execve(i8* %6, i8** %7, i32* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
define i32 @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 1
store i8* null, i8** %4
%5 = call i32 @execve(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %3, i32* null)
ret i32 0
}
process_mnemonic(m) char *m;
{
  for (; *m != '\0'; m++)
    if (*m == '.')
      *m = '_';
}


x86 assembly (clang, -O0):
<process_mnemonic>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1145 <process_mnemonic+0x45>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    112f <process_mnemonic+0x2f>
mov    -0x10(%rbp),%rax
movb   $0x5f,(%rax)
jmp    1134 <process_mnemonic+0x34>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <process_mnemonic+0x8>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_mnemonic>:
jmp    1117 <process_mnemonic+0x17>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movb   $0x5f,(%rdi)
add    $0x1,%rdi
movzbl (%rdi),%eax
cmp    $0x2e,%al
je     1110 <process_mnemonic+0x10>
test   %al,%al
jne    1113 <process_mnemonic+0x13>
ret

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

LLVM IR (-O2):
define i32 @process_mnemonic(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 46, label %5
]
5: ; preds = %2
store i8 95, i8* %3
br label %6
6: ; preds = %2, %5
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2
ret i32 undef
}
/* Variables and functions */
int _getchar();
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_getchar(void) {
  int ret;
  monLock();
  ret = _getchar();
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_getchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <monLock@plt>
mov    $0x0,%al
call   1030 <_getchar@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_getchar>:
push   %rbx
xor    %eax,%eax
call   1040 <monLock@plt>
xor    %eax,%eax
call   1030 <_getchar@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mon_getchar() {
%1 = alloca i32
%2 = call i32 (...) @monLock()
%3 = call i32 (...) @_getchar()
store i32 %3, i32* %1
%4 = call i32 (...) @monUnlock()
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @mon_getchar() {
%1 = tail call i32 (...) @monLock()
%2 = tail call i32 (...) @_getchar()
%3 = tail call i32 (...) @monUnlock()
ret i32 %2
}
/* Type definitions */
struct s_tag {
  int dummy;
};

/* Variables and functions */
struct s_tag *create_tag(char const *);
struct s_tag *search_tag(char const *);
struct s_tag *find_tag(const char *name) {
  struct s_tag *tag;
  tag = search_tag(name);
  if (!tag)
    tag = create_tag(name);
  return tag;
}


x86 assembly (clang, -O0):
<find_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <search_tag@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1151 <find_tag+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <create_tag@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s_tag = type { i32 }
define %struct.s_tag* @find_tag(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.s_tag*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call %struct.s_tag* @search_tag(i8* %4)
store %struct.s_tag* %5, %struct.s_tag** %3
%6 = load %struct.s_tag*, %struct.s_tag** %3
%7 = icmp ne %struct.s_tag* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call %struct.s_tag* @create_tag(i8* %9)
store %struct.s_tag* %10, %struct.s_tag** %3
br label %11
11: ; preds = %8, %1
%12 = load %struct.s_tag*, %struct.s_tag** %3
ret %struct.s_tag* %12
}

LLVM IR (-O2):
%struct.s_tag = type { i32 }
define %struct.s_tag* @find_tag(i8* %0) {
%2 = tail call %struct.s_tag* @search_tag(i8* %0)
%3 = icmp eq %struct.s_tag* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call %struct.s_tag* @create_tag(i8* %0)
br label %6
6: ; preds = %4, %1
%7 = phi %struct.s_tag* [ %2, %1 ], [ %5, %4 ]
ret %struct.s_tag* %7
}
INI_Bit_TYPE() {}


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

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

LLVM IR (-O0):
define i32 @INI_Bit_TYPE() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @INI_Bit_TYPE() {
ret i32 undef
}
void VixDiskLib_FreeErrorText(char *errMsg) {}


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

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

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

LLVM IR (-O2):
define void @VixDiskLib_FreeErrorText(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct timespec {
  unsigned long long tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ __NR_clock_gettime;
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/,
                           struct timespec *);
unsigned long long monotonic_us(void) {
  struct timespec ts;
  syscall(__NR_clock_gettime, CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * 1000000ULL + ts.tv_nsec / 1000;
}


x86 assembly (clang, -O0):
<monotonic_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
imul   $0xf4240,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<monotonic_us>:
sub    $0x18,%rsp
mov    0x2ed5(%rip),%rax
mov    (%rax),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <syscall@plt>
imul   $0xf4240,0x8(%rsp),%rcx
movslq 0x10(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i32 }
@__NR_clock_gettime = global i32 0
@CLOCK_MONOTONIC = global i32 0
define i64 @monotonic_us() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @__NR_clock_gettime
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @syscall(i32 %2, i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%9 = load i32, i32* %8
%10 = sdiv i32 %9, 1000
%11 = sext i32 %10 to i64
%12 = add i64 %7, %11
ret i64 %12
}

LLVM IR (-O2):
%struct.timespec = type { i64, i32 }
@__NR_clock_gettime = global i32 0
@CLOCK_MONOTONIC = global i32 0
define i64 @monotonic_us() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @__NR_clock_gettime
%4 = load i32, i32* @CLOCK_MONOTONIC
%5 = call i32 @syscall(i32 %3, i32 %4, %struct.timespec* %1)
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%10 = load i32, i32* %9
%11 = sdiv i32 %10, 1000
%12 = sext i32 %11 to i64
%13 = add i64 %8, %12
ret i64 %13
}
float recipf(float x) { return 1.f / x; }


x86 assembly (clang, -O0):
<recipf>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
divss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<recipf>:
movss  0xef8(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @recipf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float 1.000000e+00, %3
ret float %4
}

LLVM IR (-O2):
define float @recipf(float %0) {
%2 = fdiv float 1.000000e+00, %0
ret float %2
}
/* Variables and functions */
int f(int);
int g(int);
main() { return f(5) + g(1); }


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x5,%edi
call   1030 <f@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1040 <g@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 5)
%3 = call i32 @g(i32 1)
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 5)
%2 = tail call i32 @g(i32 1)
%3 = add nsw i32 %2, %1
ret i32 %3
}
/* Type definitions */
struct Stack {
  int dummy;
};

/* Variables and functions */
struct Stack *createStack(unsigned int);
int /*<<< orphan*/ tohIterative(unsigned int, struct Stack *, struct Stack *,
                                struct Stack *);
int main() {
  unsigned num_of_disks = 3;
  struct Stack *src, *dest, *aux;
  src = createStack(num_of_disks);
  aux = createStack(num_of_disks);
  dest = createStack(num_of_disks);
  tohIterative(num_of_disks, src, aux, dest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <createStack@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <createStack@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <createStack@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <tohIterative@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x3,%edi
call   1030 <createStack@plt>
mov    %rax,%r14
mov    $0x3,%edi
call   1030 <createStack@plt>
mov    %rax,%rbx
mov    $0x3,%edi
call   1030 <createStack@plt>
mov    $0x3,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %rax,%rcx
call   1040 <tohIterative@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.Stack = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.Stack*
%4 = alloca %struct.Stack*
%5 = alloca %struct.Stack*
store i32 0, i32* %1
store i32 3, i32* %2
%6 = load i32, i32* %2
%7 = call %struct.Stack* @createStack(i32 %6)
store %struct.Stack* %7, %struct.Stack** %3
%8 = load i32, i32* %2
%9 = call %struct.Stack* @createStack(i32 %8)
store %struct.Stack* %9, %struct.Stack** %5
%10 = load i32, i32* %2
%11 = call %struct.Stack* @createStack(i32 %10)
store %struct.Stack* %11, %struct.Stack** %4
%12 = load i32, i32* %2
%13 = load %struct.Stack*, %struct.Stack** %3
%14 = load %struct.Stack*, %struct.Stack** %5
%15 = load %struct.Stack*, %struct.Stack** %4
%16 = call i32 @tohIterative(i32 %12, %struct.Stack* %13, %struct.Stack* %14, %struct.Stack* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.Stack = type { i32 }
define i32 @main() {
%1 = tail call %struct.Stack* @createStack(i32 3)
%2 = tail call %struct.Stack* @createStack(i32 3)
%3 = tail call %struct.Stack* @createStack(i32 3)
%4 = tail call i32 @tohIterative(i32 3, %struct.Stack* %1, %struct.Stack* %2, %struct.Stack* %3)
ret i32 0
}
void npush() {
  asm volatile("popq %%rax\n\t"
               "movq %%rsp, %%r13\n\t"
               "movq %%r14, %%rsp\n\t"
               "pushq %%rax\n\t"
               "movq %%rsp, %%r14\n\t"
               "movq %%r13, %%rsp\n\t"
               "subq $0x8, (%%r15)\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<npush>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
mov    %rsp,%r13
mov    %r14,%rsp
push   %rax
mov    %rsp,%r14
mov    %r13,%rsp
subq   $0x8,(%r15)
pop    %rbp
ret

x86 assembly (clang, -O2):
<npush>:
pop    %rax
mov    %rsp,%r13
mov    %r14,%rsp
push   %rax
mov    %rsp,%r14
mov    %r13,%rsp
subq   $0x8,(%r15)
ret

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

LLVM IR (-O2):
define void @npush() {
tail call void asm sideeffect "popq %rax\0A\09movq %rsp, %r13\0A\09movq %r14, %rsp\0A\09pushq %rax\0A\09movq %rsp, %r14\0A\09movq %r13, %rsp\0A\09subq $$0x8, (%r15)\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ puts(char *);
char *read_file(char *);
int main() {
  char *string = read_file("/home/elsuizo/text.txt");
  if (string) {
    puts(string);
    free(string);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1050 <read_file@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116c <main+0x3c>
mov    -0x10(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <read_file@plt>
test   %rax,%rax
je     1155 <main+0x25>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"/home/elsuizo/text.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @read_file(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i8*, i8** %2
%8 = call i32 @puts(i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
br label %11
11: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"/home/elsuizo/text.txt\00"
define i32 @main() {
%1 = tail call i8* @read_file(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @puts(i8* %1)
%5 = tail call i32 @free(i8* %1)
br label %6
6: ; preds = %3, %0
ret i32 0
}