xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ajMemFree(void **ptr) {
  if (!ptr)
    return;
  if (!*ptr)
    return;
  free(*ptr);
  *ptr = NULL;
  return;
}


x86 assembly (clang, -O0):
<ajMemFree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    112c <ajMemFree+0x1c>
jmp    1156 <ajMemFree+0x46>
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    113f <ajMemFree+0x2f>
jmp    1156 <ajMemFree+0x46>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ajMemFree>:
push   %rbx
test   %rdi,%rdi
je     112d <ajMemFree+0x1d>
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     112d <ajMemFree+0x1d>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ajMemFree(i8** %0) {
%2 = icmp eq i8** %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i8*, i8** %0
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @free(i8* %4)
store i8* null, i8** %0
br label %8
8: ; preds = %3, %1, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_int(int);
int main() { print_int(2 && 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <print_int@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @print_int(i32 1)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @print_int(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int a, b;
  a = 2;
  b = 5;
  printf("\n%d\t%d", a, b);
  {
    int temp;
    temp = a;
    a = b;
    b = temp;
  };
  printf("\n%d\t%d", a, b);
  printf("\n\n");
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("STARTED\n..\n");
  FILE *input_file;
  input_file = fopen(argv[1], "r");
  printf("..\nENDED\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [2 x i8] c"r\00"
@str = [11 x i8] c"STARTED\0A..\00"
@str.3 = [9 x i8] c"..\0AENDED\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getpid();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  fprintf(stderr, "pid is %d\n", getpid());
  sleep(60);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%edx
lea    0xea2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x3c,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ea8(%rip),%rax
mov    (%rax),%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb8(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    $0x3c,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"pid is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @stderr
%6 = call i32 (...) @getpid()
%7 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 @sleep(i32 60)
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"pid is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @sleep(i32 60)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ intToHex(unsigned short, char *, int);
int /*<<< orphan*/ strcat(char *, char *);
void addValueU16(char *dst, char *str, unsigned short value) {
  char v[16];
  strcat(dst, str);
  intToHex(value, v, 4);
  strcat(dst, v);
}


x86 assembly (clang, -O0):
<addValueU16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %dx,%ax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x12(%rbp),%ax
lea    -0x30(%rbp),%rsi
mov    $0x4,%edx
movzwl %ax,%edi
call   1030 <intToHex@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addValueU16>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %rdi,%rbx
call   1040 <strcat@plt>
mov    %rsp,%r14
mov    %ebp,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1030 <intToHex@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @addValueU16(i8* %0, i8* %1, i16 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca [16 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @strcat(i8* %8, i8* %9)
%11 = load i16, i16* %6
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%13 = call i32 @intToHex(i16 zeroext %11, i8* %12, i32 4)
%14 = load i8*, i8** %4
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%16 = call i32 @strcat(i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @addValueU16(i8* %0, i8* %1, i16 zeroext %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @strcat(i8* %0, i8* %1)
%7 = call i32 @intToHex(i16 zeroext %2, i8* %5, i32 4)
%8 = call i32 @strcat(i8* %0, i8* %5)
ret void
}
int AlwaysLesser(void *Data1, void *Data2) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @AlwaysLesser(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x = 011, i;
  for (i = 0; i < x; i += 3) {
    printf("Start ");
    continue;
    printf("End");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x9,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <main+0x43>
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"Start \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void f2(void) {
  int x[100];
#pragma acc enter data copyin(x)
#pragma acc host_data use_device(x[4])
  ;
#pragma acc exit data delete (x)
}


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

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

LLVM IR (-O0):
define void @f2() {
%1 = alloca [100 x i32]
ret void
}

LLVM IR (-O2):
define void @f2() {
ret void
}
double centimetresToInches(double centimetres) { return centimetres * 3936.96; }


x86 assembly (clang, -O0):
<centimetresToInches>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<centimetresToInches>:
mulsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @centimetresToInches(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 3.936960e+03
ret double %4
}

LLVM IR (-O2):
define double @centimetresToInches(double %0) {
%2 = fmul double %0, 3.936960e+03
ret double %2
}
const struct of_device_id *of_match_node(const struct of_device_id *matches,
                                         const struct device_node *node) {
  return ((void *)0);
}


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

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

LLVM IR (-O0):
%struct.of_device_id = type opaque
%struct.device_node = type opaque
define %struct.of_device_id* @of_match_node(%struct.of_device_id* %0, %struct.device_node* %1) {
%3 = alloca %struct.of_device_id*
%4 = alloca %struct.device_node*
store %struct.of_device_id* %0, %struct.of_device_id** %3
store %struct.device_node* %1, %struct.device_node** %4
ret %struct.of_device_id* null
}

LLVM IR (-O2):
%struct.of_device_id = type opaque
%struct.device_node = type opaque
define noalias %struct.of_device_id* @of_match_node(%struct.of_device_id* nocapture readnone %0, %struct.device_node* nocapture readnone %1) {
ret %struct.of_device_id* null
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int solcon_dobldobl_set_continuation_parameter(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(876, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_dobldobl_set_continuation_parameter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x36c,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_dobldobl_set_continuation_parameter>:
mov    $0x36c,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @solcon_dobldobl_set_continuation_parameter() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 876, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_dobldobl_set_continuation_parameter() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 876, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
int asm_main();
int main() {
  int ret_status;
  ret_status = asm_main();
  return ret_status;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @asm_main()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ return_struct_2();
int /*<<< orphan*/ take_struct_2(int /*<<< orphan*/);
void test_struct_2() { take_struct_2(return_struct_2()); }


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

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

LLVM IR (-O0):
define void @test_struct_2() {
%1 = call i32 (...) @return_struct_2()
%2 = call i32 @take_struct_2(i32 %1)
ret void
}

LLVM IR (-O2):
define void @test_struct_2() {
%1 = tail call i32 (...) @return_struct_2()
%2 = tail call i32 @take_struct_2(i32 %1)
ret void
}
int get_num_paragraphs(char ***chapter) {
  int i;
  for (i = 0; *(chapter + i) != '\0'; i++) {
  }
  return i;
}


x86 assembly (clang, -O0):
<get_num_paragraphs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1135 <get_num_paragraphs+0x35>
jmp    1127 <get_num_paragraphs+0x27>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_num_paragraphs+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_paragraphs>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <get_num_paragraphs+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_num_paragraphs(i8*** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8**, i8*** %0, i64 %3
%5 = load i8**, i8*** %4
%6 = icmp eq i8** %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
int bar(char *c, int i) { return c + i > c; }


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

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

LLVM IR (-O0):
define i32 @bar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8*, i8** %3
%10 = icmp ugt i8* %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @bar(i8* nocapture readnone %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "failed: execl succeeded\n");
  return 1;
}


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

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

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"failed: execl succeeded\0A\00"
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
int func10(int i) {
  switch (i) {
  case 1 ... 5:
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<func10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
sub    $0x4,%eax
ja     1127 <func10+0x27>
jmp    111b <func10+0x1b>
movl   $0x1,-0x4(%rbp)
jmp    112e <func10+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func10>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x5,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @func10(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 1, label %5
i32 2, label %5
i32 3, label %5
i32 4, label %5
i32 5, label %5
]
5: ; preds = %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 @func10(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 5
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct rlimit {
  int rlim_max;
  scalar_t__ rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_CPU;
int /*<<< orphan*/ getrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ setrlimit(int /*<<< orphan*/, struct rlimit *);
int main() {
  struct rlimit rl;
  getrlimit(RLIMIT_CPU, &rl);
  rl.rlim_cur = 0;
  rl.rlim_max = 30;
  setrlimit(RLIMIT_CPU, &rl);
  while (1) {
    ;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1040 <getrlimit@plt>
movq   $0x0,-0x10(%rbp)
movl   $0x1e,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    -0x18(%rbp),%rsi
call   1030 <setrlimit@plt>
jmp    1162 <main+0x42>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2eaa(%rip),%r14
mov    (%r14),%edi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <getrlimit@plt>
movq   $0x0,0x10(%rsp)
movl   $0x1e,0x8(%rsp)
mov    (%r14),%edi
mov    %rbx,%rsi
call   1030 <setrlimit@plt>
nopw   0x0(%rax,%rax,1)
jmp    1160 <main+0x40>

LLVM IR (-O0):
%struct.rlimit = type { i32, i64 }
@RLIMIT_CPU = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = load i32, i32* @RLIMIT_CPU
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %2)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
store i32 30, i32* %6
%7 = load i32, i32* @RLIMIT_CPU
%8 = call i32 @setrlimit(i32 %7, %struct.rlimit* %2)
br label %9
9: ; preds = %0, %9
br label %9
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i64 }
@RLIMIT_CPU = global i32 0
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = load i32, i32* @RLIMIT_CPU
%4 = call i32 @getrlimit(i32 %3, %struct.rlimit* %1)
%5 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
store i32 30, i32* %6
%7 = load i32, i32* @RLIMIT_CPU
%8 = call i32 @setrlimit(i32 %7, %struct.rlimit* %1)
br label %9
9: ; preds = %9, %0
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void priHelp() {
  printf("\033[1mw,s,a,d\033[0m to move Up,Down,Left,Right.\n\033[1mq\033[0m "
         "to Quit.\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"\1B[1mw,s,a,d\1B[0m to move Up,Down,Left,Right.\0A\1B[1mq\1B[0m to Quit.\0A\00"
define void @priHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [63 x i8] c"\1B[1mw,s,a,d\1B[0m to move Up,Down,Left,Right.\0A\1B[1mq\1B[0m to Quit.\00"
define void @priHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret void
}
int normalize(float oval, int max_val, int max) {
  int val;
  val = (oval / max_val) * max;
  if (val > max)
    val = max;
  if (val == 0 && oval > 0)
    val = 1;
  if (val < 0)
    val = 0;
  return val;
}


x86 assembly (clang, -O0):
<normalize>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    113f <normalize+0x3f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1161 <normalize+0x61>
movss  -0x4(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    1161 <normalize+0x61>
movl   $0x1,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    1172 <normalize+0x72>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize>:
cvtsi2ss %edi,%xmm1
movaps %xmm0,%xmm2
cvtsi2ss %esi,%xmm3
divss  %xmm1,%xmm2
mulss  %xmm2,%xmm3
cvttss2si %xmm3,%eax
cmp    %esi,%eax
cmovg  %esi,%eax
test   %eax,%eax
mov    $0x1,%ecx
cmovne %eax,%ecx
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
cmovbe %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
ret

LLVM IR (-O0):
define i32 @normalize(float %0, i32 %1, i32 %2) {
%4 = alloca float
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store float %0, float* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load float, float* %4
%9 = load i32, i32* %5
%10 = sitofp i32 %9 to float
%11 = fdiv float %8, %10
%12 = load i32, i32* %6
%13 = sitofp i32 %12 to float
%14 = fmul float %11, %13
%15 = fptosi float %14 to i32
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = load i32, i32* %6
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %3
%20 = load i32, i32* %6
store i32 %20, i32* %7
br label %21
21: ; preds = %19, %3
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load float, float* %4
%26 = fcmp ogt float %25, 0.000000e+00
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %7
br label %28
28: ; preds = %27, %24, %21
%29 = load i32, i32* %7
%30 = icmp slt i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %28
store i32 0, i32* %7
br label %32
32: ; preds = %31, %28
%33 = load i32, i32* %7
ret i32 %33
}

LLVM IR (-O2):
define i32 @normalize(float %0, i32 %1, i32 %2) {
%4 = sitofp i32 %1 to float
%5 = fdiv float %0, %4
%6 = sitofp i32 %2 to float
%7 = fmul float %5, %6
%8 = fptosi float %7 to i32
%9 = icmp sgt i32 %8, %2
%10 = select i1 %9, i32 %2, i32 %8
%11 = icmp eq i32 %10, 0
%12 = fcmp ogt float %0, 0.000000e+00
%13 = and i1 %12, %11
%14 = select i1 %13, i32 1, i32 %10
%15 = icmp sgt i32 %14, 0
%16 = select i1 %15, i32 %14, i32 0
ret i32 %16
}
/* Variables and functions */
scalar_t__ COND_LT();
int /*<<< orphan*/ EA_AY_PI_8();
int /*<<< orphan*/ m68ki_write_8(int /*<<< orphan*/, int);
void m68k_op_slt_8_pi(void) {
  m68ki_write_8(EA_AY_PI_8(), COND_LT() ? 0xff : 0);
}


x86 assembly (clang, -O0):
<m68k_op_slt_8_pi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EA_AY_PI_8@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <COND_LT@plt>
mov    -0x4(%rbp),%edi
mov    %rax,%rcx
xor    %esi,%esi
mov    $0xff,%eax
cmp    $0x0,%rcx
cmovne %eax,%esi
call   1050 <m68ki_write_8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<m68k_op_slt_8_pi>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <EA_AY_PI_8@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <COND_LT@plt>
test   %rax,%rax
mov    $0xff,%esi
cmove  %ebp,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <m68ki_write_8@plt>

LLVM IR (-O0):
define void @m68k_op_slt_8_pi() {
%1 = call i32 (...) @EA_AY_PI_8()
%2 = call i64 (...) @COND_LT()
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 255, i32 0
%6 = call i32 @m68ki_write_8(i32 %1, i32 %5)
ret void
}

LLVM IR (-O2):
define void @m68k_op_slt_8_pi() {
%1 = tail call i32 (...) @EA_AY_PI_8()
%2 = tail call i64 (...) @COND_LT()
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 0, i32 255
%5 = tail call i32 @m68ki_write_8(i32 %1, i32 %4)
ret void
}
void _Z16_Jv_BuildGCDescrPN4java4lang5ClassE(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z16_Jv_BuildGCDescrPN4java4lang5ClassE() {
ret void
}
int test_imm_B6int32_reg(int val) { return ((val) & (0xB6 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_B6int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xb6,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B6int32_reg>:
test   $0xb6,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B6int32_reg(i32 %0) {
%2 = and i32 %0, 182
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void a52e_set_fscod(uint8_t *p_a52, uint8_t i_fscod) {
  p_a52[4] &= ~0xc0;
  p_a52[4] |= (i_fscod & 0x3) << 6;
}


x86 assembly (clang, -O0):
<a52e_set_fscod>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
and    $0xffffff3f,%ecx
mov    %ecx,0x10(%rax)
mov    -0xc(%rbp),%ecx
and    $0x3,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
or     0x10(%rax),%ecx
mov    %ecx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_set_fscod>:
mov    $0xffffff3f,%eax
and    0x10(%rdi),%eax
shl    $0x6,%esi
movzbl %sil,%ecx
or     %eax,%ecx
mov    %ecx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @a52e_set_fscod(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 = getelementptr inbounds i32, i32* %5, i64 4
%7 = load i32, i32* %6
%8 = and i32 %7, -193
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = and i32 %9, 3
%11 = shl i32 %10, 6
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 4
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @a52e_set_fscod(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
%5 = and i32 %4, -193
%6 = shl i32 %1, 6
%7 = and i32 %6, 192
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ks0108_e_high();
int /*<<< orphan*/ ks0108_e_low();
void __ks0108_COMMIT(void) {
  ks0108_e_high();
  ks0108_e_low();
}


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

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

LLVM IR (-O0):
define void @__ks0108_COMMIT() {
%1 = call i32 (...) @ks0108_e_high()
%2 = call i32 (...) @ks0108_e_low()
ret void
}

LLVM IR (-O2):
define void @__ks0108_COMMIT() {
%1 = tail call i32 (...) @ks0108_e_high()
%2 = tail call i32 (...) @ks0108_e_low()
ret void
}
_Bool Float__LT_(float x, float y) { return x < y; }


x86 assembly (clang, -O0):
<Float__LT_>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Float__LT_>:
ucomiss %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define zeroext i1 @Float__LT_(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp olt float %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Float__LT_(float %0, float %1) {
%3 = fcmp olt float %0, %1
ret i1 %3
}
const char *return_false() { return "false"; }


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"false\00"
define i8* @return_false() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
void swap(int *****a, int ****b) {
  int ****temp = *a;
  *a = *b;
  *b = temp;
}


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

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

LLVM IR (-O0):
define void @swap(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****** %3
%7 = load i32****, i32***** %6
store i32**** %7, i32***** %5
%8 = load i32****, i32***** %4
%9 = load i32***, i32**** %8
%10 = bitcast i32*** %9 to i32****
%11 = load i32*****, i32****** %3
store i32**** %10, i32***** %11
%12 = load i32****, i32***** %5
%13 = bitcast i32**** %12 to i32***
%14 = load i32****, i32***** %4
store i32*** %13, i32**** %14
ret void
}

LLVM IR (-O2):
define void @swap(i32***** nocapture %0, i32**** nocapture %1) {
%3 = bitcast i32***** %0 to i32****
%4 = load i32***, i32**** %3
%5 = bitcast i32**** %1 to i32*****
%6 = load i32****, i32***** %5
store i32**** %6, i32***** %0
store i32*** %4, i32**** %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_unisys_acpi_oem_table(unsigned long *, int *);
int parse_unisys_oem(char *, int);
int acpi_madt_oem_check(char *oem_id, char *oem_table_id) {
  unsigned long oem_addr;
  int oem_entries;
  if (!find_unisys_acpi_oem_table(&oem_addr, &oem_entries))
    return parse_unisys_oem((char *)oem_addr, oem_entries);
  return 0;
}


x86 assembly (clang, -O0):
<acpi_madt_oem_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x24(%rbp),%rsi
call   1030 <find_unisys_acpi_oem_table@plt>
cmp    $0x0,%eax
jne    115a <acpi_madt_oem_check+0x3a>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <parse_unisys_oem@plt>
mov    %eax,-0x4(%rbp)
jmp    1161 <acpi_madt_oem_check+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<acpi_madt_oem_check>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1030 <find_unisys_acpi_oem_table@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1140 <acpi_madt_oem_check+0x20>
add    $0x18,%rsp
ret
mov    0x10(%rsp),%rdi
mov    0xc(%rsp),%esi
call   1040 <parse_unisys_oem@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @acpi_madt_oem_check(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = call i32 @find_unisys_acpi_oem_table(i64* %6, i32* %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i64, i64* %6
%12 = inttoptr i64 %11 to i8*
%13 = load i32, i32* %7
%14 = call i32 @parse_unisys_oem(i8* %12, i32 %13)
store i32 %14, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @acpi_madt_oem_check(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = alloca i64
%4 = alloca i32
%5 = bitcast i64* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 @find_unisys_acpi_oem_table(i64* %3, i32* %4)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i64, i64* %3
%11 = inttoptr i64 %10 to i8*
%12 = load i32, i32* %4
%13 = call i32 @parse_unisys_oem(i8* %11, i32 %12)
br label %14
14: ; preds = %2, %9
%15 = phi i32 [ %13, %9 ], [ 0, %2 ]
ret i32 %15
}
int acpi_gpio_update_gpiod_flags(enum gpiod_flags *flags,
                                 struct acpi_gpio_info *info) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.acpi_gpio_info = type opaque
define i32 @acpi_gpio_update_gpiod_flags(i32* nocapture readnone %0, %struct.acpi_gpio_info* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void sizeof_overload_double(double d) { printf("Got double %f\n", d); }


x86 assembly (clang, -O0):
<sizeof_overload_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Got double %f\0A\00"
define void @sizeof_overload_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Got double %f\0A\00"
define void @sizeof_overload_double(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int x;
  printf("Please input integer: ");
  scanf("%d", &x);
  printf("You input %d.\n", x);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"Please input integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [15 x i8] c"You input %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  printf("\nProgram %s\n\n", argv[0]);
  return 0;
}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ iswprint(int /*<<< orphan*/);
void uninitvar_iswprint(void) {
  wint_t i;
  (void)iswprint(i);
}


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

x86 assembly (clang, -O2):
<uninitvar_iswprint>:
jmp    1030 <iswprint@plt>

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

LLVM IR (-O2):
define void @uninitvar_iswprint() {
%1 = tail call i32 @iswprint(i32 undef)
ret void
}
int pldummy_gnusvga() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pldummy_gnusvga() {
ret i32 0
}
void _ZNSt12_Destroy_auxILb1EE9__destroyIPPiEEvT_S4_(
    unsigned int **llvm_cbe_tmp__35, unsigned int **llvm_cbe_tmp__36) {
  unsigned int **llvm_cbe__2e_addr;
  unsigned int **llvm_cbe__2e_addr1;
  *(&llvm_cbe__2e_addr) = llvm_cbe_tmp__35;
  *(&llvm_cbe__2e_addr1) = llvm_cbe_tmp__36;
  return;
}


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

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

LLVM IR (-O0):
define void @_ZNSt12_Destroy_auxILb1EE9__destroyIPPiEEvT_S4_(i32** %0, i32** %1) {
%3 = alloca i32**
%4 = alloca i32**
%5 = alloca i32**
%6 = alloca i32**
store i32** %0, i32*** %3
store i32** %1, i32*** %4
%7 = load i32**, i32*** %3
store i32** %7, i32*** %5
%8 = load i32**, i32*** %4
store i32** %8, i32*** %6
ret void
}

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


x86 assembly (clang, -O0):
<G57_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    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"G57_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G57_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 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 = [46 x i8] c"G57_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G57_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 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
}