xunge/DecIR huggingface dataset:
int id_cmp(const void *a, const void *b) {
  const int *id1 = (const int *)a;
  const int *id2 = (const int *)b;
  if (*id1 > *id2) {
    return (1);
  }
  if (*id1 < *id2) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<id_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jle    113a <id_cmp+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115f <id_cmp+0x5f>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jge    1158 <id_cmp+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    115f <id_cmp+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_cmp>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
xor    %edx,%edx
cmp    %ecx,%eax
setl   %dl
neg    %edx
cmp    %ecx,%eax
mov    $0x1,%eax
cmovle %edx,%eax
ret

LLVM IR (-O0):
define i32 @id_cmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
store i32* %9, i32** %6
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %7
%12 = load i32*, i32** %6
%13 = load i32, i32* %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = icmp sgt i32 %13, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %26
18: ; preds = %2
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = load i32*, i32** %7
%22 = load i32, i32* %21
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 -1, i32* %3
br label %26
25: ; preds = %18
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %17
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @id_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
%8 = icmp slt i32 %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
long __ESBMC_labs(long);
long int labs(long int i) { return __ESBMC_labs(i); }


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

x86 assembly (clang, -O2):
<labs>:
jmp    1030 <__ESBMC_labs@plt>

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @__ESBMC_labs(i64 %0)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ fred(int);
int main() {
  fred(1);
  fred(2);
  fred(3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <fred@plt>
mov    $0x2,%edi
call   1030 <fred@plt>
mov    $0x3,%edi
call   1030 <fred@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <fred@plt>
mov    $0x2,%edi
call   1030 <fred@plt>
mov    $0x3,%edi
call   1030 <fred@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fred(i32 1)
%2 = tail call i32 @fred(i32 2)
%3 = tail call i32 @fred(i32 3)
ret i32 0
}
long long susu() { return 0xffff7fffffff7fffLL; }


x86 assembly (clang, -O0):
<susu>:
push   %rbp
mov    %rsp,%rbp
movabs $0xffff7fffffff7fff,%rax
7f ff ff
pop    %rbp
ret

x86 assembly (clang, -O2):
<susu>:
movabs $0xffff7fffffff7fff,%rax
7f ff ff
ret

LLVM IR (-O0):
define i64 @susu() {
ret i64 -140737488388097
}

LLVM IR (-O2):
define i64 @susu() {
ret i64 -140737488388097
}
/* Type definitions */
struct pinctrl {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
scalar_t__ IS_ERR(struct pinctrl *);
struct pinctrl *devm_pinctrl_get_select(struct device *, char *);
int /*<<< orphan*/ pr_err(char *);
void mxt540e_power_on(struct device *dev) {
  struct pinctrl *pinctrl;
  pinctrl = devm_pinctrl_get_select(dev, "tsp_on");
  if (IS_ERR(pinctrl))
    pr_err("touch pin not configured for power on\n");
}


x86 assembly (clang, -O0):
<mxt540e_power_on>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <devm_pinctrl_get_select@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <IS_ERR@plt>
cmp    $0x0,%rax
je     116f <mxt540e_power_on+0x3f>
lea    0xe9d(%rip),%rdi
call   1030 <pr_err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mxt540e_power_on>:
push   %rax
lea    0xec8(%rip),%rsi
call   1040 <devm_pinctrl_get_select@plt>
mov    %rax,%rdi
call   1050 <IS_ERR@plt>
test   %rax,%rax
je     1157 <mxt540e_power_on+0x27>
lea    0xeb6(%rip),%rdi
pop    %rax
jmp    1030 <pr_err@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.pinctrl = type { i32 }
@.str = [7 x i8] c"tsp_on\00"
@.str.1 = [39 x i8] c"touch pin not configured for power on\0A\00"
define void @mxt540e_power_on(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca %struct.pinctrl*
store %struct.device* %0, %struct.device** %2
%4 = load %struct.device*, %struct.device** %2
%5 = call %struct.pinctrl* @devm_pinctrl_get_select(%struct.device* %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store %struct.pinctrl* %5, %struct.pinctrl** %3
%6 = load %struct.pinctrl*, %struct.pinctrl** %3
%7 = call i64 @IS_ERR(%struct.pinctrl* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @pr_err(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.pinctrl = type { i32 }
@.str = [7 x i8] c"tsp_on\00"
@.str.1 = [39 x i8] c"touch pin not configured for power on\0A\00"
define void @mxt540e_power_on(%struct.device* %0) {
%2 = tail call %struct.pinctrl* @devm_pinctrl_get_select(%struct.device* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @IS_ERR(%struct.pinctrl* %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 @pr_err(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
double __ocml_sub_rte_f64(double, double);
double __dsub_rn(double x, double y) { return __ocml_sub_rte_f64(x, y); }


x86 assembly (clang, -O0):
<__dsub_rn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <__ocml_sub_rte_f64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__dsub_rn>:
jmp    1030 <__ocml_sub_rte_f64@plt>

LLVM IR (-O0):
define double @__dsub_rn(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @__ocml_sub_rte_f64(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @__dsub_rn(double %0, double %1) {
%3 = tail call double @__ocml_sub_rte_f64(double %0, double %1)
ret double %3
}
char *append_with_char(w1, w2, w3)
char *w1, *w2, w3;
{
  char *result;
  result = (char *)malloc((strlen(w1) + strlen(w2) + 2) * sizeof(char));
  sprintf(result, "%s%c%s", w1, w3, w2);
  return (result);
}


x86 assembly (clang, -O0):
<append_with_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
shl    $0x0,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rdx
movsbl -0x11(%rbp),%ecx
mov    -0x10(%rbp),%r8
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_with_char>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,%rbp
call   1030 <strlen@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
movsbl %r14b,%ecx
lea    0xe95(%rip),%rsi
mov    %rax,%rdi
mov    %rbp,%rdx
mov    %r15,%r8
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%s%c%s\00"
define i8* @append_with_char(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8*
%8 = trunc i32 %2 to i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %8, i8* %6
%9 = load i8*, i8** %4
%10 = call i64 @strlen(i8* %9)
%11 = load i8*, i8** %5
%12 = call i64 @strlen(i8* %11)
%13 = add i64 %10, %12
%14 = add i64 %13, 2
%15 = mul i64 %14, 1
%16 = call i8* @malloc(i64 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = load i8*, i8** %4
%19 = load i8, i8* %6
%20 = sext i8 %19 to i32
%21 = load i8*, i8** %5
%22 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %20, i8* %21)
%23 = load i8*, i8** %7
ret i8* %23
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s%c%s\00"
define noalias i8* @append_with_char(i8* %0, i8* %1, i32 %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%6 = add i64 %4, 2
%7 = add i64 %6, %5
%8 = tail call i8* @malloc(i64 %7)
%9 = shl i32 %2, 24
%10 = ashr exact i32 %9, 24
%11 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %10, i8* %1)
ret i8* %8
}
/* Variables and functions */
int abs(int);
int isdiag(int x, int y) { return (abs(x) + abs(y)) - 1; }


x86 assembly (clang, -O0):
<isdiag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
sub    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdiag>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
mov    %esi,%ecx
neg    %ecx
cmovs  %esi,%ecx
add    %ecx,%eax
add    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @isdiag(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 @abs(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @abs(i32 %7)
%9 = add nsw i32 %6, %8
%10 = sub nsw i32 %9, 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @isdiag(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%4 = tail call i32 @llvm.abs.i32(i32 %1, i1 true)
%5 = add nsw i32 %3, -1
%6 = add i32 %5, %4
ret i32 %6
}
int is_extendable(const int symbology) {
  switch (symbology) {
  case 13:
  case 14:
  case 34:
  case 35:
  case 37:
  case 38:
  case 69:
  case 130:
  case 135:
  case 136:
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_extendable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xfffffff3,%eax
sub    $0x2,%eax
jb     1180 <is_extendable+0x80>
jmp    111e <is_extendable+0x1e>
mov    -0xc(%rbp),%eax
add    $0xffffffde,%eax
sub    $0x2,%eax
jb     1180 <is_extendable+0x80>
jmp    1132 <is_extendable+0x32>
mov    -0xc(%rbp),%eax
add    $0xffffffdb,%eax
sub    $0x2,%eax
jb     1180 <is_extendable+0x80>
jmp    1146 <is_extendable+0x46>
mov    -0xc(%rbp),%eax
sub    $0x45,%eax
je     1180 <is_extendable+0x80>
jmp    1157 <is_extendable+0x57>
mov    -0xc(%rbp),%eax
sub    $0x82,%eax
je     1180 <is_extendable+0x80>
jmp    116a <is_extendable+0x6a>
mov    -0xc(%rbp),%eax
add    $0xffffff79,%eax
sub    $0x1,%eax
ja     118c <is_extendable+0x8c>
jmp    1180 <is_extendable+0x80>
movl   $0x1,-0x4(%rbp)
jmp    1193 <is_extendable+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_extendable>:
mov    $0x1,%eax
lea    -0xd(%rdi),%ecx
cmp    $0x38,%ecx
ja     111d <is_extendable+0x1d>
movabs $0x100000003600003,%rdx
bt     %rcx,%rdx
jb     1132 <is_extendable+0x32>
add    $0xffffff7e,%edi
cmp    $0x6,%edi
ja     1133 <is_extendable+0x33>
mov    $0x61,%ecx
bt     %edi,%ecx
jae    1133 <is_extendable+0x33>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_extendable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 13, label %5
i32 14, label %5
i32 34, label %5
i32 35, label %5
i32 37, label %5
i32 38, label %5
i32 69, label %5
i32 130, label %5
i32 135, label %5
i32 136, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_extendable(i32 %0) {
switch i32 %0, label %2 [
i32 13, label %3
i32 14, label %3
i32 34, label %3
i32 35, label %3
i32 37, label %3
i32 38, label %3
i32 69, label %3
i32 130, label %3
i32 135, label %3
i32 136, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Type definitions */
struct xhda_codec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fixup_via_mixer(struct xhda_codec *, int, int);
void fixup_vt3476(struct xhda_codec *codec) {
  fixup_via_mixer(codec, 0x3f, 0x10);
}


x86 assembly (clang, -O0):
<fixup_vt3476>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3f,%esi
mov    $0x10,%edx
call   1030 <fixup_via_mixer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixup_vt3476>:
mov    $0x3f,%esi
mov    $0x10,%edx
jmp    1030 <fixup_via_mixer@plt>

LLVM IR (-O0):
%struct.xhda_codec = type { i32 }
define void @fixup_vt3476(%struct.xhda_codec* %0) {
%2 = alloca %struct.xhda_codec*
store %struct.xhda_codec* %0, %struct.xhda_codec** %2
%3 = load %struct.xhda_codec*, %struct.xhda_codec** %2
%4 = call i32 @fixup_via_mixer(%struct.xhda_codec* %3, i32 63, i32 16)
ret void
}

LLVM IR (-O2):
%struct.xhda_codec = type { i32 }
define void @fixup_vt3476(%struct.xhda_codec* %0) {
%2 = tail call i32 @fixup_via_mixer(%struct.xhda_codec* %0, i32 63, i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Redbook2Time(unsigned int, int *, int *, int *);
int Time2HSG(int, int, int);
unsigned Redbook2HSG(unsigned redbook) {
  int Min, Sec, Fra;
  Redbook2Time(redbook, &Min, &Sec, &Fra);
  return Time2HSG(Min, Sec, Fra);
}


x86 assembly (clang, -O0):
<Redbook2HSG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1030 <Redbook2Time@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <Time2HSG@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Redbook2HSG(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @Redbook2Time(i32 %6, i32* %3, i32* %4, i32* %5)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @Time2HSG(i32 %8, i32 %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @Redbook2HSG(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 @Redbook2Time(i32 %0, i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = call i32 @Time2HSG(i32 %9, i32 %10, i32 %11)
ret i32 %12
}
double f4_cb_send_two_long(double (*cb)(long, long)) {
  long r1 = 33;
  long r2 = 33;
  return cb(r1, r2) + 1.0;
}


x86 assembly (clang, -O0):
<f4_cb_send_two_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x21,-0x10(%rbp)
movq   $0x21,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   *%rax
movsd  0xece(%rip),%xmm1
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4_cb_send_two_long>:
push   %rax
mov    %rdi,%rax
mov    $0x21,%edi
mov    $0x21,%esi
call   *%rax
addsd  0xee8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @f4_cb_send_two_long(double (i64, i64)* %0) {
%2 = alloca double (i64, i64)*
%3 = alloca i64
%4 = alloca i64
store double (i64, i64)* %0, double (i64, i64)** %2
store i64 33, i64* %3
store i64 33, i64* %4
%5 = load double (i64, i64)*, double (i64, i64)** %2
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call double %5(i64 %6, i64 %7)
%9 = fadd double %8, 1.000000e+00
ret double %9
}

LLVM IR (-O2):
define double @f4_cb_send_two_long(double (i64, i64)* nocapture %0) {
%2 = tail call double %0(i64 33, i64 33)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ newline();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("first line.\n");
  newline();
  newline();
  printf("second line. \n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1030 <newline@plt>
xor    %eax,%eax
call   1030 <newline@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@str = [12 x i8] c"first line.\00"
@str.2 = [14 x i8] c"second line. \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @newline()
%3 = tail call i32 (...) @newline()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0))
ret i32 0
}
float get(float *a, int idx) { return a[idx]; }


x86 assembly (clang, -O0):
<get>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get>:
movslq %esi,%rax
movss  (%rdi,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @get(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%5 = load float*, float** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds float, float* %5, i64 %7
%9 = load float, float* %8
ret float %9
}

LLVM IR (-O2):
define float @get(float* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds float, float* %0, i64 %3
%5 = load float, float* %4
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ render_thread(void *, int /*<<< orphan*/);
void render_thread_1(void *param) { render_thread(param, 0); }


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

x86 assembly (clang, -O2):
<render_thread_1>:
xor    %esi,%esi
jmp    1030 <render_thread@plt>

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

LLVM IR (-O2):
define void @render_thread_1(i8* %0) {
%2 = tail call i32 @render_thread(i8* %0, i32 0)
ret void
}
void OBJ_obj2txt(void) {}


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

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

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

LLVM IR (-O2):
define void @OBJ_obj2txt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ inl(int);
void inl_pmtimer(void) { inl(0xb008); }


x86 assembly (clang, -O0):
<inl_pmtimer>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb008,%edi
call   1030 <inl@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inl_pmtimer>:
mov    $0xb008,%edi
jmp    1030 <inl@plt>

LLVM IR (-O0):
define void @inl_pmtimer() {
%1 = call i32 @inl(i32 45064)
ret void
}

LLVM IR (-O2):
define void @inl_pmtimer() {
%1 = tail call i32 @inl(i32 45064)
ret void
}
char *strrchr(const char *s, int c) {
  char *r = ((void *)0);
  do
    if (*s == c)
      r = (char *)s;
  while (*s++);
  return r;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    112b <strrchr+0x2b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%rdi),%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %ecx,%ecx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %10, %3 ]
%5 = phi i8* [ null, %2 ], [ %9, %3 ]
%6 = load i8, i8* %4
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, %1
%9 = select i1 %8, i8* %4, i8* %5
%10 = getelementptr inbounds i8, i8* %4, i64 1
%11 = icmp eq i8 %6, 0
br i1 %11, label %12, label %3
12: ; preds = %3
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ linear(int);
void call_exit_unreachable(int p) {
  linear(p);
  exit(0);
}


x86 assembly (clang, -O0):
<call_exit_unreachable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <linear@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
define void @call_exit_unreachable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @linear(i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @call_exit_unreachable(i32 %0) {
%2 = tail call i32 @linear(i32 %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int getsockopt(int, int, int, void *, int *);
int silc_net_get_socket_opt(int sock, int level, int option, void *optval,
                            int *opt_len) {
  return getsockopt(sock, level, option, optval, opt_len);
}


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

x86 assembly (clang, -O2):
<silc_net_get_socket_opt>:
jmp    1030 <getsockopt@plt>

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

LLVM IR (-O2):
define i32 @silc_net_get_socket_opt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4) {
%6 = tail call i32 @getsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32* %4)
ret i32 %6
}
void update(int *p) { *p = 8; }


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

x86 assembly (clang, -O2):
<update>:
movl   $0x8,(%rdi)
ret

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

LLVM IR (-O2):
define void @update(i32* nocapture writeonly %0) {
store i32 8, i32* %0
ret void
}
/* Variables and functions */
int set_animations(int /*<<< orphan*/);
int /*<<< orphan*/ systemlog(int, char *);
int put_default_animations() {
  int success = 0;
  systemlog(3, "put_default_animations");
  success = set_animations(0);
  if (success)
    systemlog(93, "\t[DONE]");
  else
    systemlog(93, "\t[FAILD]");
  return success;
}


x86 assembly (clang, -O0):
<put_default_animations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
lea    0xec5(%rip),%rsi
call   1030 <systemlog@plt>
xor    %edi,%edi
call   1040 <set_animations@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     116a <put_default_animations+0x4a>
mov    $0x5d,%edi
lea    0xeb7(%rip),%rsi
call   1030 <systemlog@plt>
jmp    117b <put_default_animations+0x5b>
mov    $0x5d,%edi
lea    0xea9(%rip),%rsi
call   1030 <systemlog@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_default_animations>:
push   %rbx
lea    0xed8(%rip),%rsi
mov    $0x3,%edi
call   1030 <systemlog@plt>
xor    %edi,%edi
call   1040 <set_animations@plt>
mov    %eax,%ebx
test   %eax,%eax
lea    0xedb(%rip),%rax
lea    0xecc(%rip),%rsi
cmove  %rax,%rsi
mov    $0x5d,%edi
call   1030 <systemlog@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"put_default_animations\00"
@.str.1 = [8 x i8] c"\09[DONE]\00"
@.str.2 = [9 x i8] c"\09[FAILD]\00"
define i32 @put_default_animations() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @systemlog(i32 3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @set_animations(i32 0)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @systemlog(i32 93, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @systemlog(i32 93, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"put_default_animations\00"
@.str.1 = [8 x i8] c"\09[DONE]\00"
@.str.2 = [9 x i8] c"\09[FAILD]\00"
define i32 @put_default_animations() {
%1 = tail call i32 @systemlog(i32 3, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @set_animations(i32 0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @systemlog(i32 93, i8* %4)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ solv_oom(size_t, size_t);
void *solv_realloc(void *, size_t);
void *solv_realloc2(void *old, size_t num, size_t len) {
  if (len && (num * len) / len != num)
    solv_oom(num, len);
  return solv_realloc(old, num * len);
}


x86 assembly (clang, -O0):
<solv_realloc2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1167 <solv_realloc2+0x47>
mov    -0x10(%rbp),%rax
imul   -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
cmp    -0x10(%rbp),%rax
je     1167 <solv_realloc2+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <solv_oom@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
imul   -0x18(%rbp),%rsi
call   1040 <solv_realloc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solv_realloc2>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
test   %rdx,%rdx
je     1146 <solv_realloc2+0x26>
mov    %rbx,%rax
mul    %r15
jno    1146 <solv_realloc2+0x26>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <solv_oom@plt>
imul   %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <solv_realloc@plt>

LLVM IR (-O0):
define i8* @solv_realloc2(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %3
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = mul i64 %10, %11
%13 = load i64, i64* %6
%14 = udiv i64 %12, %13
%15 = load i64, i64* %5
%16 = icmp ne i64 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %9
%18 = load i64, i64* %5
%19 = load i64, i64* %6
%20 = call i32 @solv_oom(i64 %18, i64 %19)
br label %21
21: ; preds = %17, %9, %3
%22 = load i8*, i8** %4
%23 = load i64, i64* %5
%24 = load i64, i64* %6
%25 = mul i64 %23, %24
%26 = call i8* @solv_realloc(i8* %22, i64 %25)
ret i8* %26
}

LLVM IR (-O2):
define i8* @solv_realloc2(i8* %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %2, i64 %1)
%7 = extractvalue { i64, i1 } %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @solv_oom(i64 %1, i64 %2)
br label %10
10: ; preds = %8, %5, %3
%11 = mul i64 %2, %1
%12 = tail call i8* @solv_realloc(i8* %0, i64 %11)
ret i8* %12
}
/* Type definitions */
typedef int /*<<< orphan*/ posix_spawn_file_actions_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int posix_spawn_file_actions_init(posix_spawn_file_actions_t *file_actions) {
  ;
  errno = ENOSYS;
  return -1;
  ;
}


x86 assembly (clang, -O0):
<posix_spawn_file_actions_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec0(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<posix_spawn_file_actions_init>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawn_file_actions_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @posix_spawn_file_actions_init(i32* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret i32 -1
}
void g_ascii_strtoull() {}


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

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

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

LLVM IR (-O2):
define void @g_ascii_strtoull() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TxPIDSettingsHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void TxPIDSettingsLogging() { UAVObjLogging(TxPIDSettingsHandle()); }


x86 assembly (clang, -O0):
<TxPIDSettingsLogging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <TxPIDSettingsHandle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TxPIDSettingsLogging>:
push   %rax
xor    %eax,%eax
call   1040 <TxPIDSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @TxPIDSettingsLogging() {
%1 = call i32 (...) @TxPIDSettingsHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @TxPIDSettingsLogging() {
%1 = tail call i32 (...) @TxPIDSettingsHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ clrtoeol();
int /*<<< orphan*/ display();
int /*<<< orphan*/ dobeep();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ mvaddstr(scalar_t__, int /*<<< orphan*/, char const *);
int /*<<< orphan*/ refresh();
void warning(const char *p) {
  mvaddstr(LINES - 1, 0, p);
  clrtoeol();
  refresh();
  dobeep();
  getch();
  display();
}


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e75(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1080 <mvaddstr@plt>
mov    $0x0,%al
call   1070 <clrtoeol@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1040 <dobeep@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1030 <display@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
push   %rax
mov    %rdi,%rdx
mov    0x2e7d(%rip),%rax
mov    (%rax),%rdi
add    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1080 <mvaddstr@plt>
xor    %eax,%eax
call   1070 <clrtoeol@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1040 <dobeep@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <display@plt>

LLVM IR (-O0):
@LINES = global i64 0
define void @warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @LINES
%4 = sub nsw i64 %3, 1
%5 = load i8*, i8** %2
%6 = call i32 @mvaddstr(i64 %4, i32 0, i8* %5)
%7 = call i32 (...) @clrtoeol()
%8 = call i32 (...) @refresh()
%9 = call i32 (...) @dobeep()
%10 = call i32 (...) @getch()
%11 = call i32 (...) @display()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
define void @warning(i8* %0) {
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -1
%4 = tail call i32 @mvaddstr(i64 %3, i32 0, i8* %0)
%5 = tail call i32 (...) @clrtoeol()
%6 = tail call i32 (...) @refresh()
%7 = tail call i32 (...) @dobeep()
%8 = tail call i32 (...) @getch()
%9 = tail call i32 (...) @display()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ip_get_flag_df(const uint8_t *p_ip) { return (p_ip[6] & 0x40); }


x86 assembly (clang, -O0):
<ip_get_flag_df>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x40,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_flag_df>:
mov    0x18(%rdi),%eax
and    $0x40,%eax
ret

LLVM IR (-O0):
define i32 @ip_get_flag_df(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 64
ret i32 %6
}

LLVM IR (-O2):
define i32 @ip_get_flag_df(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = and i32 %3, 64
ret i32 %4
}
/* Variables and functions */
scalar_t__ isprint(unsigned char);
bool minmea_isfield(char c) {
  return isprint((unsigned char)c) && c != ',' && c != '*';
}


x86 assembly (clang, -O0):
<minmea_isfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <isprint@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     1158 <minmea_isfield+0x48>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x2c,%ecx
mov    %al,-0x2(%rbp)
je     1158 <minmea_isfield+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x2a,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<minmea_isfield>:
push   %rbx
movzbl %dil,%ebx
mov    %ebx,%edi
call   1030 <isprint@plt>
test   %rax,%rax
setne  %al
cmp    $0x2c,%bl
setne  %cl
cmp    $0x2a,%bl
setne  %dl
and    %cl,%dl
and    %al,%dl
movzbl %dl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @minmea_isfield(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isprint(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 44
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp ne i32 %12, 42
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ false, %6 ], [ false, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @minmea_isfield(i8 signext %0) {
%2 = tail call i64 @isprint(i8 zeroext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i8 %0, 44
%5 = and i1 %4, %3
%6 = icmp ne i8 %0, 42
%7 = and i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void *print_xs(void *unesed) {
  while (1)
    fputc('x', stderr);
  return NULL;
}


x86 assembly (clang, -O0):
<print_xs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
mov    $0x78,%edi
call   1030 <fputc@plt>
jmp    111c <print_xs+0xc>

x86 assembly (clang, -O2):
<print_xs>:
push   %rbx
mov    0x2ec8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%esi
mov    $0x78,%edi
call   1030 <fputc@plt>
jmp    1120 <print_xs+0x10>

LLVM IR (-O0):
@stderr = global i32 0
define i8* @print_xs(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %1, %3
%4 = load i32, i32* @stderr
%5 = call i32 @fputc(i8 signext 120, i32 %4)
br label %3
}

LLVM IR (-O2):
@stderr = global i32 0
define noalias i8* @print_xs(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %2
%3 = load i32, i32* @stderr
%4 = tail call i32 @fputc(i8 signext 120, i32 %3)
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ roadmap_help_show(char *);
void roadmap_help_key(void) { roadmap_help_show("key"); }


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"key\00"
define void @roadmap_help_key() {
%1 = call i32 @roadmap_help_show(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"key\00"
define void @roadmap_help_key() {
%1 = tail call i32 @roadmap_help_show(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int ch = 'A';
  printf("%c-%d\n", ch, ch);
  return 1;
}


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"%c-%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 65, i32 65)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Msp430GpioC__13__GeneralIO__set();
void SensirionSht11LogicP__0__CLOCK__set(void) {
  Msp430GpioC__13__GeneralIO__set();
}


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

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

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

LLVM IR (-O2):
define void @SensirionSht11LogicP__0__CLOCK__set() {
%1 = tail call i32 (...) @Msp430GpioC__13__GeneralIO__set()
ret void
}
/* Variables and functions */
scalar_t__ __random();
int rand() { return (int)__random(); }


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

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

LLVM IR (-O0):
define i32 @rand() {
%1 = call i64 (...) @__random()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @rand() {
%1 = tail call i64 (...) @__random()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _daemon_init();
int /*<<< orphan*/ _init_env();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ listen_connect();
int read_configure();
int main(void) {
  if (read_configure() == -1) {
    exit(1);
  }
  _daemon_init();
  _init_env();
  listen_connect();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <read_configure@plt>
cmp    $0xffffffff,%eax
jne    1179 <main+0x29>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    $0x0,%al
call   1050 <_daemon_init@plt>
mov    $0x0,%al
call   1030 <_init_env@plt>
mov    $0x0,%al
call   1070 <listen_connect@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <read_configure@plt>
cmp    $0xffffffff,%eax
je     1176 <main+0x26>
xor    %eax,%eax
call   1050 <_daemon_init@plt>
xor    %eax,%eax
call   1030 <_init_env@plt>
xor    %eax,%eax
call   1070 <listen_connect@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @read_configure()
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = call i32 (...) @_daemon_init()
%8 = call i32 (...) @_init_env()
%9 = call i32 (...) @listen_connect()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @read_configure()
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 1)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @_daemon_init()
%7 = tail call i32 (...) @_init_env()
%8 = tail call i32 (...) @listen_connect()
ret i32 0
}
/* Type definitions */
union bpf_attr {
  int map_fd;
  int /*<<< orphan*/ value;
  int /*<<< orphan*/ key;
};
typedef int /*<<< orphan*/ attr;

/* Variables and functions */
int /*<<< orphan*/ BPF_MAP_LOOKUP_ELEM;
int /*<<< orphan*/ __NR_bpf;
int /*<<< orphan*/ bpf_ptr_to_u64(void *);
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, union bpf_attr *, int);
int bpf_lookup_elem(int fd, void *key, void *value) {
  union bpf_attr attr = {
      .map_fd = fd,
      .key = bpf_ptr_to_u64(key),
      .value = bpf_ptr_to_u64(value),
  };
  return syscall(__NR_bpf, BPF_MAP_LOOKUP_ELEM, &attr, sizeof(attr));
}


x86 assembly (clang, -O0):
<bpf_lookup_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <bpf_ptr_to_u64@plt>
mov    %eax,-0x20(%rbp)
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
lea    -0x20(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_lookup_elem>:
push   %rax
mov    %rdx,%rdi
call   1040 <bpf_ptr_to_u64@plt>
mov    %eax,(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
mov    $0x4,%ecx
call   1030 <syscall@plt>
pop    %rcx
ret

LLVM IR (-O0):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_lookup_elem(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %union.bpf_attr
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast %union.bpf_attr* %7 to i32*
%9 = load i8*, i8** %6
%10 = call i32 @bpf_ptr_to_u64(i8* %9)
store i32 %10, i32* %8
%11 = load i32, i32* @__NR_bpf
%12 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%13 = call i32 @syscall(i32 %11, i32 %12, %union.bpf_attr* %7, i32 4)
ret i32 %13
}

LLVM IR (-O2):
%union.bpf_attr = type { i32 }
@__NR_bpf = global i32 0
@BPF_MAP_LOOKUP_ELEM = global i32 0
define i32 @bpf_lookup_elem(i32 %0, i8* nocapture readnone %1, i8* %2) {
%4 = alloca %union.bpf_attr
%5 = bitcast %union.bpf_attr* %4 to i8*
%6 = getelementptr inbounds %union.bpf_attr, %union.bpf_attr* %4, i64 0, i32 0
%7 = tail call i32 @bpf_ptr_to_u64(i8* %2)
store i32 %7, i32* %6
%8 = load i32, i32* @__NR_bpf
%9 = load i32, i32* @BPF_MAP_LOOKUP_ELEM
%10 = call i32 @syscall(i32 %8, i32 %9, %union.bpf_attr* %4, i32 4)
ret i32 %10
}
unsigned int min(unsigned int a, unsigned int b) {
  if (a < b) {
    return a;
  }
  return b;
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1121 <min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void foo2(signed short a) {}


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

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

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

LLVM IR (-O2):
define void @foo2(i16 signext %0) {
ret void
}