xunge/DecIR huggingface dataset:
char *rb_path_next(s) const char *s;
{
  while (*s && !((*s) == '/')) {
    s = ((s) + 1);
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<rb_path_next>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     112f <rb_path_next+0x2f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
sete   %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113f <rb_path_next+0x3f>
jmp    1150 <rb_path_next+0x50>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <rb_path_next+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_path_next>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
test   %cl,%cl
je     1122 <rb_path_next+0x22>
cmp    $0x2f,%cl
je     1122 <rb_path_next+0x22>
add    $0x1,%rax
jmp    1110 <rb_path_next+0x10>
ret

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

LLVM IR (-O2):
define i8* @rb_path_next(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 47, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ begin(char *);
int /*<<< orphan*/ getLibraryParameterValueReal(char *);
int /*<<< orphan*/ lineWidth(int /*<<< orphan*/);
int /*<<< orphan*/ setLayer(int);
int /*<<< orphan*/ setWireBend(int);
void beginLegendOutline(int layer) {
  setLayer(layer);
  setWireBend(2);
  begin("WIRE");
  lineWidth(getLibraryParameterValueReal("legendLineWidth"));
}


x86 assembly (clang, -O0):
<beginLegendOutline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <setLayer@plt>
mov    $0x2,%edi
call   1070 <setWireBend@plt>
lea    0xe8c(%rip),%rdi
call   1050 <begin@plt>
lea    0xe85(%rip),%rdi
call   1060 <getLibraryParameterValueReal@plt>
mov    %eax,%edi
call   1040 <lineWidth@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<beginLegendOutline>:
push   %rax
call   1030 <setLayer@plt>
mov    $0x2,%edi
call   1070 <setWireBend@plt>
lea    0xe99(%rip),%rdi
call   1050 <begin@plt>
lea    0xe92(%rip),%rdi
call   1060 <getLibraryParameterValueReal@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <lineWidth@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"WIRE\00"
@.str.1 = [16 x i8] c"legendLineWidth\00"
define void @beginLegendOutline(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @setLayer(i32 %3)
%5 = call i32 @setWireBend(i32 2)
%6 = call i32 @begin(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @getLibraryParameterValueReal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @lineWidth(i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"WIRE\00"
@.str.1 = [16 x i8] c"legendLineWidth\00"
define void @beginLegendOutline(i32 %0) {
%2 = tail call i32 @setLayer(i32 %0)
%3 = tail call i32 @setWireBend(i32 2)
%4 = tail call i32 @begin(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @getLibraryParameterValueReal(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @lineWidth(i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jq_append(char const *, char const *, char const *);
int /*<<< orphan*/ jq_refresh(char const *);
void jq_refresh_or_append(const char *id, const char *name, const char *url) {
  if (!jq_refresh(id)) {
    jq_append(id, name, url);
  }
}


x86 assembly (clang, -O0):
<jq_refresh_or_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <jq_refresh@plt>
cmp    $0x0,%eax
jne    1157 <jq_refresh_or_append+0x37>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <jq_append@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jq_refresh_or_append>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <jq_refresh@plt>
test   %eax,%eax
je     113d <jq_refresh_or_append+0x1d>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <jq_append@plt>

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

LLVM IR (-O2):
define void @jq_refresh_or_append(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @jq_refresh(i8* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @jq_append(i8* %0, i8* %1, i8* %2)
br label %8
8: ; preds = %6, %3
ret void
}
unsigned long wby_base64_bufsize(unsigned long input_size) {
  unsigned long triplets = (input_size + 2) / 3;
  unsigned long base_size = 4 * triplets;
  unsigned long line_breaks = 2 * (triplets / 19);
  unsigned long null_termination = 1;
  return base_size + line_breaks + null_termination;
}


x86 assembly (clang, -O0):
<wby_base64_bufsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    $0x3,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x13,%ecx
xor    %edx,%edx
div    %rcx
shl    $0x1,%rax
mov    %rax,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wby_base64_bufsize>:
lea    0x2(%rdi),%rcx
movabs $0xaaaaaaaaaaaaaaab,%rdx
aa aa aa
mov    %rcx,%rax
mul    %rdx
mov    %rdx,%rsi
movabs $0x8fb823ee08fb823f,%rdx
23 b8 8f
mov    %rcx,%rax
mul    %rdx
and    $0xfffffffffffffffe,%rsi
shr    $0x4,%rdx
and    $0xfffffffffffffffe,%rdx
lea    (%rdx,%rsi,2),%rax
add    $0x1,%rax
ret

LLVM IR (-O0):
define i64 @wby_base64_bufsize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %2
%7 = load i64, i64* %2
%8 = add i64 %7, 2
%9 = udiv i64 %8, 3
store i64 %9, i64* %3
%10 = load i64, i64* %3
%11 = mul i64 4, %10
store i64 %11, i64* %4
%12 = load i64, i64* %3
%13 = udiv i64 %12, 19
%14 = mul i64 2, %13
store i64 %14, i64* %5
store i64 1, i64* %6
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = add i64 %15, %16
%18 = load i64, i64* %6
%19 = add i64 %17, %18
ret i64 %19
}

LLVM IR (-O2):
define i64 @wby_base64_bufsize(i64 %0) {
%2 = add i64 %0, 2
%3 = udiv i64 %2, 3
%4 = shl i64 %3, 2
%5 = udiv i64 %2, 57
%6 = shl nuw nsw i64 %5, 1
%7 = add i64 %4, %6
%8 = or i64 %7, 1
ret i64 %8
}
/* Variables and functions */
float tgammaf(float);
float __ocl_tgamma_float(float src) { return tgammaf(src); }


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

x86 assembly (clang, -O2):
<__ocl_tgamma_float>:
jmp    1030 <tgammaf@plt>

LLVM IR (-O0):
define float @__ocl_tgamma_float(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @tgammaf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @__ocl_tgamma_float(float %0) {
%2 = tail call float @tgammaf(float %0)
ret float %2
}
const char *def_policy_str(int def_policy_choice) {
  switch (def_policy_choice) {
  case 0:
    return "SIMPLE";
  case 1:
    return "PACHI";
  case 2:
    return "PATTERN_V2";
  default:
    return "";
  }
}


x86 assembly (clang, -O0):
<def_policy_str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <def_policy_str+0x3c>
jmp    111a <def_policy_str+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <def_policy_str+0x4c>
jmp    112b <def_policy_str+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <def_policy_str+0x5c>
jmp    116c <def_policy_str+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <def_policy_str+0x77>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <def_policy_str+0x77>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <def_policy_str+0x77>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<def_policy_str>:
cmp    $0x2,%edi
ja     1117 <def_policy_str+0x17>
movslq %edi,%rax
lea    0xf09(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"SIMPLE\00"
@.str.1 = [6 x i8] c"PACHI\00"
@.str.2 = [11 x i8] c"PATTERN_V2\00"
@.str.3 = [1 x i8] zeroinitializer
define i8* @def_policy_str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"SIMPLE\00"
@.str.1 = [6 x i8] c"PACHI\00"
@.str.2 = [11 x i8] c"PATTERN_V2\00"
@.str.3 = [1 x i8] zeroinitializer
@reltable.def_policy_str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.def_policy_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.def_policy_str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.def_policy_str to i64)) to i32)]
define i8* @def_policy_str(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.def_policy_str to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Type definitions */
struct cg_layoutnode_s {
  int dummy;
};

/* Variables and functions */
scalar_t__ CG_GetNumericArg(struct cg_layoutnode_s **);
int CG_LFuncIf(struct cg_layoutnode_s *commandnode,
               struct cg_layoutnode_s *argumentnode, int numArguments) {
  return (int)CG_GetNumericArg(&argumentnode);
}


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

x86 assembly (clang, -O2):
<CG_LFuncIf>:
push   %rax
mov    %rsi,(%rsp)
mov    %rsp,%rdi
call   1030 <CG_GetNumericArg@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.cg_layoutnode_s = type { i32 }
define i32 @CG_LFuncIf(%struct.cg_layoutnode_s* %0, %struct.cg_layoutnode_s* %1, i32 %2) {
%4 = alloca %struct.cg_layoutnode_s*
%5 = alloca %struct.cg_layoutnode_s*
%6 = alloca i32
store %struct.cg_layoutnode_s* %0, %struct.cg_layoutnode_s** %4
store %struct.cg_layoutnode_s* %1, %struct.cg_layoutnode_s** %5
store i32 %2, i32* %6
%7 = call i64 @CG_GetNumericArg(%struct.cg_layoutnode_s** %5)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.cg_layoutnode_s = type { i32 }
define i32 @CG_LFuncIf(%struct.cg_layoutnode_s* nocapture readnone %0, %struct.cg_layoutnode_s* %1, i32 %2) {
%4 = alloca %struct.cg_layoutnode_s*
store %struct.cg_layoutnode_s* %1, %struct.cg_layoutnode_s** %4
%5 = call i64 @CG_GetNumericArg(%struct.cg_layoutnode_s** %4)
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Variables and functions */
int a;
int j(int *, int /*<<< orphan*/);
int main() {
  int n[] = {1, 2, 3};
  int a = j(&n[2], a);
  return a;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x10(%rsp),%rdi
call   1030 <j@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.n = [3 x i32] [i32 1, i32 2, i32 3]
@a = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%6 = load i32, i32* %3
%7 = call i32 @j(i32* %5, i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@__const.main.n = [3 x i32] [i32 1, i32 2, i32 3]
@a = global i32 0
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
%4 = call i32 @j(i32* %3, i32 undef)
ret i32 %4
}
/* Type definitions */
struct strerr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ strerr_warn(char *, char *, char *, char *, char *, char *,
                               struct strerr *);
void strerr_die(int e, char *x1, char *x2, char *x3, char *x4, char *x5,
                char *x6, struct strerr *se) {
  strerr_warn(x1, x2, x3, x4, x5, x6, se);
  _exit(e);
}


x86 assembly (clang, -O0):
<strerr_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <strerr_warn@plt>
mov    -0x4(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<strerr_die>:
push   %rbx
sub    $0x10,%rsp
mov    %r9,%rax
mov    %edi,%ebx
mov    0x20(%rsp),%r9
mov    0x28(%rsp),%rdi
mov    %rdi,(%rsp)
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r8,%rcx
mov    %rax,%r8
call   1040 <strerr_warn@plt>
mov    %ebx,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.strerr = type { i32 }
define void @strerr_die(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, %struct.strerr* %7) {
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca %struct.strerr*
store i32 %0, i32* %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i8* %6, i8** %15
store %struct.strerr* %7, %struct.strerr** %16
%17 = load i8*, i8** %10
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = load i8*, i8** %13
%21 = load i8*, i8** %14
%22 = load i8*, i8** %15
%23 = load %struct.strerr*, %struct.strerr** %16
%24 = call i32 @strerr_warn(i8* %17, i8* %18, i8* %19, i8* %20, i8* %21, i8* %22, %struct.strerr* %23)
%25 = load i32, i32* %9
%26 = call i32 @_exit(i32 %25)
unreachable
}

LLVM IR (-O2):
%struct.strerr = type { i32 }
define void @strerr_die(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, %struct.strerr* %7) {
%9 = tail call i32 @strerr_warn(i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i8* %6, %struct.strerr* %7)
%10 = tail call i32 @_exit(i32 %0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void greska(char *tekst) {
  printf("\nGRESKA: %s\n\n", tekst);
  exit(0);
}


x86 assembly (clang, -O0):
<greska>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<greska>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\0AGRESKA: %s\0A\0A\00"
define void @greska(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AGRESKA: %s\0A\0A\00"
define void @greska(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ cat(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int i;
  for (i = 1; i < argc; ++i) {
    cat(argv[i]);
  }
  exit(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)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1168 <main+0x48>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <cat@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <main+0x1d>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
cmp    $0x2,%edi
jl     1152 <main+0x32>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1040 <cat@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <main+0x20>
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
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
store i32 1, i32* %6
br label %7
7: ; preds = %18, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @cat(i8* %16)
br label %18
18: ; preds = %11
%19 = load i32, i32* %6
%20 = add nsw i32 %19, 1
store i32 %20, i32* %6
br label %7
21: ; preds = %7
%22 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 1, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %1, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @cat(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct msgu_stream {
  int dummy;
};
struct msgu_fragment {
  int dummy;
};

/* Variables and functions */
int msgu_string_write(struct msgu_stream *, struct msgu_fragment *,
                      void const *);
int msgu_string_write_frag(struct msgu_stream *dest, struct msgu_fragment *f,
                           const void *str) {
  return msgu_string_write(dest, f, str);
}


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

x86 assembly (clang, -O2):
<msgu_string_write_frag>:
jmp    1030 <msgu_string_write@plt>

LLVM IR (-O0):
%struct.msgu_stream = type { i32 }
%struct.msgu_fragment = type { i32 }
define i32 @msgu_string_write_frag(%struct.msgu_stream* %0, %struct.msgu_fragment* %1, i8* %2) {
%4 = alloca %struct.msgu_stream*
%5 = alloca %struct.msgu_fragment*
%6 = alloca i8*
store %struct.msgu_stream* %0, %struct.msgu_stream** %4
store %struct.msgu_fragment* %1, %struct.msgu_fragment** %5
store i8* %2, i8** %6
%7 = load %struct.msgu_stream*, %struct.msgu_stream** %4
%8 = load %struct.msgu_fragment*, %struct.msgu_fragment** %5
%9 = load i8*, i8** %6
%10 = call i32 @msgu_string_write(%struct.msgu_stream* %7, %struct.msgu_fragment* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
%struct.msgu_stream = type { i32 }
%struct.msgu_fragment = type { i32 }
define i32 @msgu_string_write_frag(%struct.msgu_stream* %0, %struct.msgu_fragment* %1, i8* %2) {
%4 = tail call i32 @msgu_string_write(%struct.msgu_stream* %0, %struct.msgu_fragment* %1, i8* %2)
ret i32 %4
}
int omap3_mux_config(char *group) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @omap3_mux_config(i8* nocapture readnone %0) {
ret i32 0
}
int test_imm_D7uint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0xD7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D7uint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 215
%7 = icmp ne i64 %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_D7uint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 923417968640
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void caller_2_1_1_1_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_1_1_1_1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gds_swap2bytes(unsigned char *);
int /*<<< orphan*/ write(int, short *, int);
void gds_write_aref(int fd) {
  static short int count, token;
  count = 4;
  gds_swap2bytes((unsigned char *)&count);
  write(fd, &count, 2);
  token = 0x0B00;
  gds_swap2bytes((unsigned char *)&token);
  write(fd, &token, 2);
}


x86 assembly (clang, -O0):
<gds_write_aref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movw   $0x4,0x2efe(%rip)
lea    0x2ef7(%rip),%rdi
call   1040 <gds_swap2bytes@plt>
mov    -0x4(%rbp),%edi
lea    0x2ee8(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
movw   $0xb00,0x2ed7(%rip)
lea    0x2ed0(%rip),%rdi
call   1040 <gds_swap2bytes@plt>
mov    -0x4(%rbp),%edi
lea    0x2ec1(%rip),%rsi
mov    $0x2,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gds_write_aref>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
movw   $0x4,0x2f03(%rip)
lea    0x2efc(%rip),%r14
mov    %r14,%rdi
call   1040 <gds_swap2bytes@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x2,%edx
call   1030 <write@plt>
movw   $0xb00,0x2ede(%rip)
lea    0x2ed7(%rip),%r14
mov    %r14,%rdi
call   1040 <gds_swap2bytes@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x2,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <write@plt>

LLVM IR (-O0):
@gds_write_aref.count = internal global i16 0
@gds_write_aref.token = internal global i16 0
define void @gds_write_aref(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
store i16 4, i16* @gds_write_aref.count
%3 = call i32 @gds_swap2bytes(i8* bitcast (i16* @gds_write_aref.count to i8*))
%4 = load i32, i32* %2
%5 = call i32 @write(i32 %4, i16* @gds_write_aref.count, i32 2)
store i16 2816, i16* @gds_write_aref.token
%6 = call i32 @gds_swap2bytes(i8* bitcast (i16* @gds_write_aref.token to i8*))
%7 = load i32, i32* %2
%8 = call i32 @write(i32 %7, i16* @gds_write_aref.token, i32 2)
ret void
}

LLVM IR (-O2):
@gds_write_aref.count = internal global i16 0
@gds_write_aref.token = internal global i16 0
define void @gds_write_aref(i32 %0) {
store i16 4, i16* @gds_write_aref.count
%2 = tail call i32 @gds_swap2bytes(i8* bitcast (i16* @gds_write_aref.count to i8*))
%3 = tail call i32 @write(i32 %0, i16* @gds_write_aref.count, i32 2)
store i16 2816, i16* @gds_write_aref.token
%4 = tail call i32 @gds_swap2bytes(i8* bitcast (i16* @gds_write_aref.token to i8*))
%5 = tail call i32 @write(i32 %0, i16* @gds_write_aref.token, i32 2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ simple_match(void const *, void const *, size_t, int);
int bu_memcmp(const void *left, const void *right, size_t n) {
  return !simple_match(left, right, n, ((1 << 0) | 0 | 0 | (1 << 3)));
}


x86 assembly (clang, -O0):
<bu_memcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x9,%ecx
call   1030 <simple_match@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bu_memcmp>:
push   %rax
mov    $0x9,%ecx
call   1030 <simple_match@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @bu_memcmp(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @simple_match(i8* %7, i8* %8, i64 %9, i32 9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @bu_memcmp(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @simple_match(i8* %0, i8* %1, i64 %2, i32 9)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int _mm_comineq_sd(int /*<<< orphan*/, int /*<<< orphan*/);
int test_mm_comineq_sd(__m128d A, __m128d B) { return _mm_comineq_sd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_comineq_sd>:
jmp    1030 <_mm_comineq_sd@plt>

LLVM IR (-O0):
define i32 @test_mm_comineq_sd(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 @_mm_comineq_sd(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_comineq_sd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_comineq_sd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
void *f(void *);
main() {
  if (f((void *)0) != (void *)4)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1030 <f@plt>
mov    $0x4,%ecx
cmp    %rcx,%rax
je     1142 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <main+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <f@plt>
xor    %ecx,%ecx
cmp    $0x4,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i8* @f(i8* null)
%2 = icmp ne i8* %1, inttoptr (i64 4 to i8*)
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
unsigned int list_equal(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                        int /*<<< orphan*/ *);
bool test_list_equal_null_params(void) {
  bool pass = false;
  unsigned int res = list_equal(NULL, NULL, NULL);
  if (res == 1) {
    pass = true;
  }
  return pass;
}


x86 assembly (clang, -O0):
<test_list_equal_null_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1030 <list_equal@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1142 <test_list_equal_null_params+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_list_equal_null_params>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <list_equal@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_list_equal_null_params() {
%1 = tail call i32 @list_equal(i32* null, i32* null, i32* null)
%2 = icmp eq i32 %1, 1
%3 = zext i1 %2 to i32
ret i32 %3
}
int CreateData() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @CreateData() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int toRep64(double);
int compareResultD(double result, uint64_t expected) {
  uint64_t rep = toRep64(result);
  if (rep == expected) {
    return 0;
  } else if (expected == 0x7ff8000000000000UL) {
    if ((rep & 0x7ff0000000000000UL) == 0x7ff0000000000000UL &&
        (rep & 0xfffffffffffffUL) > 0) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<compareResultD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <toRep64@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1145 <compareResultD+0x35>
movl   $0x0,-0x4(%rbp)
jmp    11b8 <compareResultD+0xa8>
movslq -0x14(%rbp),%rax
movabs $0x7ff8000000000000,%rcx
cmp    %rcx,%rax
jne    11ac <compareResultD+0x9c>
movslq -0x18(%rbp),%rax
movabs $0x7ff0000000000000,%rcx
and    %rcx,%rax
movabs $0x7ff0000000000000,%rcx
cmp    %rcx,%rax
jne    11a7 <compareResultD+0x97>
movslq -0x18(%rbp),%rax
movabs $0xfffffffffffff,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jbe    11a7 <compareResultD+0x97>
movl   $0x0,-0x4(%rbp)
jmp    11b8 <compareResultD+0xa8>
jmp    11ac <compareResultD+0x9c>
jmp    11b1 <compareResultD+0xa1>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareResultD>:
push   %rbx
mov    %edi,%ebx
call   1030 <toRep64@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @compareResultD(double %0, i32 %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
%6 = alloca i32
store double %0, double* %4
store i32 %1, i32* %5
%7 = load double, double* %4
%8 = call i32 @toRep64(double %7)
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %31
13: ; preds = %2
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = icmp eq i64 %15, 9221120237041090560
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = and i64 %19, 9218868437227405312
%21 = icmp eq i64 %20, 9218868437227405312
br i1 %21, label %22, label %28
22: ; preds = %17
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = and i64 %24, 4503599627370495
%26 = icmp ugt i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %22
store i32 0, i32* %3
br label %31
28: ; preds = %22, %17
br label %29
29: ; preds = %28, %13
br label %30
30: ; preds = %29
store i32 1, i32* %3
br label %31
31: ; preds = %30, %27, %12
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @compareResultD(double %0, i32 %1) {
%3 = tail call i32 @toRep64(double %0)
%4 = icmp ne i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ kotlinclib_print_char(char);
int /*<<< orphan*/ kotlinclib_println();
void kotlinclib_println_char(char message) {
  kotlinclib_print_char(message);
  kotlinclib_println();
}


x86 assembly (clang, -O0):
<kotlinclib_println_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <kotlinclib_print_char@plt>
mov    $0x0,%al
call   1040 <kotlinclib_println@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kotlinclib_println_char>:
push   %rax
call   1030 <kotlinclib_print_char@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <kotlinclib_println@plt>

LLVM IR (-O0):
define void @kotlinclib_println_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @kotlinclib_print_char(i8 signext %3)
%5 = call i32 (...) @kotlinclib_println()
ret void
}

LLVM IR (-O2):
define void @kotlinclib_println_char(i8 signext %0) {
%2 = tail call i32 @kotlinclib_print_char(i8 signext %0)
%3 = tail call i32 (...) @kotlinclib_println()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ex1();
int /*<<< orphan*/ ex2();
int main(void) {
  ex1();
  ex2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ex1()
%2 = tail call i32 (...) @ex2()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_foo(int);
void _mm_empty(int a) { __builtin_foo(a); }


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

x86 assembly (clang, -O2):
<_mm_empty>:
jmp    1030 <__builtin_foo@plt>

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

LLVM IR (-O2):
define void @_mm_empty(i32 %0) {
%2 = tail call i32 @__builtin_foo(i32 %0)
ret void
}
/* Variables and functions */
int DDSBigLong(int src) {
  return ((src & 0xFF000000) >> 24) | ((src & 0x00FF0000) >> 8) |
         ((src & 0x0000FF00) << 8) | ((src & 0x000000FF) << 24);
}


x86 assembly (clang, -O0):
<DDSBigLong>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @DDSBigLong(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, -16777216
%5 = lshr i32 %4, 24
%6 = load i32, i32* %2
%7 = and i32 %6, 16711680
%8 = ashr i32 %7, 8
%9 = or i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 65280
%12 = shl i32 %11, 8
%13 = or i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, 255
%16 = shl i32 %15, 24
%17 = or i32 %13, %16
ret i32 %17
}

LLVM IR (-O2):
define i32 @DDSBigLong(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int _falwcDefaultTextEscapement() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_falwcDefaultTextEscapement() {
ret i32 0
}
void g_key_file_get_locale_string_list() {}


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

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

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

LLVM IR (-O2):
define void @g_key_file_get_locale_string_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fibonacci(int num) {
  int n1 = 0, n2 = 1, i, aux;
  for (i = 0; i <= num; i++) {
    aux = n1;
    printf("%d\n", aux);
    n1 = n2;
    n2 = aux + n1;
  }
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     116e <fibonacci+0x5e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <fibonacci+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
js     114a <fibonacci+0x3a>
mov    %edi,%ebx
add    $0x1,%ebx
mov    $0x1,%r15d
xor    %ebp,%ebp
lea    0xed1(%rip),%r14
nop
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    %ebp,%eax
add    %r15d,%eax
mov    %r15d,%ebp
mov    %eax,%r15d
add    $0xffffffff,%ebx
jne    1130 <fibonacci+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @fibonacci(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %19, %1
%8 = load i32, i32* %5
%9 = load i32, i32* %2
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %3
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %4
store i32 %15, i32* %3
%16 = load i32, i32* %6
%17 = load i32, i32* %3
%18 = add nsw i32 %16, %17
store i32 %18, i32* %4
br label %19
19: ; preds = %11
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %7
22: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @fibonacci(i32 %0) {
%2 = icmp slt i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = phi i32 [ %8, %3 ], [ 1, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = add nsw i32 %4, %6
%9 = add nuw i32 %5, 1
%10 = icmp eq i32 %5, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
ret void
}
int square(volatile int *ptr) { return *ptr * *ptr; }


x86 assembly (clang, -O0):
<square>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
imul   %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<square>:
mov    (%rdi),%eax
imul   (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @square(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load volatile i32, i32* %3
%5 = load i32*, i32** %2
%6 = load volatile i32, i32* %5
%7 = mul nsw i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @square(i32* %0) {
%2 = load volatile i32, i32* %0
%3 = load volatile i32, i32* %0
%4 = mul nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
double GetFPSR36();
double getfpsr() { return GetFPSR36(); }


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

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

LLVM IR (-O0):
define double @getfpsr() {
%1 = call double (...) @GetFPSR36()
ret double %1
}

LLVM IR (-O2):
define double @getfpsr() {
%1 = tail call double (...) @GetFPSR36()
ret double %1
}
struct bst_test_list *test_mics_client_install(struct bst_test_list *tests) {
  return tests;
}


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

x86 assembly (clang, -O2):
<test_mics_client_install>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
%struct.bst_test_list = type opaque
define %struct.bst_test_list* @test_mics_client_install(%struct.bst_test_list* readnone returned %0) {
ret %struct.bst_test_list* %0
}
int fun203() { return 203; }


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

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

LLVM IR (-O0):
define i32 @fun203() {
ret i32 203
}

LLVM IR (-O2):
define i32 @fun203() {
ret i32 203
}
int foo(double x, long double y) { return __builtin_isgreater(x, y); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x10(%rbp)
movsd  %xmm0,-0x8(%rbp)
fstpt  -0x20(%rbp)
fldl   -0x8(%rbp)
fldt   -0x20(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
fldt   0x8(%rsp)
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
xor    %eax,%eax
fucomip %st(1),%st
fstp   %st(0)
seta   %al
ret

LLVM IR (-O0):
define i32 @foo(double %0, x86_fp80 %1) {
%3 = alloca double
%4 = alloca x86_fp80
store double %0, double* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load double, double* %3
%6 = fpext double %5 to x86_fp80
%7 = load x86_fp80, x86_fp80* %4
%8 = fcmp ogt x86_fp80 %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @foo(double %0, x86_fp80 %1) {
%3 = fpext double %0 to x86_fp80
%4 = fcmp ogt x86_fp80 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ xip_fpo_fixtoflt_flt_int(float *, int);
float xil_fpo_fixtoflt_flt_int(int a) {
  float res_flt;
  xip_fpo_fixtoflt_flt_int(&res_flt, a);
  return res_flt;
}


x86 assembly (clang, -O0):
<xil_fpo_fixtoflt_flt_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1030 <xip_fpo_fixtoflt_flt_int@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xil_fpo_fixtoflt_flt_int>:
push   %rax
mov    %edi,%esi
lea    0x4(%rsp),%rdi
call   1030 <xip_fpo_fixtoflt_flt_int@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @xil_fpo_fixtoflt_flt_int(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @xip_fpo_fixtoflt_flt_int(float* %3, i32 %4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @xil_fpo_fixtoflt_flt_int(i32 %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = call i32 @xip_fpo_fixtoflt_flt_int(float* %2, i32 %0)
%5 = load float, float* %2
ret float %5
}
bforwline(f, n) { return (forwline(f, n, 0)); }


x86 assembly (clang, -O0):
<bforwline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %edx,%edx
mov    $0x0,%al
call   1030 <forwline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bforwline>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <forwline@plt>

LLVM IR (-O0):
define i32 @bforwline(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 (i32, i32, i32, ...) bitcast (i32 (...)* @forwline to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @bforwline(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @forwline to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello world!\n");
  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)
lea    0xed3(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}