xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ prLog(char *);
int /*<<< orphan*/ run();
int /*<<< orphan*/ setSetups(int, char **);
int main(int argc, char **argv) {
  prLog("\nProgram Started.");
  setSetups(argc, argv);
  run();
  prLog("Program Closed.\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
call   1040 <prLog@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <setSetups@plt>
mov    $0x0,%al
call   1050 <run@plt>
lea    0xead(%rip),%rdi
call   1040 <prLog@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
call   1040 <prLog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <setSetups@plt>
xor    %eax,%eax
call   1050 <run@plt>
lea    0xeb6(%rip),%rdi
call   1040 <prLog@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0AProgram Started.\00"
@.str.1 = [17 x i8] c"Program Closed.\0A\00"
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 @prLog(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load i8**, i8*** %4
%8 = call i32 @setSetups(i32 %6, i8** %7)
%9 = call i32 (...) @run()
%10 = call i32 @prLog(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AProgram Started.\00"
@.str.1 = [17 x i8] c"Program Closed.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @prLog(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @setSetups(i32 %0, i8** %1)
%5 = tail call i32 (...) @run()
%6 = tail call i32 @prLog(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void Free(void *mem) {
  if (NULL != mem)
    free(mem);
}


x86 assembly (clang, -O0):
<Free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
je     1131 <Free+0x21>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Free>:
test   %rdi,%rdi
je     111a <Free+0xa>
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @Free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int);
__attribute__((weak)) void abort(void) { _exit(1); }


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<abort>:
push   %rax
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define weak void @abort() {
%1 = call i32 @_exit(i32 1)
unreachable
}

LLVM IR (-O2):
define weak void @abort() {
%1 = tail call i32 @_exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t md5_I(uint32_t x, uint32_t y, uint32_t z) { return y ^ (x | (~z)); }


x86 assembly (clang, -O0):
<md5_I>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_I>:
mov    %edx,%eax
not    %eax
or     %edi,%eax
xor    %esi,%eax
ret

LLVM IR (-O0):
define i32 @md5_I(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* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = xor i32 %9, -1
%11 = or i32 %8, %10
%12 = xor i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @md5_I(i32 %0, i32 %1, i32 %2) {
%4 = xor i32 %2, -1
%5 = or i32 %4, %0
%6 = xor i32 %5, %1
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fpeek(scalar_t__ *, int, int /*<<< orphan*/ *);
uint32_t sum_next_32_bits(FILE *file) {
  uint8_t buf[4];
  fpeek(buf, 4, file);
  return buf[0] + buf[1] + buf[2] + buf[3];
}


x86 assembly (clang, -O0):
<sum_next_32_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x4,%esi
call   1030 <fpeek@plt>
mov    -0x30(%rbp),%rax
add    -0x28(%rbp),%rax
add    -0x20(%rbp),%rax
add    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_next_32_bits>:
sub    $0x28,%rsp
mov    %rdi,%rdx
mov    %rsp,%rdi
mov    $0x4,%esi
call   1030 <fpeek@plt>
movdqa (%rsp),%xmm0
paddq  0x10(%rsp),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddq  %xmm0,%xmm1
movq   %xmm1,%rax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i64 @sum_next_32_bits(i32* %0) {
%2 = alloca <4 x i64>
%3 = bitcast <4 x i64>* %2 to i8*
%4 = getelementptr inbounds <4 x i64>, <4 x i64>* %2, i64 0, i64 0
%5 = call i32 @fpeek(i64* %4, i32 4, i32* %0)
%6 = load <4 x i64>, <4 x i64>* %2
%7 = call i64 @llvm.vector.reduce.add.v4i64(<4 x i64> %6)
ret i64 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t IOPinReadPort(int PortNo) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @IOPinReadPort(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
void setLess() {
  emitln("setl\t%%al");
  emitln("neg\t%%al\t#change 1 to -1");
  emitln("movsx\t%%al,%%eax\t#extend al to eax");
}


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

x86 assembly (clang, -O2):
<setLess>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <emitln@plt>
lea    0xee6(%rip),%rdi
call   1030 <emitln@plt>
lea    0xef3(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"setl\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setLess() {
%1 = call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"setl\09%%al\00"
@.str.1 = [25 x i8] c"neg\09%%al\09#change 1 to -1\00"
@.str.2 = [35 x i8] c"movsx\09%%al,%%eax\09#extend al to eax\00"
define void @setLess() {
%1 = tail call i32 @emitln(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @emitln(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ square(int);
long int sum_of_squares(long int m) {
  long int sum = 0;
  for (int i = 1; i < m + 1; i += 1) {
    sum += square(i);
  }
  return sum;
}


x86 assembly (clang, -O0):
<sum_of_squares>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movslq -0x14(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0x1,%rcx
cmp    %rcx,%rax
jge    115e <sum_of_squares+0x4e>
mov    -0x14(%rbp),%edi
call   1030 <square@plt>
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <sum_of_squares+0x1b>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_of_squares>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
jle    1145 <sum_of_squares+0x35>
mov    %rdi,%r14
mov    $0x1,%ebx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebx,%edi
call   1030 <square@plt>
add    %rax,%r15
add    $0x1,%rbx
cmp    %r14,%rbx
jle    1130 <sum_of_squares+0x20>
jmp    1148 <sum_of_squares+0x38>
xor    %r15d,%r15d
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @sum_of_squares(i64 %0) {
%2 = icmp slt i64 %0, 1
br i1 %2, label %3, label %5
3: ; preds = %5, %1
%4 = phi i64 [ 0, %1 ], [ %10, %5 ]
ret i64 %4
5: ; preds = %1, %5
%6 = phi i64 [ %11, %5 ], [ 1, %1 ]
%7 = phi i64 [ %10, %5 ], [ 0, %1 ]
%8 = trunc i64 %6 to i32
%9 = tail call i64 @square(i32 %8)
%10 = add nsw i64 %9, %7
%11 = add nuw i64 %6, 1
%12 = icmp sgt i64 %11, %0
br i1 %12, label %3, label %5
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int scanTime() {
  int hrs, mins, secs, result;
  scanf("%d %d %d", &hrs, &mins, &secs);
  result = (hrs * 3600) + (mins * 60) + (secs);
  return result;
}


x86 assembly (clang, -O0):
<scanTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1030 <scanf@plt>
imul   $0xe10,-0x4(%rbp),%eax
imul   $0x3c,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scanTime>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1030 <scanf@plt>
imul   $0xe10,0x14(%rsp),%ecx
imul   $0x3c,0x10(%rsp),%eax
add    %ecx,%eax
add    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @scanTime() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 3600
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, 60
%10 = add nsw i32 %7, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
store i32 %12, i32* %4
%13 = load i32, i32* %4
ret i32 %13
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
define i32 @scanTime() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = mul nsw i32 %8, 3600
%10 = load i32, i32* %2
%11 = mul nsw i32 %10, 60
%12 = add nsw i32 %11, %9
%13 = load i32, i32* %3
%14 = add nsw i32 %12, %13
ret i32 %14
}
/* Variables and functions */
float powf(float, float);
float EaseExpoIn(float t, float b, float c, float d) {
  return (t == 0.0f) ? b : (c * powf(2.0f, 10.0f * (t / d - 1.0f)) + b);
}


x86 assembly (clang, -O0):
<EaseExpoIn>:
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  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1152 <EaseExpoIn+0x42>
jp     1152 <EaseExpoIn+0x42>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11a5 <EaseExpoIn+0x95>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xe9a(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xe8a(%rip),%xmm1
mulss  %xmm0,%xmm1
movss  0xe7a(%rip),%xmm0
call   1030 <powf@plt>
movaps %xmm0,%xmm2
movss  -0x18(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EaseExpoIn>:
xorps  %xmm4,%xmm4
ucomiss %xmm4,%xmm0
jne    111e <EaseExpoIn+0xe>
jp     111e <EaseExpoIn+0xe>
movaps %xmm1,%xmm0
ret
push   %rax
divss  %xmm3,%xmm0
addss  0xed5(%rip),%xmm0
mulss  0xed1(%rip),%xmm0
movss  %xmm1,0x4(%rsp)
movss  %xmm2,(%rsp)
call   1030 <exp2f@plt>
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @EaseExpoIn(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* %5
%10 = fcmp oeq float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load float, float* %6
br label %23
13: ; preds = %4
%14 = load float, float* %7
%15 = load float, float* %5
%16 = load float, float* %8
%17 = fdiv float %15, %16
%18 = fsub float %17, 1.000000e+00
%19 = fmul float 1.000000e+01, %18
%20 = call float @powf(float 2.000000e+00, float %19)
%21 = load float, float* %6
%22 = call float @llvm.fmuladd.f32(float %14, float %20, float %21)
br label %23
23: ; preds = %13, %11
%24 = phi float [ %12, %11 ], [ %22, %13 ]
ret float %24
}

LLVM IR (-O2):
define float @EaseExpoIn(float %0, float %1, float %2, float %3) {
%5 = fcmp oeq float %0, 0.000000e+00
br i1 %5, label %12, label %6
6: ; preds = %4
%7 = fdiv float %0, %3
%8 = fadd float %7, -1.000000e+00
%9 = fmul float %8, 1.000000e+01
%10 = tail call float @exp2f(float %9)
%11 = tail call float @llvm.fmuladd.f32(float %2, float %10, float %1)
br label %12
12: ; preds = %4, %6
%13 = phi float [ %11, %6 ], [ %1, %4 ]
ret float %13
}
void __DELETE_java_util_WeakHashMap_Entry(void *me, void *client_data) {}


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

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

LLVM IR (-O0):
define void @__DELETE_java_util_WeakHashMap_Entry(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret void
}

LLVM IR (-O2):
define void @__DELETE_java_util_WeakHashMap_Entry(i8* nocapture %0, i8* nocapture %1) {
ret void
}
int test_imm_E4uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0xE4 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_E4uint64_midword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x10,%rdx
and    $0xe4,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_E4uint64_midword_reg>:
test   $0xe40000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_E4uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 14942208
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int add(int x, int y) {
  printf("add %d and %d\n", x, y);
  return x + y;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"add %d and %d\0A\00"
define i32 @add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = add nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"add %d and %d\0A\00"
define i32 @add(i32 %0, i32 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%4 = add nsw i32 %1, %0
ret i32 %4
}
/* Type definitions */
struct passwd {
  char *pw_name;
  char *pw_passwd;
};

/* Variables and functions */
struct passwd *getpwuid(int);
int getuid();
int /*<<< orphan*/ printf(char *, char *);
main() {
  int uid = getuid();
  struct passwd *pw = getpwuid(uid);
  printf("my name is %s.\n", pw->pw_name);
  printf("my password is %s.\n", pw->pw_passwd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,%rbx
mov    (%rax),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
mov    0x8(%rbx),%rsi
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.passwd = type { i8*, i8* }
@.str = [16 x i8] c"my name is %s.\0A\00"
@.str.1 = [20 x i8] c"my password is %s.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 0, i32* %1
%4 = call i32 (...) @getuid()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call %struct.passwd* @getpwuid(i32 %5)
store %struct.passwd* %6, %struct.passwd** %3
%7 = load %struct.passwd*, %struct.passwd** %3
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load %struct.passwd*, %struct.passwd** %3
%12 = getelementptr inbounds %struct.passwd, %struct.passwd* %11, i32 0, i32 1
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %13)
ret i32 0
}

LLVM IR (-O2):
%struct.passwd = type { i8*, i8* }
@.str = [16 x i8] c"my name is %s.\0A\00"
@.str.1 = [20 x i8] c"my password is %s.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 1
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}
int xxxx_ops_lag_queues(struct netdev_xxxx_lag *lag) {}


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

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

LLVM IR (-O0):
%struct.netdev_xxxx_lag = type opaque
define i32 @xxxx_ops_lag_queues(%struct.netdev_xxxx_lag* %0) {
%2 = alloca i32
%3 = alloca %struct.netdev_xxxx_lag*
store %struct.netdev_xxxx_lag* %0, %struct.netdev_xxxx_lag** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.netdev_xxxx_lag = type opaque
define i32 @xxxx_ops_lag_queues(%struct.netdev_xxxx_lag* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int if_op(bool aa, int bb, int cc) {
  int ret = cc;
  if (aa) {
    ret = bb;
  }
  return ret;
}


x86 assembly (clang, -O0):
<if_op>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1123 <if_op+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<if_op>:
mov    %esi,%eax
test   %edi,%edi
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @if_op(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i32 %2, i32 %1
ret i32 %5
}
void testfunc9999(void) {
  int **p1;
  int ***p2;
  struct {
    int *sp1;
    int **sp2;
    int ***sp3;
  };
  struct s *ps1;
  struct s **ps2;
  struct s ***ps3;
  int **(*pfunc1)();
  int **(**pfunc2)();
  int **(***pfunc3)();
  int ***(**pfunc4)();
  int **(**pfunc5)(int **, int **);
  int **(**pfunc6)(int **, int ***);
}


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

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

LLVM IR (-O0):
%struct.s = type opaque
define void @testfunc9999() {
%1 = alloca i32**
%2 = alloca i32***
%3 = alloca %struct.s*
%4 = alloca %struct.s**
%5 = alloca %struct.s***
%6 = alloca i32** (...)*
%7 = alloca i32** (...)**
%8 = alloca i32** (...)***
%9 = alloca i32*** (...)**
%10 = alloca i32** (i32**, i32**)**
%11 = alloca i32** (i32**, i32***)**
ret void
}

LLVM IR (-O2):
%struct.s = type opaque
define void @testfunc9999() {
ret void
}
/* Variables and functions */
int *foo();
int /*<<< orphan*/ test_assert(int);
int main(void) {
  int *a = foo();
  *a = 3;
  int *b = foo();
  *b = 13;
  test_assert(*a == 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x3,(%rax)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0xd,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x3,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <test_assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <foo@plt>
mov    %rax,%rbx
movl   $0x3,(%rax)
xor    %eax,%eax
call   1030 <foo@plt>
movl   $0xd,(%rax)
xor    %edi,%edi
cmpl   $0x3,(%rbx)
sete   %dil
call   1040 <test_assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* (...) @foo()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32 3, i32* %5
%6 = call i32* (...) @foo()
store i32* %6, i32** %3
%7 = load i32*, i32** %3
store i32 13, i32* %7
%8 = load i32*, i32** %2
%9 = load i32, i32* %8
%10 = icmp eq i32 %9, 3
%11 = zext i1 %10 to i32
%12 = call i32 @test_assert(i32 %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @foo()
store i32 3, i32* %1
%2 = tail call i32* (...) @foo()
store i32 13, i32* %2
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @test_assert(i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ numa_bitmask_free;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)numa_bitmask_free;
  exit(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)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@numa_bitmask_free = global i32 0
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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @numa_bitmask_free
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@numa_bitmask_free = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ libc_strlen(void *);
int libc_write(int, void *, int /*<<< orphan*/);
int /*<<< orphan*/ writeString(char *, int);
void writeCstring(void *a) {
  int i;
  if (a == NULL) {
    writeString((char *)"(null)", 6);
  } else {
    i = libc_write(1, a, libc_strlen(a));
  }
}


x86 assembly (clang, -O0):
<writeCstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115d <writeCstring+0x2d>
lea    0xeb2(%rip),%rdi
mov    $0x6,%esi
call   1030 <writeString@plt>
jmp    1181 <writeCstring+0x51>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <libc_strlen@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1040 <libc_write@plt>
mov    %eax,-0xc(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeCstring>:
test   %rdi,%rdi
je     114e <writeCstring+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1050 <libc_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <libc_write@plt>
lea    0xeab(%rip),%rdi
mov    $0x6,%esi
jmp    1030 <writeString@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
define void @writeCstring(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @writeString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %13
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @libc_strlen(i8* %10)
%12 = call i32 @libc_write(i32 1, i8* %9, i32 %11)
store i32 %12, i32* %3
br label %13
13: ; preds = %8, %6
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
define void @writeCstring(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @writeString(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
br label %8
5: ; preds = %1
%6 = tail call i32 @libc_strlen(i8* %0)
%7 = tail call i32 @libc_write(i32 1, i8* %0, i32 %6)
br label %8
8: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VDP_fade(unsigned short, unsigned short,
                            unsigned short const *, unsigned short const *,
                            unsigned short, unsigned char);
void VDP_fadePal(unsigned short numpal, const unsigned short *palsrc,
                 const unsigned short *paldst, unsigned short numframe,
                 unsigned char async) {
  VDP_fade(numpal << 4, (numpal << 4) + 15, palsrc, paldst, numframe, async);
}


x86 assembly (clang, -O0):
<VDP_fadePal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %di,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %cx,-0x1a(%rbp)
mov    %al,-0x1b(%rbp)
movzwl -0x2(%rbp),%eax
shl    $0x4,%eax
mov    %ax,%di
movzwl -0x2(%rbp),%eax
shl    $0x4,%eax
add    $0xf,%eax
mov    %ax,%si
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1a(%rbp),%ax
movzwl %di,%edi
movzwl %si,%esi
movzwl %ax,%r8d
movzbl -0x1b(%rbp),%r9d
call   1030 <VDP_fade@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VDP_fadePal>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
shl    $0x4,%edi
lea    0xf(%rdi),%eax
movzwl %di,%edi
movzwl %ax,%esi
jmp    1030 <VDP_fade@plt>

LLVM IR (-O0):
define void @VDP_fadePal(i16 zeroext %0, i16* %1, i16* %2, i16 zeroext %3, i8 zeroext %4) {
%6 = alloca i16
%7 = alloca i16*
%8 = alloca i16*
%9 = alloca i16
%10 = alloca i8
store i16 %0, i16* %6
store i16* %1, i16** %7
store i16* %2, i16** %8
store i16 %3, i16* %9
store i8 %4, i8* %10
%11 = load i16, i16* %6
%12 = zext i16 %11 to i32
%13 = shl i32 %12, 4
%14 = trunc i32 %13 to i16
%15 = load i16, i16* %6
%16 = zext i16 %15 to i32
%17 = shl i32 %16, 4
%18 = add nsw i32 %17, 15
%19 = trunc i32 %18 to i16
%20 = load i16*, i16** %7
%21 = load i16*, i16** %8
%22 = load i16, i16* %9
%23 = load i8, i8* %10
%24 = call i32 @VDP_fade(i16 zeroext %14, i16 zeroext %19, i16* %20, i16* %21, i16 zeroext %22, i8 zeroext %23)
ret void
}

LLVM IR (-O2):
define void @VDP_fadePal(i16 zeroext %0, i16* %1, i16* %2, i16 zeroext %3, i8 zeroext %4) {
%6 = shl i16 %0, 4
%7 = or i16 %6, 15
%8 = tail call i32 @VDP_fade(i16 zeroext %6, i16 zeroext %7, i16* %1, i16* %2, i16 zeroext %3, i8 zeroext %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
char *strchr(char *, char);
int /*<<< orphan*/ strncpy(char *, char const *const, int);
char *irc_get_nickname(const char *const hostmask) {
  static char data[512];
  char *tempchr;
  strncpy(data, hostmask, sizeof(data) - 1);
  data[sizeof(data) - 1] = 0;
  if ((tempchr = strchr(data, '!')) != NULL)
    *tempchr = 0;
  return (data);
}


x86 assembly (clang, -O0):
<irc_get_nickname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0x2f09(%rip),%rdi
mov    $0x1ff,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x30f7(%rip)
lea    0x2ef1(%rip),%rdi
mov    $0x21,%esi
call   1040 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     116e <irc_get_nickname+0x4e>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
lea    0x2ecb(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_get_nickname>:
push   %rbx
mov    %rdi,%rsi
lea    0x2f15(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1ff,%edx
call   1030 <strncpy@plt>
movb   $0x0,0x3100(%rip)
mov    %rbx,%rdi
mov    $0x21,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1154 <irc_get_nickname+0x34>
movb   $0x0,(%rax)
lea    0x2ee5(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@irc_get_nickname.data = internal global [512 x i8] zeroinitializer
define i8* @irc_get_nickname(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strncpy(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 0), i8* %4, i32 511)
store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 511)
%6 = call i8* @strchr(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 0), i8 signext 33)
store i8* %6, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
store i8 0, i8* %9
br label %10
10: ; preds = %8, %1
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 0)
}

LLVM IR (-O2):
@irc_get_nickname.data = internal global [512 x i8] zeroinitializer
define i8* @irc_get_nickname(i8* %0) {
%2 = tail call i32 @strncpy(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 0), i8* %0, i32 511)
store i8 0, i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 511)
%3 = tail call i8* @strchr(i8* dereferenceable(1) getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 0), i8 signext 33)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 0, i8* %3
br label %6
6: ; preds = %5, %1
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @irc_get_nickname.data, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ init();
int /*<<< orphan*/ selectproc();
int main() {
  init();
  selectproc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @selectproc()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quoteat(char const *, void const *, int, int);
void quote(const char *prefix, const void *p, int len) {
  quoteat(prefix, p, len, -1);
}


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

x86 assembly (clang, -O2):
<quote>:
mov    $0xffffffff,%ecx
jmp    1030 <quoteat@plt>

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

LLVM IR (-O2):
define void @quote(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @quoteat(i8* %0, i8* %1, i32 %2, i32 -1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_linux_file_name(char *);
int /*<<< orphan*/ tcp_yeah_register();
void module_register(void) {
  tcp_yeah_register();
  set_linux_file_name("tcp_yeah.c");
}


x86 assembly (clang, -O0):
<module_register>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <tcp_yeah_register@plt>
lea    0xece(%rip),%rdi
call   1030 <set_linux_file_name@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<module_register>:
push   %rax
xor    %eax,%eax
call   1040 <tcp_yeah_register@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <set_linux_file_name@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"tcp_yeah.c\00"
define void @module_register() {
%1 = call i32 (...) @tcp_yeah_register()
%2 = call i32 @set_linux_file_name(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"tcp_yeah.c\00"
define void @module_register() {
%1 = tail call i32 (...) @tcp_yeah_register()
%2 = tail call i32 @set_linux_file_name(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int accept_number_form_user();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("You Entered: %d\n", accept_number_form_user());
  char buffer[256] = {0x00};
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <accept_number_form_user@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <accept_number_form_user@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"You Entered: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @accept_number_form_user()
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = bitcast [256 x i8]* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"You Entered: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @accept_number_form_user()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  printf("1%c", (char)0x0a);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"1%c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext 10)
ret i32 0
}
/* Variables and functions */
int our_code_starts_here();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%d\n", our_code_starts_here());
  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    $0x0,%al
call   1040 <our_code_starts_here@plt>
mov    %eax,%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <our_code_starts_here@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @our_code_starts_here()
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @our_code_starts_here()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
int do_write(char const *fineName, struct repertoire *rep) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.repertoire = type opaque
define i32 @do_write(i8* nocapture readnone %0, %struct.repertoire* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ qnt_numbers(int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int n;
  printf("digite numero: ");
  scanf("%d", &n);
  qnt_numbers(n);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <qnt_numbers@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"digite numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%9 = load i32, i32* %6
%10 = call i32 @qnt_numbers(i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"digite numero: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @qnt_numbers(i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int /*<<< orphan*/ report(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/);
void printip(uint32_t ip) {
  uint8_t addr[4];
  memcpy(addr, &ip, 4);
  report("%d.%d.%d.%d", addr[0], addr[1], addr[2], addr[3]);
}


x86 assembly (clang, -O0):
<printip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xeaf(%rip),%rdi
call   1040 <report@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printip>:
sub    $0x28,%rsp
mov    %edi,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x10(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x1c(%rsp),%r8d
lea    0xeac(%rip),%rdi
call   1040 <report@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @printip(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i32* %4, i32* %2, i32 4)
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%7 = load i32, i32* %6
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%11 = load i32, i32* %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%13 = load i32, i32* %12
%14 = call i32 @report(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11, i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define void @printip(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i32]
store i32 %0, i32* %2
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @memcpy(i32* %5, i32* %2, i32 4)
%7 = load i32, i32* %5
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%9 = load i32, i32* %8
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%11 = load i32, i32* %10
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%13 = load i32, i32* %12
%14 = call i32 @report(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9, i32 %11, i32 %13)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 10;
  double y = 20.0;
  printf("%f\n", x + y);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movsd  0xed2(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
cvttsd2si %xmm0,%esi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store i32 10, i32* %2
store double 2.000000e+01, double* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = load double, double* %3
%7 = fadd double %5, %6
%8 = fptosi double %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ put_byte(int /*<<< orphan*/ *, unsigned int);
void put_le16(FILE *s, unsigned int val) {
  put_byte(s, val);
  put_byte(s, val >> 8);
}


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

x86 assembly (clang, -O2):
<put_le16>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
call   1030 <put_byte@plt>
shr    $0x8,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <put_byte@plt>

LLVM IR (-O0):
define void @put_le16(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @put_byte(i32* %5, i32 %6)
%8 = load i32*, i32** %3
%9 = load i32, i32* %4
%10 = lshr i32 %9, 8
%11 = call i32 @put_byte(i32* %8, i32 %10)
ret void
}

LLVM IR (-O2):
define void @put_le16(i32* %0, i32 %1) {
%3 = tail call i32 @put_byte(i32* %0, i32 %1)
%4 = lshr i32 %1, 8
%5 = tail call i32 @put_byte(i32* %0, i32 %4)
ret void
}
int f8(struct S { enum E8 { a, b } o; } p) {
  struct S o;
  enum E8 x;
  return a + b;
}


x86 assembly (clang, -O0):
<f8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.S = type { i32 }
define i32 @f8(i32 %0) {
%2 = alloca %struct.S
%3 = alloca %struct.S
%4 = alloca i32
%5 = getelementptr inbounds %struct.S, %struct.S* %2, i32 0, i32 0
store i32 %0, i32* %5
ret i32 1
}

LLVM IR (-O2):
define i32 @f8(i32 %0) {
ret i32 1
}