xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ttime_2();
int main() {
  ttime_2();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ttime_2()
ret i32 0
}
void Error_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<Error_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Error_Handler+0x9>
jmp    1109 <Error_Handler+0x9>

x86 assembly (clang, -O2):
<Error_Handler>:
jmp    1100 <Error_Handler>

LLVM IR (-O0):
define void @Error_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Error_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int is_same_group(struct task_struct *curr, struct task_struct *p) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i32 @is_same_group(%struct.task_struct* nocapture readnone %0, %struct.task_struct* nocapture readnone %1) {
ret i32 1
}
double dgt(x, y)
double x, y;
{ return ((double)(x > y)); }


x86 assembly (clang, -O0):
<dgt>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgt>:
cmpltsd %xmm0,%xmm1
movsd  0xef3(%rip),%xmm0
andpd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dgt(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 = fcmp ogt double %5, %6
%8 = zext i1 %7 to i32
%9 = sitofp i32 %8 to double
ret double %9
}

LLVM IR (-O2):
define double @dgt(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = uitofp i1 %3 to double
ret double %4
}
void gpio_mlb_inactive(void) {}


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

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

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

LLVM IR (-O2):
define void @gpio_mlb_inactive() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M911_f(char *s) {
  debug("M911_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M911_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M911_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M911_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M911_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M911_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M911_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ add(int, int);
int /*<<< orphan*/ mul(int, int);
int /*<<< orphan*/ sub(int, int);
void triple(int a, int b) {
  add(a, b);
  sub(a, b);
  mul(a, b);
}


x86 assembly (clang, -O0):
<triple>:
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 <add@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <sub@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <mul@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triple>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <add@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <sub@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <mul@plt>

LLVM IR (-O0):
define void @triple(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 @add(i32 %5, i32 %6)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @sub(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = call i32 @mul(i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @triple(i32 %0, i32 %1) {
%3 = tail call i32 @add(i32 %0, i32 %1)
%4 = tail call i32 @sub(i32 %0, i32 %1)
%5 = tail call i32 @mul(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *, int *);
int main() {
  int a, b, c, d;
  scanf("%d%d%d%d", &a, &b, &c, &d);
  printf("The second largest number is %d", b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <scanf@plt>
mov    -0xc(%rbp),%esi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
call   1040 <scanf@plt>
mov    0x8(%rsp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [32 x i8] c"The second largest number is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4, i32* %5)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d%d%d%d\00"
@.str.1 = [32 x i8] c"The second largest number is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t callC() { return 42; }


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

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

LLVM IR (-O0):
define i32 @callC() {
ret i32 42
}

LLVM IR (-O2):
define i32 @callC() {
ret i32 42
}
int foo(void) {
  int x, c, y;
  x = 3;
  if (c)
    x = 2;
  y = x + 1;
  return y;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x3,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111c <foo+0x1c>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 4
}
/* Variables and functions */
bool string_has_char(char str[], char c) {
  for (int i = 0; str[i] != '\0'; ++i) {
    if (str[i] == c) {
      return true;
    }
  }
  return false;
}


x86 assembly (clang, -O0):
<string_has_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1161 <string_has_char+0x61>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <string_has_char+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1168 <string_has_char+0x68>
jmp    1153 <string_has_char+0x53>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <string_has_char+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_has_char>:
movzbl (%rdi),%ecx
test   %cl,%cl
je     1110 <string_has_char+0x10>
add    $0x1,%rdi
cmp    %sil,%cl
jne    1100 <string_has_char>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

LLVM IR (-O0):
define i32 @string_has_char(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i32 0, i32* %6
br label %7
7: ; preds = %27, %2
%8 = load i8*, i8** %4
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %30
15: ; preds = %7
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = load i8, i8* %5
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %21, %23
br i1 %24, label %25, label %26
25: ; preds = %15
store i32 1, i32* %3
br label %31
26: ; preds = %15
br label %27
27: ; preds = %26
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
br label %7
30: ; preds = %7
store i32 0, i32* %3
br label %31
31: ; preds = %30, %25
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
define i32 @string_has_char(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %10, %3 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = icmp eq i8 %6, %1
%9 = or i1 %7, %8
%10 = add nuw i64 %4, 1
br i1 %9, label %11, label %3
11: ; preds = %3
%12 = xor i1 %7, true
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ traceprint(char *);
int yxue_handler(int exce_num) {
  traceprint("We are handling the exception\n");
  return 0;
}


x86 assembly (clang, -O0):
<yxue_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <traceprint@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yxue_handler>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <traceprint@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"We are handling the exception\0A\00"
define i32 @yxue_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @traceprint(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"We are handling the exception\0A\00"
define i32 @yxue_handler(i32 %0) {
%2 = tail call i32 @traceprint(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void xnet_shutdown(void) {}


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

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

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

LLVM IR (-O2):
define void @xnet_shutdown() {
ret void
}
void msDelay(int len) {}


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

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

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

LLVM IR (-O2):
define void @msDelay(i32 %0) {
ret void
}
/* Variables and functions */
char *process_string(char const *, size_t);
int /*<<< orphan*/ skip_quotes(char const **);
char *get_quoted_string(const char **string) {
  const char *string_start = *string;
  size_t string_len = 0;
  skip_quotes(string);
  string_len = *string - string_start - 2;
  return process_string(string_start + 1, string_len);
}


x86 assembly (clang, -O0):
<get_quoted_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <skip_quotes@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
sub    $0x2,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    -0x18(%rbp),%rsi
call   1030 <process_string@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_quoted_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
call   1040 <skip_quotes@plt>
mov    (%r14),%rsi
sub    %rbx,%rsi
add    $0xfffffffffffffffe,%rsi
add    $0x1,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <process_string@plt>

LLVM IR (-O0):
define i8* @get_quoted_string(i8** %0) {
%2 = alloca i8**
%3 = alloca i8*
%4 = alloca i64
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
store i8* %6, i8** %3
store i64 0, i64* %4
%7 = load i8**, i8*** %2
%8 = call i32 @skip_quotes(i8** %7)
%9 = load i8**, i8*** %2
%10 = load i8*, i8** %9
%11 = load i8*, i8** %3
%12 = ptrtoint i8* %10 to i64
%13 = ptrtoint i8* %11 to i64
%14 = sub i64 %12, %13
%15 = sub nsw i64 %14, 2
store i64 %15, i64* %4
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i64, i64* %4
%19 = call i8* @process_string(i8* %17, i64 %18)
ret i8* %19
}

LLVM IR (-O2):
define i8* @get_quoted_string(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @skip_quotes(i8** %0)
%4 = load i8*, i8** %0
%5 = ptrtoint i8* %4 to i64
%6 = ptrtoint i8* %2 to i64
%7 = sub i64 -2, %6
%8 = add i64 %7, %5
%9 = getelementptr inbounds i8, i8* %2, i64 1
%10 = tail call i8* @process_string(i8* %9, i64 %8)
ret i8* %10
}
/* Variables and functions */
char *get_variable(char *);
scalar_t__ strcmp(char *, char *);
int lookup_bool_variable(char *var) {
  char *p;
  if ((p = get_variable(var)) != NULL)
    return strcmp(p, "nil") != 0;
  return 0;
}


x86 assembly (clang, -O0):
<lookup_bool_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <get_variable@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     1167 <lookup_bool_variable+0x47>
mov    -0x18(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    116e <lookup_bool_variable+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookup_bool_variable>:
push   %rax
call   1040 <get_variable@plt>
test   %rax,%rax
je     1147 <lookup_bool_variable+0x27>
lea    0xece(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"nil\00"
define i32 @lookup_bool_variable(i8* %0) {
%2 = tail call i8* @get_variable(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Variables and functions */
bool nrf53_errata_43(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf53_errata_43() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __get_cpuid(int, unsigned int *, unsigned int *,
                               unsigned int *, unsigned int *);
unsigned int __attribute__((no)) i386_cpuid(void) {
  unsigned int eax, ebx, ecx, edx;
  if (!__get_cpuid(1, &eax, &ebx, &ecx, &edx))
    return 0;
  return edx;
}


x86 assembly (clang, -O0):
<i386_cpuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1030 <__get_cpuid@plt>
cmp    $0x0,%eax
jne    1147 <i386_cpuid+0x37>
movl   $0x0,-0x4(%rbp)
jmp    114d <i386_cpuid+0x3d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i386_cpuid>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x1,%edi
call   1030 <__get_cpuid@plt>
test   %eax,%eax
je     113a <i386_cpuid+0x2a>
mov    0x8(%rsp),%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define i32 @i386_cpuid() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @__get_cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = icmp eq i32 %9, 0
%11 = load i32, i32* %4
%12 = select i1 %10, i32 0, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ strcmp(char *, char *);
int parse_protocol(char *line) {
  if (!strcmp(line, "tcp"))
    return 1;
  if (!strcmp(line, "udp"))
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<parse_protocol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1141 <parse_protocol+0x31>
movl   $0x1,-0x4(%rbp)
jmp    116d <parse_protocol+0x5d>
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1166 <parse_protocol+0x56>
movl   $0x2,-0x4(%rbp)
jmp    116d <parse_protocol+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_protocol>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1140 <parse_protocol+0x30>
lea    0xed9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
add    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"tcp\00"
@.str.1 = [4 x i8] c"udp\00"
define i32 @parse_protocol(i8* nocapture %0) {
%2 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
%7 = select i1 %6, i32 2, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
int edge_val(int perm, int ori) { return perm * 2 + ori; }


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

x86 assembly (clang, -O2):
<edge_val>:
lea    (%rsi,%rdi,2),%eax
ret

LLVM IR (-O0):
define i32 @edge_val(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 = mul nsw i32 %5, 2
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @edge_val(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 1
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ power2(int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char const *argv[]) {
  int number, pow;
  scanf("%d %d", &number, &pow);
  power2(number, pow);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
call   1030 <power2@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @power2(i32 %8, i32 %9)
ret i32 0
}
void my_task_opencl(long foo, char *bar) {}


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

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

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

LLVM IR (-O2):
define void @my_task_opencl(i64 %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  float fahrenheit, celsius;
  int lower, upper, step;
  lower = 0;
  upper = 300;
  step = 20;
  printf("Celsius - Fahrenheit Table\n\n");
  while (fahrenheit <= upper) {
    celsius = (5.0 / 9.0) * (fahrenheit - 32.0);
    printf("%6.1f\t%8.0f\n", celsius, fahrenheit);
    fahrenheit += step;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x12c,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11b3 <main+0xa3>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xea2(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xe8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe95(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
cvtsi2ssl -0x18(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1142 <main+0x32>
mov    -0x4(%rbp),%eax
add    $0x20,%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 = [29 x i8] c"Celsius - Fahrenheit Table\0A\0A\00"
@.str.1 = [13 x i8] c"%6.1f\09%8.0f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 300, i32* %5
store i32 20, i32* %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %13, %0
%9 = load float, float* %2
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fcmp ole float %9, %11
br i1 %12, label %13, label %28
13: ; preds = %8
%14 = load float, float* %2
%15 = fpext float %14 to double
%16 = fsub double %15, 3.200000e+01
%17 = fmul double 0x3FE1C71C71C71C72, %16
%18 = fptrunc double %17 to float
store float %18, float* %3
%19 = load float, float* %3
%20 = fpext float %19 to double
%21 = load float, float* %2
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), double %20, double %22)
%24 = load i32, i32* %6
%25 = sitofp i32 %24 to float
%26 = load float, float* %2
%27 = fadd float %26, %25
store float %27, float* %2
br label %8
28: ; preds = %8
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@str = [28 x i8] c"Celsius - Fahrenheit Table\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct genlist {
  int dummy;
};
struct fileinfo_list_link {
  int dummy;
};
struct fileinfo_list {
  int dummy;
};
struct fileinfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_insert_before(struct genlist *, struct fileinfo *,
                                         struct genlist_link *);
void fileinfo_list_insert_before(struct fileinfo_list *tthis,
                                 struct fileinfo *pfoo,
                                 struct fileinfo_list_link *plink) {
  genlist_insert_before((struct genlist *)tthis, pfoo,
                        (struct genlist_link *)plink);
}


x86 assembly (clang, -O0):
<fileinfo_list_insert_before>:
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 <genlist_insert_before@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileinfo_list_insert_before>:
jmp    1030 <genlist_insert_before@plt>

LLVM IR (-O0):
%struct.fileinfo_list = type { i32 }
%struct.fileinfo = type { i32 }
%struct.fileinfo_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @fileinfo_list_insert_before(%struct.fileinfo_list* %0, %struct.fileinfo* %1, %struct.fileinfo_list_link* %2) {
%4 = alloca %struct.fileinfo_list*
%5 = alloca %struct.fileinfo*
%6 = alloca %struct.fileinfo_list_link*
store %struct.fileinfo_list* %0, %struct.fileinfo_list** %4
store %struct.fileinfo* %1, %struct.fileinfo** %5
store %struct.fileinfo_list_link* %2, %struct.fileinfo_list_link** %6
%7 = load %struct.fileinfo_list*, %struct.fileinfo_list** %4
%8 = bitcast %struct.fileinfo_list* %7 to %struct.genlist*
%9 = load %struct.fileinfo*, %struct.fileinfo** %5
%10 = load %struct.fileinfo_list_link*, %struct.fileinfo_list_link** %6
%11 = bitcast %struct.fileinfo_list_link* %10 to %struct.genlist_link*
%12 = call i32 @genlist_insert_before(%struct.genlist* %8, %struct.fileinfo* %9, %struct.genlist_link* %11)
ret void
}

LLVM IR (-O2):
%struct.fileinfo_list = type { i32 }
%struct.fileinfo = type { i32 }
%struct.fileinfo_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @fileinfo_list_insert_before(%struct.fileinfo_list* %0, %struct.fileinfo* %1, %struct.fileinfo_list_link* %2) {
%4 = bitcast %struct.fileinfo_list* %0 to %struct.genlist*
%5 = bitcast %struct.fileinfo_list_link* %2 to %struct.genlist_link*
%6 = tail call i32 @genlist_insert_before(%struct.genlist* %4, %struct.fileinfo* %1, %struct.genlist_link* %5)
ret void
}
/* Variables and functions */
bool opt_report_calculated_checksum(int options) { return (options & 2) != 0; }


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

x86 assembly (clang, -O2):
<opt_report_calculated_checksum>:
mov    %edi,%eax
shr    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @opt_report_calculated_checksum(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ fpos_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fgetpos(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void uninitvar_fgetpos(void) {
  FILE *stream;
  fpos_t *ptr;
  (void)fgetpos(stream, ptr);
}


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

x86 assembly (clang, -O2):
<uninitvar_fgetpos>:
jmp    1030 <fgetpos@plt>

LLVM IR (-O0):
define void @uninitvar_fgetpos() {
%1 = alloca i32*
%2 = alloca i32*
%3 = load i32*, i32** %1
%4 = load i32*, i32** %2
%5 = call i32 @fgetpos(i32* %3, i32* %4)
ret void
}

LLVM IR (-O2):
define void @uninitvar_fgetpos() {
%1 = tail call i32 @fgetpos(i32* undef, i32* undef)
ret void
}
/* Variables and functions */
int embed_dobldobl_system(int);
int embed_quaddobl_system(int);
int embed_standard_system(int);
int embed_system(int d, int precision) {
  int fail;
  if (precision == 0)
    fail = embed_standard_system(d);
  if (precision == 1)
    fail = embed_dobldobl_system(d);
  if (precision == 2)
    fail = embed_quaddobl_system(d);
  return fail;
}


x86 assembly (clang, -O0):
<embed_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1153 <embed_system+0x23>
mov    -0x4(%rbp),%edi
call   1050 <embed_standard_system@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1168 <embed_system+0x38>
mov    -0x4(%rbp),%edi
call   1030 <embed_dobldobl_system@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    117d <embed_system+0x4d>
mov    -0x4(%rbp),%edi
call   1040 <embed_quaddobl_system@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<embed_system>:
cmp    $0x2,%esi
je     1143 <embed_system+0x13>
cmp    $0x1,%esi
je     1148 <embed_system+0x18>
test   %esi,%esi
jne    114d <embed_system+0x1d>
jmp    1050 <embed_standard_system@plt>
jmp    1040 <embed_quaddobl_system@plt>
jmp    1030 <embed_dobldobl_system@plt>
ret

LLVM IR (-O0):
define i32 @embed_system(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %3
%10 = call i32 @embed_standard_system(i32 %9)
store i32 %10, i32* %5
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %3
%16 = call i32 @embed_dobldobl_system(i32 %15)
store i32 %16, i32* %5
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %23
20: ; preds = %17
%21 = load i32, i32* %3
%22 = call i32 @embed_quaddobl_system(i32 %21)
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %17
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @embed_system(i32 %0, i32 %1) {
switch i32 %1, label %9 [
i32 0, label %3
i32 1, label %5
i32 2, label %7
]
3: ; preds = %2
%4 = tail call i32 @embed_standard_system(i32 %0)
br label %9
5: ; preds = %2
%6 = tail call i32 @embed_dobldobl_system(i32 %0)
br label %9
7: ; preds = %2
%8 = tail call i32 @embed_quaddobl_system(i32 %0)
br label %9
9: ; preds = %2, %5, %3, %7
%10 = phi i32 [ %8, %7 ], [ %4, %3 ], [ %6, %5 ], [ undef, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_xaml_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("xaml", " <!--comment-->"),
                            "comment", "<!--comment-->");
}


x86 assembly (clang, -O0):
<test_xaml_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xed5(%rip),%rsi
lea    0xebf(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_xaml_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xeda(%rip),%rsi
lea    0xec4(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"xaml\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xaml_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"xaml\00"
@.str.1 = [16 x i8] c" <!--comment-->\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [15 x i8] c"<!--comment-->\00"
define void @test_xaml_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int write(int, char *, int);
void wr(int fd, char *buf, int size) {
  if (write(fd, buf, size) != size)
    error("write");
}


x86 assembly (clang, -O0):
<wr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
cmp    -0x14(%rbp),%eax
je     1156 <wr+0x36>
lea    0xeaf(%rip),%rdi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wr>:
push   %rbx
mov    %edx,%ebx
call   1030 <write@plt>
cmp    %ebx,%eax
jne    112e <wr+0xe>
pop    %rbx
ret
lea    0xecb(%rip),%rdi
pop    %rbx
jmp    1040 <error@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"write\00"
define void @wr(i32 %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%5 = icmp eq i32 %4, %2
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SPI1_EnableRxInt();
int /*<<< orphan*/ SPI1_EnableTxInt();
void SPI1_EnableInt(void) {
  SPI1_EnableRxInt();
  SPI1_EnableTxInt();
}


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

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

LLVM IR (-O0):
define void @SPI1_EnableInt() {
%1 = call i32 (...) @SPI1_EnableRxInt()
%2 = call i32 (...) @SPI1_EnableTxInt()
ret void
}

LLVM IR (-O2):
define void @SPI1_EnableInt() {
%1 = tail call i32 (...) @SPI1_EnableRxInt()
%2 = tail call i32 (...) @SPI1_EnableTxInt()
ret void
}
void SSMR3GetGCPtr(void) {}


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

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

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

LLVM IR (-O2):
define void @SSMR3GetGCPtr() {
ret void
}
void rfft1pt(float *ioptr) {
  float f0r, f0i;
  float t0r, t0i;
  f0r = ioptr[0];
  f0i = ioptr[1];
  t0r = f0r + f0i;
  t0i = f0r - f0i;
  ioptr[0] = t0r;
  ioptr[1] = t0i;
}


x86 assembly (clang, -O0):
<rfft1pt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfft1pt>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm1,%xmm0
movss  %xmm2,(%rdi)
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @rfft1pt(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float* %0, float** %2
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
store float %9, float* %3
%10 = load float*, float** %2
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
store float %12, float* %4
%13 = load float, float* %3
%14 = load float, float* %4
%15 = fadd float %13, %14
store float %15, float* %5
%16 = load float, float* %3
%17 = load float, float* %4
%18 = fsub float %16, %17
store float %18, float* %6
%19 = load float, float* %5
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 0
store float %19, float* %21
%22 = load float, float* %6
%23 = load float*, float** %2
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
ret void
}

LLVM IR (-O2):
define void @rfft1pt(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fadd float %2, %4
%6 = fsub float %2, %4
store float %5, float* %0
store float %6, float* %3
ret void
}
int evt_trigger() {}


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

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

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

LLVM IR (-O2):
define i32 @evt_trigger() {
ret i32 undef
}
unsigned short clamp(short s) {
  if (s < 0)
    return 118 + s;
  if (s > 117)
    return s - 118;
  return s;
}


x86 assembly (clang, -O0):
<clamp>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x0,%eax
jge    1128 <clamp+0x28>
movswl -0x4(%rbp),%eax
add    $0x76,%eax
mov    %ax,-0x2(%rbp)
jmp    114d <clamp+0x4d>
movswl -0x4(%rbp),%eax
cmp    $0x75,%eax
jle    1145 <clamp+0x45>
movswl -0x4(%rbp),%eax
sub    $0x76,%eax
mov    %ax,-0x2(%rbp)
jmp    114d <clamp+0x4d>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clamp>:
lea    -0x76(%rdi),%eax
cmp    $0x76,%di
cmovl  %edi,%eax
lea    0x76(%rdi),%ecx
test   %di,%di
cmovs  %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i16 @clamp(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i16, i16* %3
%9 = sext i16 %8 to i32
%10 = add nsw i32 118, %9
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
br label %23
12: ; preds = %1
%13 = load i16, i16* %3
%14 = sext i16 %13 to i32
%15 = icmp sgt i32 %14, 117
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i16, i16* %3
%18 = sext i16 %17 to i32
%19 = sub nsw i32 %18, 118
%20 = trunc i32 %19 to i16
store i16 %20, i16* %2
br label %23
21: ; preds = %12
%22 = load i16, i16* %3
store i16 %22, i16* %2
br label %23
23: ; preds = %21, %16, %7
%24 = load i16, i16* %2
ret i16 %24
}

LLVM IR (-O2):
define zeroext i16 @clamp(i16 signext %0) {
%2 = icmp slt i16 %0, 0
%3 = add i16 %0, 118
%4 = icmp sgt i16 %0, 117
%5 = add i16 %0, -118
%6 = select i1 %4, i16 %5, i16 %0
%7 = select i1 %2, i16 %3, i16 %6
ret i16 %7
}
unsigned int call7a(unsigned int ui) {
  if (ui)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<call7a>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <call7a+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1124 <call7a+0x24>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @call7a(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
ret i32 %3
}
int binrpc_get_int_len(int i) {
  int size;
  for (size = 4; size && ((i & (0xff << 24)) == 0); i <<= 8, size--)
    ;
  return size;
}


x86 assembly (clang, -O0):
<binrpc_get_int_len>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x4,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     112e <binrpc_get_int_len+0x2e>
mov    -0x4(%rbp),%eax
and    $0xff000000,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    113e <binrpc_get_int_len+0x3e>
jmp    115a <binrpc_get_int_len+0x5a>
jmp    1143 <binrpc_get_int_len+0x43>
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <binrpc_get_int_len+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<binrpc_get_int_len>:
mov    $0x4,%eax
cmp    $0xffffff,%edi
ja     112e <binrpc_get_int_len+0x2e>
mov    $0x3,%eax
cmp    $0xffff,%edi
ja     112e <binrpc_get_int_len+0x2e>
mov    $0x2,%eax
cmp    $0xff,%edi
ja     112e <binrpc_get_int_len+0x2e>
xor    %eax,%eax
test   %edi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @binrpc_get_int_len(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 4, i32* %3
br label %4
4: ; preds = %14, %1
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* %2
%9 = and i32 %8, -16777216
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %7, %4
%12 = phi i1 [ false, %4 ], [ %10, %7 ]
br i1 %12, label %13, label %19
13: ; preds = %11
br label %14
14: ; preds = %13
%15 = load i32, i32* %2
%16 = shl i32 %15, 8
store i32 %16, i32* %2
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %4
19: ; preds = %11
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @binrpc_get_int_len(i32 %0) {
%2 = icmp ult i32 %0, 16777216
br i1 %2, label %3, label %10
3: ; preds = %1
%4 = icmp ult i32 %0, 65536
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = icmp ult i32 %0, 256
br i1 %6, label %7, label %10
7: ; preds = %5
%8 = icmp eq i32 %0, 0
%9 = select i1 %8, i32 0, i32 1
br label %10
10: ; preds = %7, %3, %5, %1
%11 = phi i32 [ 4, %1 ], [ 3, %3 ], [ 2, %5 ], [ %9, %7 ]
ret i32 %11
}