xunge/DecIR huggingface dataset:
/* Variables and functions */
long udivmodsi4(long, long, int);
long __umodsi3(long a, long b) { return udivmodsi4(a, b, 1); }


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

x86 assembly (clang, -O2):
<__umodsi3>:
mov    $0x1,%edx
jmp    1030 <udivmodsi4@plt>

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

LLVM IR (-O2):
define i64 @__umodsi3(i64 %0, i64 %1) {
%3 = tail call i64 @udivmodsi4(i64 %0, i64 %1, i32 1)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *);
void C_Ret(void) {
  Inst_Printf("ret", "");
  Inst_Printf("restore", "");
}


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

x86 assembly (clang, -O2):
<C_Ret>:
push   %rbx
lea    0xee8(%rip),%rdi
lea    0xeec(%rip),%rbx
mov    %rbx,%rsi
call   1030 <Inst_Printf@plt>
lea    0xed6(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"ret\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c"restore\00"
define void @C_Ret() {
%1 = call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @Inst_Printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"ret\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [8 x i8] c"restore\00"
define void @C_Ret() {
%1 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *ultoa(int, char *, unsigned int);
char *itoa(int num, char *res, int radix) {
  if (radix == 10 && num < 0) {
    *res++ = '-';
    num = -num;
  }
  return ultoa(num, res, (unsigned)radix);
}


x86 assembly (clang, -O0):
<itoa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jne    1150 <itoa+0x40>
cmpl   $0x0,-0x4(%rbp)
jge    1150 <itoa+0x40>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movb   $0x2d,(%rax)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <ultoa@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<itoa>:
test   %edi,%edi
jns    1122 <itoa+0x12>
cmp    $0xa,%edx
jne    1122 <itoa+0x12>
movb   $0x2d,(%rsi)
add    $0x1,%rsi
neg    %edi
jmp    1030 <ultoa@plt>

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

LLVM IR (-O2):
define i8* @itoa(i32 %0, i8* %1, i32 %2) {
%4 = icmp eq i32 %2, 10
%5 = icmp slt i32 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %1, i64 1
store i8 45, i8* %1
%9 = sub nsw i32 0, %0
br label %10
10: ; preds = %7, %3
%11 = phi i8* [ %8, %7 ], [ %1, %3 ]
%12 = phi i32 [ %9, %7 ], [ %0, %3 ]
%13 = tail call i8* @ultoa(i32 %12, i8* %11, i32 %2)
ret i8* %13
}
/* Variables and functions */
int exp(float);
float function_bipolar(float in) {
  float aux = (2 / (1 + exp(-in))) - 1;
  return aux;
}


x86 assembly (clang, -O0):
<function_bipolar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x2,%eax
cltd
idiv   %ecx
sub    $0x1,%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_bipolar>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x2,%eax
xor    %edx,%edx
idiv   %ecx
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @function_bipolar(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fneg float %4
%6 = call i32 @exp(float %5)
%7 = add nsw i32 1, %6
%8 = sdiv i32 2, %7
%9 = sub nsw i32 %8, 1
%10 = sitofp i32 %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @function_bipolar(float %0) {
%2 = fneg float %0
%3 = tail call i32 @exp(float %2)
%4 = add nsw i32 %3, 1
%5 = sdiv i32 2, %4
%6 = add nsw i32 %5, -1
%7 = sitofp i32 %6 to float
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ android_atomic_add(int, int /*<<< orphan*/ volatile *);
extern __attribute__((always_)) int32_t
android_atomic_inc(volatile int32_t *addr) {
  return android_atomic_add(1, addr);
}


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

x86 assembly (clang, -O2):
<android_atomic_inc>:
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <android_atomic_add@plt>

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

LLVM IR (-O2):
define i32 @android_atomic_inc(i32* %0) {
%2 = tail call i32 @android_atomic_add(i32 1, i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SetMotorsAndTime(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                    int);
int first(int seq) {
  SetMotorsAndTime(100, 0, 0, 50);
  return 1;
}


x86 assembly (clang, -O0):
<first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x64,%edi
xor    %edx,%edx
mov    $0x32,%ecx
mov    %edx,%esi
call   1030 <SetMotorsAndTime@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<first>:
push   %rax
mov    $0x64,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x32,%ecx
call   1030 <SetMotorsAndTime@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @first(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @SetMotorsAndTime(i32 100, i32 0, i32 0, i32 50)
ret i32 1
}

LLVM IR (-O2):
define i32 @first(i32 %0) {
%2 = tail call i32 @SetMotorsAndTime(i32 100, i32 0, i32 0, i32 50)
ret i32 1
}
unsigned char rol8(unsigned char input, int count) {
  return ((input << count) & 0xff) | (input & 0xff) >> (8 - count);
}


x86 assembly (clang, -O0):
<rol8>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
and    $0xff,%eax
movzbl -0x1(%rbp),%edx
and    $0xff,%edx
mov    $0x8,%ecx
sub    -0x8(%rbp),%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rol8>:
mov    %esi,%ecx
mov    %edi,%eax
rol    %cl,%al
ret

LLVM IR (-O0):
define zeroext i8 @rol8(i8 zeroext %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
store i32 %1, i32* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 %6, %7
%9 = and i32 %8, 255
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 255
%13 = load i32, i32* %4
%14 = sub nsw i32 8, %13
%15 = ashr i32 %12, %14
%16 = or i32 %9, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @rol8(i8 zeroext %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = tail call i8 @llvm.fshl.i8(i8 %0, i8 %0, i8 %3)
ret i8 %4
}
float circle(float x) { return (2 * x * 3.1415f); }


x86 assembly (clang, -O0):
<circle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  0xee2(%rip),%xmm1
mulss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<circle>:
addss  %xmm0,%xmm0
mulss  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define float @circle(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float 2.000000e+00, %3
%5 = fmul float %4, 0x400921CAC0000000
ret float %5
}

LLVM IR (-O2):
define float @circle(float %0) {
%2 = fmul float %0, 2.000000e+00
%3 = fmul float %2, 0x400921CAC0000000
ret float %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t le64_to_cpu(uint64_t v) { return (v); }


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

x86 assembly (clang, -O2):
<le64_to_cpu>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @le64_to_cpu(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ malloc(int);
char **getActors(void) {
  char **p = (char **)malloc(sizeof(char *) * 20);
  p[1] = "hello";
  p[2] = "world";
  return p;
}


x86 assembly (clang, -O0):
<getActors>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa0,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
lea    0xec6(%rip),%rcx
mov    %rcx,0x10(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getActors>:
push   %rax
mov    $0xa0,%edi
call   1030 <malloc@plt>
lea    0xede(%rip),%rcx
mov    %rcx,0x8(%rax)
lea    0xed9(%rip),%rcx
mov    %rcx,0x10(%rax)
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define i8** @getActors() {
%1 = alloca i8**
%2 = call i64 @malloc(i32 160)
%3 = inttoptr i64 %2 to i8**
store i8** %3, i8*** %1
%4 = load i8**, i8*** %1
%5 = getelementptr inbounds i8*, i8** %4, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8**, i8*** %1
%7 = getelementptr inbounds i8*, i8** %6, i64 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = load i8**, i8*** %1
ret i8** %8
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [6 x i8] c"world\00"
define i8** @getActors() {
%1 = tail call i64 @malloc(i32 160)
%2 = inttoptr i64 %1 to i8**
%3 = getelementptr inbounds i8*, i8** %2, i64 1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds i8*, i8** %2, i64 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %4
ret i8** %2
}
void pacemaker_execute_initialization() {}


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

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

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

LLVM IR (-O2):
define void @pacemaker_execute_initialization() {
ret void
}
char const *pubnub_version(void) { return "2.1-alpha"; }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"2.1-alpha\00"
define i8* @pubnub_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [10 x i8] c"2.1-alpha\00"
define i8* @pubnub_version() {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
struct mem_controller {
  int dummy;
};

/* Variables and functions */
scalar_t__ is_cpu_pre_c0();
int /*<<< orphan*/ outb(int, int);
int /*<<< orphan*/ udelay(int);
void memreset(int controllers, const struct mem_controller *ctrl) {
  if (is_cpu_pre_c0()) {
    udelay(800);
    outb((0 << 7) | (0 << 6) | (0 << 5) | (0 << 4) | (1 << 2) | (1 << 0),
         0x0f00 + 0xc0 + 28);
    udelay(90);
  }
}


x86 assembly (clang, -O0):
<memreset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <is_cpu_pre_c0@plt>
cmp    $0x0,%rax
je     1173 <memreset+0x43>
mov    $0x320,%edi
call   1040 <udelay@plt>
mov    $0x5,%edi
mov    $0xfdc,%esi
call   1030 <outb@plt>
mov    $0x5a,%edi
call   1040 <udelay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memreset>:
push   %rax
xor    %eax,%eax
call   1050 <is_cpu_pre_c0@plt>
test   %rax,%rax
je     1161 <memreset+0x31>
mov    $0x320,%edi
call   1040 <udelay@plt>
mov    $0x5,%edi
mov    $0xfdc,%esi
call   1030 <outb@plt>
mov    $0x5a,%edi
pop    %rax
jmp    1040 <udelay@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.mem_controller = type { i32 }
define void @memreset(i32 %0, %struct.mem_controller* %1) {
%3 = alloca i32
%4 = alloca %struct.mem_controller*
store i32 %0, i32* %3
store %struct.mem_controller* %1, %struct.mem_controller** %4
%5 = call i64 (...) @is_cpu_pre_c0()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = call i32 @udelay(i32 800)
%9 = call i32 @outb(i32 5, i32 4060)
%10 = call i32 @udelay(i32 90)
br label %11
11: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
%struct.mem_controller = type { i32 }
define void @memreset(i32 %0, %struct.mem_controller* nocapture readnone %1) {
%3 = tail call i64 (...) @is_cpu_pre_c0()
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @udelay(i32 800)
%7 = tail call i32 @outb(i32 5, i32 4060)
%8 = tail call i32 @udelay(i32 90)
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/
FLAC__format_get_max_rice_partition_order_from_blocksize(unsigned int);
int FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(
    int /*<<< orphan*/, unsigned int, unsigned int);
unsigned FLAC__format_get_max_rice_partition_order(unsigned blocksize,
                                                   unsigned predictor_order) {
  return FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(
      FLAC__format_get_max_rice_partition_order_from_blocksize(blocksize),
      blocksize, predictor_order);
}


x86 assembly (clang, -O0):
<FLAC__format_get_max_rice_partition_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <FLAC__format_get_max_rice_partition_order_from_blocksize@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FLAC__format_get_max_rice_partition_order>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <FLAC__format_get_max_rice_partition_order_from_blocksize@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order@plt>

LLVM IR (-O0):
define i32 @FLAC__format_get_max_rice_partition_order(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 = call i32 @FLAC__format_get_max_rice_partition_order_from_blocksize(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @FLAC__format_get_max_rice_partition_order(i32 %0, i32 %1) {
%3 = tail call i32 @FLAC__format_get_max_rice_partition_order_from_blocksize(i32 %0)
%4 = tail call i32 @FLAC__format_get_max_rice_partition_order_from_blocksize_limited_max_and_predictor_order(i32 %3, i32 %0, i32 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ LOG_DAEMON;
int /*<<< orphan*/ LOG_INFO;
int LOG_NDELAY;
int LOG_PID;
int /*<<< orphan*/ LOG_UPTO(int /*<<< orphan*/);
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ setlogmask(int /*<<< orphan*/);
void reopen_log() {
  openlog("pppd", LOG_PID | LOG_NDELAY, LOG_DAEMON);
  setlogmask(LOG_UPTO(LOG_INFO));
}


x86 assembly (clang, -O0):
<reopen_log>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e9d(%rip),%rax
mov    (%rax),%esi
mov    0x2e7c(%rip),%rax
or     (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    0xeaa(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
call   1040 <setlogmask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reopen_log>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    0x2e81(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2e9e(%rip),%rax
mov    (%rax),%edx
lea    0xead(%rip),%rdi
call   1050 <openlog@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1030 <LOG_UPTO@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <setlogmask@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"pppd\00"
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_DAEMON = global i32 0
@LOG_INFO = global i32 0
define void @reopen_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_NDELAY
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_DAEMON
%5 = call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = call i32 @LOG_UPTO(i32 %6)
%8 = call i32 @setlogmask(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"pppd\00"
@LOG_PID = global i32 0
@LOG_NDELAY = global i32 0
@LOG_DAEMON = global i32 0
@LOG_INFO = global i32 0
define void @reopen_log() {
%1 = load i32, i32* @LOG_PID
%2 = load i32, i32* @LOG_NDELAY
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_DAEMON
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
%6 = load i32, i32* @LOG_INFO
%7 = tail call i32 @LOG_UPTO(i32 %6)
%8 = tail call i32 @setlogmask(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main() {
  fprintf(stderr, "hello\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [7 x i8] c"hello\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BusOperation(int, unsigned int, unsigned int *);
int /*<<< orphan*/ UpdateMesif(int, unsigned int, int /*<<< orphan*/,
                               int /*<<< orphan*/, unsigned int);
int ExecuteCommand5(unsigned int index, unsigned int tag,
                    unsigned int HexAddress) {
  unsigned int SnoopResult = 0;
  int cmd = 5;
  int BusOp = 2;
  BusOperation(BusOp, HexAddress, &SnoopResult);
  UpdateMesif(cmd, HexAddress, 0, 0, SnoopResult);
  return 0;
}


x86 assembly (clang, -O0):
<ExecuteCommand5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x5,-0x14(%rbp)
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
call   1040 <BusOperation@plt>
mov    -0x14(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <UpdateMesif@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExecuteCommand5>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdx
mov    $0x2,%edi
mov    %ebx,%esi
call   1040 <BusOperation@plt>
mov    0xc(%rsp),%r8d
mov    $0x5,%edi
mov    %ebx,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <UpdateMesif@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ExecuteCommand5(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @BusOperation(i32 2, i32 %2, i32* %4)
%7 = load i32, i32* %4
%8 = call i32 @UpdateMesif(i32 5, i32 %2, i32 0, i32 0, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int powercap_sysfs_zone_reset_energy_uj(char *, int /*<<< orphan*/ *, int);
int rapl_sysfs_zone_reset_energy_uj(uint32_t zone, uint32_t sz, int is_sz) {
  uint32_t zones[2];
  zones[0] = zone;
  zones[1] = sz;
  ;
  return powercap_sysfs_zone_reset_energy_uj("intel-rapl", zones,
                                             (is_sz ? 2 : 1));
}


x86 assembly (clang, -O0):
<rapl_sysfs_zone_reset_energy_uj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
lea    -0x14(%rbp),%rsi
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
mov    $0x2,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
lea    0xeb5(%rip),%rdi
call   1030 <powercap_sysfs_zone_reset_energy_uj@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rapl_sysfs_zone_reset_energy_uj>:
push   %rax
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
cmp    $0x1,%edx
mov    $0x2,%edx
sbb    $0x0,%edx
lea    0xed6(%rip),%rdi
mov    %rsp,%rsi
call   1030 <powercap_sysfs_zone_reset_energy_uj@plt>
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_zone_reset_energy_uj(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i32]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %10, i32* %11
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i32 2, i32 1
%17 = call i32 @powercap_sysfs_zone_reset_energy_uj(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %12, i32 %16)
ret i32 %17
}

LLVM IR (-O2):
@.str = [11 x i8] c"intel-rapl\00"
define i32 @rapl_sysfs_zone_reset_energy_uj(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i32]
%5 = bitcast [2 x i32]* %4 to i8*
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %1, i32* %7
%8 = icmp eq i32 %2, 0
%9 = select i1 %8, i32 1, i32 2
%10 = call i32 @powercap_sysfs_zone_reset_energy_uj(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32* %6, i32 %9)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sse4_test();
int /*<<< orphan*/ sse_test();
int main() {
  sse_test();
  sse4_test();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sse_test()
%2 = tail call i32 (...) @sse4_test()
ret i32 0
}
int test_imm_46uint8_mem(unsigned char *val) {
  return ((*val) & (-0x46 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_46uint8_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, -70
%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_46uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -70
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  char a[] = "\"\\\"	\\\"\"";
  if (strcmp(a, "\"\\\"	\\\"\""))
    do {
      ;
      abort();
    } while (0);
  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)
mov    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1167 <main+0x47>
jmp    1160 <main+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x22225c09225c22,%rax
mov    %rax,(%rsp)
lea    0xeca(%rip),%rsi
mov    %rsp,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1147 <main+0x27>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const.main.a = [8 x i8] c"\22\\\22\09\\\22\22\00"
@.str = [8 x i8] c"\22\\\22\09\\\22\22\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [8 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [8 x i8]* %6 to i8*
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%9 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
br label %12
12: ; preds = %11
%13 = call i32 (...) @abort()
unreachable
14: ; No predecessors!
br label %15
15: ; preds = %14, %2
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\22\\\22\09\\\22\22\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 9607927893744674, i64* %3
%5 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = call i32 (...) @abort()
unreachable
9: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err(char *, unsigned long);
void *malloc(size_t);
void *mem_alloc(size_t size) {
  void *r = malloc(size);
  if (!r)
    err("cannot allocate %lu bytes\n", (unsigned long)(size & ~0ul));
  return r;
}


x86 assembly (clang, -O0):
<mem_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1158 <mem_alloc+0x38>
mov    -0x8(%rbp),%rsi
and    $0xffffffffffffffff,%rsi
lea    0xead(%rip),%rdi
call   1030 <err@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_alloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <mem_alloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <err@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [27 x i8] c"cannot allocate %lu bytes\0A\00"
define i8* @mem_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = and i64 %9, -1
%11 = call i32 @err(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %10)
br label %12
12: ; preds = %8, %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@.str = [27 x i8] c"cannot allocate %lu bytes\0A\00"
define noalias i8* @mem_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int);
void perror(const char *s) {
  int e = errno;
  fprintf(stderr, "%s: %s\n", s, strerror(e));
}


x86 assembly (clang, -O0):
<perror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <strerror@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rdx
mov    %rax,%rcx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<perror>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
mov    0x2eaa(%rip),%rax
mov    (%rax),%ebp
call   1040 <strerror@plt>
lea    0xebc(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rdx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fprintf@plt>

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

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

/* Variables and functions */
int /*<<< orphan*/ debug(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int file_exists(const char *filename) {
  debug("Inside [file_exists]\n");
  FILE *fp = fopen(filename, "r");
  if (fp != NULL)
    fclose(fp);
  return (fp != NULL);
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <debug@plt>
mov    -0x8(%rbp),%rdi
lea    0xec3(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1170 <file_exists+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <debug@plt>
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115f <file_exists+0x2f>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
test   %rbx,%rbx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Inside [file_exists]\0A\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = call i32 @debug(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %2
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %3
%7 = load i32*, i32** %3
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i32 @fclose(i32* %10)
br label %12
12: ; preds = %9, %1
%13 = load i32*, i32** %3
%14 = icmp ne i32* %13, null
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
@.str = [22 x i8] c"Inside [file_exists]\0A\00"
@.str.1 = [2 x i8] c"r\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32 @debug(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @fclose(i32* %3)
br label %7
7: ; preds = %5, %1
%8 = zext i1 %4 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int square(int);
int main(void) {
  int n = 12;
  printf("%d\n", square(n));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @square(i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *, char *);
void unknown_directive(char *filename, char *directive) {
  char *title = "Unknown Directive";
  (void)printf("<HR><H2>%s</H2>\nThe requested server-side-includes filename, "
               "%s,\ntried to use an unknown directive, %s.\n<HR>\n",
               title, filename, directive);
}


x86 assembly (clang, -O0):
<unknown_directive>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unknown_directive>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xef5(%rip),%rdi
lea    0xedc(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Unknown Directive\00"
@.str.1 = [110 x i8] c"<HR><H2>%s</H2>\0AThe requested server-side-includes filename, %s,\0Atried to use an unknown directive, %s.\0A<HR>\0A\00"
define void @unknown_directive(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Unknown Directive\00"
@.str.1 = [110 x i8] c"<HR><H2>%s</H2>\0AThe requested server-side-includes filename, %s,\0Atried to use an unknown directive, %s.\0A<HR>\0A\00"
define void @unknown_directive(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([110 x i8], [110 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void CFGMR3QueryPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3QueryPtr() {
ret void
}
int test_imm_ACint16_mem(short *val) {
  return ((*val) & (0xAC << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_ACint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 172
%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_ACint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 172
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CheckPort(char const *, void *);
int /*<<< orphan*/ printf(char *, char const *);
int ShowPort(const char *port, void *data) {
  if (data)
    CheckPort(port, data);
  else
    printf("%s\n", port);
  return 1;
}


x86 assembly (clang, -O0):
<ShowPort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114d <ShowPort+0x2d>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <CheckPort@plt>
jmp    115d <ShowPort+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xea8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShowPort>:
push   %rax
mov    %rdi,%rax
test   %rsi,%rsi
je     1133 <ShowPort+0x13>
mov    %rax,%rdi
call   1030 <CheckPort@plt>
jmp    1142 <ShowPort+0x22>
lea    0xec6(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @ShowPort(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @CheckPort(i8* %0, i8* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %8
8: ; preds = %6, %4
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void show(char url[], int n, unsigned int DocID) {
  if (n != 0) {
    printf("DocID: %u\n", DocID);
  } else {
    printf("unknown DocID\n");
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1142 <show+0x32>
mov    -0x10(%rbp),%esi
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1150 <show+0x40>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
test   %esi,%esi
je     1134 <show+0x14>
lea    0xed5(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
jmp    1040 <printf@plt>
lea    0xed0(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"DocID: %u\0A\00"
@.str.1 = [15 x i8] c"unknown DocID\0A\00"
define void @show(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %14
12: ; preds = %3
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"DocID: %u\0A\00"
@str = [14 x i8] c"unknown DocID\00"
define void @show(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %9
7: ; preds = %3
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int);
int /*<<< orphan*/ stderr;
void usage(char *av0, int depth) {
  fprintf(stderr,
          "Usage: %s [-d <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\n"
          " -d        parallel recursion depth, default %d\n"
          " -n        number of threads in pool, default %d\n"
          " -b        run built-in qsort\n"
          " -s        specify srand() seed\n"
          " -q        run serial qsort\n",
          av0, depth, 4);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
mov    $0x4,%r8d
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
mov    $0x4,%r8d
call   1030 <fprintf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [239 x i8] c"Usage: %s [-d <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\0A -d parallel recursion depth, default %d\0A -n number of threads in pool, default %d\0A -b run built-in qsort\0A -s specify srand() seed\0A -q run serial qsort\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7, i32 4)
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [239 x i8] c"Usage: %s [-d <n>] [-n <n>] [-b] [-q] [-s <n>] <N>\0A -d parallel recursion depth, default %d\0A -n number of threads in pool, default %d\0A -b run built-in qsort\0A -s specify srand() seed\0A -q run serial qsort\0A\00"
define void @usage(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([239 x i8], [239 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 4)
%5 = tail call i32 @exit(i32 0)
unreachable
}
int sancus_bit_has_flag(unsigned long flags, unsigned flag) {
  return (flags & flag) == flag;
}


x86 assembly (clang, -O0):
<sancus_bit_has_flag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
and    %rcx,%rax
mov    -0xc(%rbp),%ecx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sancus_bit_has_flag>:
not    %edi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @sancus_bit_has_flag(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i64, i64* %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = and i64 %5, %7
%9 = load i32, i32* %4
%10 = zext i32 %9 to i64
%11 = icmp eq i64 %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @sancus_bit_has_flag(i64 %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = and i64 %3, %0
%5 = icmp eq i64 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int test1(int i) {
  enum en { zero };
  return i > zero;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}