xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, char *);
char *merror(char *input) {
  char *error;
  asprintf(&error, "<merror>Error on input \"%s\".</merror>", input);
  return error;
}


x86 assembly (clang, -O0):
<merror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    -0x10(%rbp),%rdi
lea    0xed5(%rip),%rsi
call   1030 <asprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<merror>:
push   %rax
mov    %rdi,%rdx
lea    0xee5(%rip),%rsi
mov    %rsp,%rdi
call   1030 <asprintf@plt>
mov    (%rsp),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"<merror>Error on input \22%s\22.</merror>\00"
define i8* @merror(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
@.str = [38 x i8] c"<merror>Error on input \22%s\22.</merror>\00"
define i8* @merror(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = load i8*, i8** %2
ret i8* %5
}
void sdram_special_finishup(void) {}


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

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

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

LLVM IR (-O2):
define void @sdram_special_finishup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AddPolyPoint(int, int);
int /*<<< orphan*/ EndPolyLine();
int /*<<< orphan*/ StartPolyLine(int, int, int);
void DoBigTriangle(int i) {
  StartPolyLine(140 + i, i + 10, 4);
  AddPolyPoint(50 + i, 100 + i / 3);
  AddPolyPoint(120, 100);
  EndPolyLine();
}


x86 assembly (clang, -O0):
<DoBigTriangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x8c,%edi
mov    -0x4(%rbp),%esi
add    $0xa,%esi
mov    $0x4,%edx
call   1050 <StartPolyLine@plt>
mov    -0x4(%rbp),%edi
add    $0x32,%edi
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
add    $0x64,%esi
call   1030 <AddPolyPoint@plt>
mov    $0x78,%edi
mov    $0x64,%esi
call   1030 <AddPolyPoint@plt>
mov    $0x0,%al
call   1040 <EndPolyLine@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoBigTriangle>:
push   %rbx
mov    %edi,%ebx
lea    0x8c(%rbx),%edi
lea    0xa(%rbx),%esi
mov    $0x4,%edx
call   1050 <StartPolyLine@plt>
movslq %ebx,%rax
add    $0x32,%ebx
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x20,%rcx
shr    $0x3f,%rax
lea    (%rcx,%rax,1),%esi
add    $0x64,%esi
mov    %ebx,%edi
call   1030 <AddPolyPoint@plt>
mov    $0x78,%edi
mov    $0x64,%esi
call   1030 <AddPolyPoint@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <EndPolyLine@plt>

LLVM IR (-O0):
define void @DoBigTriangle(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 140, %3
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 10
%7 = call i32 @StartPolyLine(i32 %4, i32 %6, i32 4)
%8 = load i32, i32* %2
%9 = add nsw i32 50, %8
%10 = load i32, i32* %2
%11 = sdiv i32 %10, 3
%12 = add nsw i32 100, %11
%13 = call i32 @AddPolyPoint(i32 %9, i32 %12)
%14 = call i32 @AddPolyPoint(i32 120, i32 100)
%15 = call i32 (...) @EndPolyLine()
ret void
}

LLVM IR (-O2):
define void @DoBigTriangle(i32 %0) {
%2 = add nsw i32 %0, 140
%3 = add nsw i32 %0, 10
%4 = tail call i32 @StartPolyLine(i32 %2, i32 %3, i32 4)
%5 = add nsw i32 %0, 50
%6 = sdiv i32 %0, 3
%7 = add nsw i32 %6, 100
%8 = tail call i32 @AddPolyPoint(i32 %5, i32 %7)
%9 = tail call i32 @AddPolyPoint(i32 120, i32 100)
%10 = tail call i32 (...) @EndPolyLine()
ret void
}
void fc51(int n) {
a : {
  typedef int(*b)[n];
  {
    typedef int(*c)[n];
    0;
  }
  goto a;
  {
    typedef int(*d)[n];
    0;
  };
  typedef int(*e)[n];
  0;
};
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc51>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc51+0x7>

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

LLVM IR (-O0):
define void @fc51(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
%4 = load i32, i32* %2
%5 = zext i32 %4 to i64
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
br label %3
8: ; No predecessors!
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc51(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int mult(int a, int b) {
  int k = 0;
  if (a > b) {
    while (a != b) {
      a /= 2;
      k++;
    }
  } else {
    while (a != b) {
      a *= 2;
      k++;
    }
  }
  return k;
}


x86 assembly (clang, -O0):
<mult>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    114f <mult+0x4f>
jmp    1122 <mult+0x22>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     114a <mult+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1122 <mult+0x22>
jmp    117c <mult+0x7c>
jmp    1154 <mult+0x54>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1177 <mult+0x77>
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <mult+0x54>
jmp    117c <mult+0x7c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult>:
xor    %eax,%eax
cmp    %esi,%edi
jle    1122 <mult+0x22>
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
add    $0x1,%eax
mov    %ecx,%edi
cmp    %esi,%ecx
jne    1110 <mult+0x10>
jmp    1139 <mult+0x39>
cmp    %esi,%edi
je     1139 <mult+0x39>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
add    %edi,%edi
add    $0x1,%eax
cmp    %esi,%edi
jne    1130 <mult+0x30>
ret

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

LLVM IR (-O2):
define i32 @mult(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp eq i32 %0, %1
br i1 %5, label %18, label %12
6: ; preds = %2, %6
%7 = phi i32 [ %10, %6 ], [ 0, %2 ]
%8 = phi i32 [ %9, %6 ], [ %0, %2 ]
%9 = sdiv i32 %8, 2
%10 = add nuw nsw i32 %7, 1
%11 = icmp eq i32 %9, %1
br i1 %11, label %18, label %6
12: ; preds = %4, %12
%13 = phi i32 [ %16, %12 ], [ 0, %4 ]
%14 = phi i32 [ %15, %12 ], [ %0, %4 ]
%15 = shl nsw i32 %14, 1
%16 = add nuw nsw i32 %13, 1
%17 = icmp eq i32 %15, %1
br i1 %17, label %18, label %12
18: ; preds = %12, %6, %4
%19 = phi i32 [ 0, %4 ], [ %10, %6 ], [ %16, %12 ]
ret i32 %19
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
scalar_t__ get_zip(struct state *);
scalar_t__ is_valid(struct state *);
int optional_zip(struct state *s) { return get_zip(s) || is_valid(s); }


x86 assembly (clang, -O0):
<optional_zip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_zip@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jne    115a <optional_zip+0x3a>
mov    -0x8(%rbp),%rdi
call   1040 <is_valid@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<optional_zip>:
push   %rbx
mov    %rdi,%rbx
call   1030 <get_zip@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1138 <optional_zip+0x18>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_valid@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
%struct.state = type { i32 }
define i32 @optional_zip(%struct.state* %0) {
%2 = alloca %struct.state*
store %struct.state* %0, %struct.state** %2
%3 = load %struct.state*, %struct.state** %2
%4 = call i64 @get_zip(%struct.state* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load %struct.state*, %struct.state** %2
%8 = call i64 @is_valid(%struct.state* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct.state = type { i32 }
define i32 @optional_zip(%struct.state* %0) {
%2 = tail call i64 @get_zip(%struct.state* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_valid(%struct.state* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
long write(int, char *, long);
long int portwrite1(int fd, char *data) {
  long int len = 1, n = 0;
  n = write(fd, data, len);
  if (n < 0) {
    fputs("write failed!\n", stderr);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<portwrite1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <write@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jge    1180 <portwrite1+0x60>
mov    0x2e7b(%rip),%rax
mov    (%rax),%esi
lea    0xe92(%rip),%rdi
call   1040 <fputs@plt>
movq   $0x0,-0x8(%rbp)
jmp    1188 <portwrite1+0x68>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<portwrite1>:
push   %rbx
mov    $0x1,%ebx
mov    $0x1,%edx
call   1030 <write@plt>
test   %rax,%rax
jns    114c <portwrite1+0x2c>
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1040 <fputs@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"write failed!\0A\00"
@stderr = global i32 0
define i64 @portwrite1(i32 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 1, i64* %6
store i64 0, i64* %7
%8 = load i32, i32* %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i64 @write(i32 %8, i8* %9, i64 %10)
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = icmp slt i64 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %15)
store i64 0, i64* %3
br label %18
17: ; preds = %2
store i64 1, i64* %3
br label %18
18: ; preds = %17, %14
%19 = load i64, i64* %3
ret i64 %19
}

LLVM IR (-O2):
@.str = [15 x i8] c"write failed!\0A\00"
@stderr = global i32 0
define i64 @portwrite1(i32 %0, i8* nocapture %1) {
%3 = tail call i64 @write(i32 %0, i8* %1, i64 1)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %2, %5
%9 = phi i64 [ 0, %5 ], [ 1, %2 ]
ret i64 %9
}
/* Variables and functions */
scalar_t__ EOF;
scalar_t__ getchar();
int main() {
  while (getchar() != EOF) {
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
je     113b <main+0x2b>
jmp    111f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ed0(%rip),%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    (%rbx),%rax
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i64 0
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @getchar()
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %1
5: ; preds = %1
ret i32 0
}
void test_3(char *x, unsigned int y, unsigned int z) {
  x[0] |= 0x10;
  x[1] = y | (1 << 1);
  x[2] |= 0x10;
  x[65000] |= 0x10;
  x[5] |= 1 << z;
}


x86 assembly (clang, -O0):
<test_3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
or     $0x10,%ecx
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
or     $0x2,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x8(%rbp),%rax
movsbl 0x2(%rax),%ecx
or     $0x10,%ecx
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
movsbl 0xfde8(%rax),%ecx
or     $0x10,%ecx
mov    %cl,0xfde8(%rax)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%ecx
or     %edx,%ecx
mov    %cl,0x5(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_3>:
orb    $0x10,(%rdi)
or     $0x2,%sil
mov    %sil,0x1(%rdi)
orb    $0x10,0x2(%rdi)
mov    %edx,%ecx
orb    $0x10,0xfde8(%rdi)
mov    $0x1,%eax
shl    %cl,%eax
or     %al,0x5(%rdi)
ret

LLVM IR (-O0):
define void @test_3(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = or i32 %10, 16
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i32, i32* %5
%14 = or i32 %13, 2
%15 = trunc i32 %14 to i8
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 1
store i8 %15, i8* %17
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = or i32 %21, 16
%23 = trunc i32 %22 to i8
store i8 %23, i8* %19
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i64 65000
%26 = load i8, i8* %25
%27 = sext i8 %26 to i32
%28 = or i32 %27, 16
%29 = trunc i32 %28 to i8
store i8 %29, i8* %25
%30 = load i32, i32* %6
%31 = shl i32 1, %30
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 5
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = or i32 %35, %31
%37 = trunc i32 %36 to i8
store i8 %37, i8* %33
ret void
}

LLVM IR (-O2):
define void @test_3(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = or i8 %4, 16
store i8 %5, i8* %0
%6 = trunc i32 %1 to i8
%7 = or i8 %6, 2
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = or i8 %10, 16
store i8 %11, i8* %9
%12 = getelementptr inbounds i8, i8* %0, i64 65000
%13 = load i8, i8* %12
%14 = or i8 %13, 16
store i8 %14, i8* %12
%15 = shl nuw i32 1, %2
%16 = getelementptr inbounds i8, i8* %0, i64 5
%17 = load i8, i8* %16
%18 = trunc i32 %15 to i8
%19 = or i8 %17, %18
store i8 %19, i8* %16
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fread(unsigned short *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
unsigned short get_audio_bits(FILE *file) {
  unsigned short ret;
  fseek(file, 34, SEEK_SET);
  fread(&ret, 2, 1, file);
  return ret;
}


x86 assembly (clang, -O0):
<get_audio_bits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    $0x22,%esi
call   1040 <fseek@plt>
mov    -0x8(%rbp),%rcx
lea    -0xa(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
movzwl -0xa(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_audio_bits>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    0x2eb1(%rip),%rax
mov    (%rax),%edx
mov    $0x22,%esi
call   1040 <fseek@plt>
lea    0xe(%rsp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <fread@plt>
movzwl 0xe(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define zeroext i16 @get_audio_bits(i32* %0) {
%2 = alloca i32*
%3 = alloca i16
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_SET
%6 = call i32 @fseek(i32* %4, i32 34, i32 %5)
%7 = load i32*, i32** %2
%8 = call i32 @fread(i16* %3, i32 2, i32 1, i32* %7)
%9 = load i16, i16* %3
ret i16 %9
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define zeroext i16 @get_audio_bits(i32* nocapture %0) {
%2 = alloca i16
%3 = bitcast i16* %2 to i8*
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i32 34, i32 %4)
%6 = call i32 @fread(i16* %2, i32 2, i32 1, i32* %0)
%7 = load i16, i16* %2
ret i16 %7
}
int print_info(void *state __attribute__((unused))) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @print_info(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int recursive(int, int *, int const *);
bool isHappy(int n) {
  bool used[10000] = {false};
  const static int sq[10] = {0, 1, 4, 9, 16, 25, 36, 49, 64, 81};
  return recursive(n, used, sq);
}


x86 assembly (clang, -O0):
<isHappy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x9c50(%rbp),%rdi
xor    %esi,%esi
mov    $0x9c40,%edx
call   1030 <memset@plt>
mov    -0x4(%rbp),%edi
lea    -0x9c50(%rbp),%rsi
lea    0xeae(%rip),%rdx
call   1040 <recursive@plt>
add    $0x9c50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isHappy>:
push   %r14
push   %rbx
sub    $0x9c48,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    $0x9c40,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xebb(%rip),%rdx
mov    %ebx,%edi
mov    %r14,%rsi
call   1040 <recursive@plt>
add    $0x9c48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@isHappy.sq = internal constant [10 x i32] [i32 0, i32 1, i32 4, i32 9, i32 16, i32 25, i32 36, i32 49, i32 64, i32 81]
define i32 @isHappy(i32 %0) {
%2 = alloca i32
%3 = alloca [10000 x i32]
store i32 %0, i32* %2
%4 = bitcast [10000 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [10000 x i32], [10000 x i32]* %3, i64 0, i64 0
%7 = call i32 @recursive(i32 %5, i32* %6, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @isHappy.sq, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@isHappy.sq = internal constant [10 x i32] [i32 0, i32 1, i32 4, i32 9, i32 16, i32 25, i32 36, i32 49, i32 64, i32 81]
define i32 @isHappy(i32 %0) {
%2 = alloca [10000 x i32]
%3 = bitcast [10000 x i32]* %2 to i8*
%4 = getelementptr inbounds [10000 x i32], [10000 x i32]* %2, i64 0, i64 0
%5 = call i32 @recursive(i32 %0, i32* %4, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @isHappy.sq, i64 0, i64 0))
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ func_44(int);
int lshift_u_s(int);
unsigned int func_48(signed char p_49) {
  signed char l_340;
  func_44(1 & ((1 ^ 1 == (lshift_u_s(1)) != (l_340 < 1)) & 1L));
}


x86 assembly (clang, -O0):
<func_48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    $0x1,%edi
call   1030 <lshift_u_s@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
movsbl -0x6(%rbp),%ecx
cmp    $0x1,%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
xor    $0x1,%eax
cltq
and    $0x1,%rax
and    $0x1,%rax
mov    %eax,%edi
call   1040 <func_44@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_48>:
push   %rax
mov    $0x1,%edi
call   1030 <lshift_u_s@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rax
jmp    1040 <func_44@plt>

LLVM IR (-O0):
define i32 @func_48(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
%5 = call i32 @lshift_u_s(i32 1)
%6 = icmp eq i32 1, %5
%7 = zext i1 %6 to i32
%8 = load i8, i8* %4
%9 = sext i8 %8 to i32
%10 = icmp slt i32 %9, 1
%11 = zext i1 %10 to i32
%12 = icmp ne i32 %7, %11
%13 = zext i1 %12 to i32
%14 = xor i32 1, %13
%15 = sext i32 %14 to i64
%16 = and i64 %15, 1
%17 = and i64 1, %16
%18 = trunc i64 %17 to i32
%19 = call i32 @func_44(i32 %18)
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @func_48(i8 signext %0) {
%2 = tail call i32 @lshift_u_s(i32 1)
%3 = icmp eq i32 %2, 1
%4 = zext i1 %3 to i32
%5 = tail call i32 @func_44(i32 %4)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void decbkm(int flag) {
  if (flag)
    sm("?67");
  else
    rm("?67");
}


x86 assembly (clang, -O0):
<decbkm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <decbkm+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <decbkm+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decbkm>:
test   %edi,%edi
je     1130 <decbkm+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"?67\00"
define void @decbkm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"?67\00"
define void @decbkm(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int futimens(int, struct timespec const *);
__attribute__((__weak__, __always___)) int
softboundcets_futimens(int fd, const struct timespec times[2]) {
  return futimens(fd, times);
}


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

x86 assembly (clang, -O2):
<softboundcets_futimens>:
jmp    1030 <futimens@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
define weak i32 @softboundcets_futimens(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* %3
%6 = load %struct.timespec*, %struct.timespec** %4
%7 = call i32 @futimens(i32 %5, %struct.timespec* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
define weak i32 @softboundcets_futimens(i32 %0, %struct.timespec* %1) {
%3 = tail call i32 @futimens(i32 %0, %struct.timespec* %1)
ret i32 %3
}
void glDepthRangef(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glDepthRangef() {
ret void
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *file_name_from_path(const char *path) {
  char *namestart = strrchr(path, '/');
  return namestart ? namestart + 1 : path;
}


x86 assembly (clang, -O0):
<file_name_from_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <file_name_from_path+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <file_name_from_path+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_name_from_path>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @file_name_from_path(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @file_name_from_path(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
char *showooa(x)
int x;
{
  switch (x) {
  case 0:
    return ("off");
  case 1:
    return ("on");
  case 2:
    return ("automatic");
  default:
    return ("(unknown)");
  }
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"off\00"
@.str.1 = [3 x i8] c"on\00"
@.str.2 = [10 x i8] c"automatic\00"
@.str.3 = [10 x i8] c"(unknown)\00"
@reltable.showooa = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.showooa to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.showooa to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.showooa to i64)) to i32)]
define i8* @showooa(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.showooa to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
int fun1292() { return 1292; }


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

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

LLVM IR (-O0):
define i32 @fun1292() {
ret i32 1292
}

LLVM IR (-O2):
define i32 @fun1292() {
ret i32 1292
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_perimeter(double perimeter) {
  printf("The perimeter is %.2lf\n", perimeter);
}


x86 assembly (clang, -O0):
<print_perimeter>:
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):
<print_perimeter>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"The perimeter is %.2lf\0A\00"
define void @print_perimeter(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
unsigned char i2cDetect(unsigned char __DevAddress) {}


x86 assembly (clang, -O0):
<i2cDetect>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @i2cDetect(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %2
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @i2cDetect(i8 zeroext %0) {
ret i8 undef
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int mat(char *str1, char *str2) { return strcmp(str1, str2) == 0; }


x86 assembly (clang, -O0):
<mat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @mat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %5, i8* %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @mat(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
void DelayMS(unsigned int n) {
  int i, j;
  for (i = n; i > 0; i--)
    for (j = 1000; j > 0; j--)
      ;
}


x86 assembly (clang, -O0):
<DelayMS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114e <DelayMS+0x4e>
movl   $0x3e8,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113b <DelayMS+0x3b>
jmp    112d <DelayMS+0x2d>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111e <DelayMS+0x1e>
jmp    1140 <DelayMS+0x40>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    110d <DelayMS+0xd>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @DelayMS(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
store i32 %5, i32* %3
br label %6
6: ; preds = %18, %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %6
store i32 1000, i32* %4
br label %10
10: ; preds = %14, %9
%11 = load i32, i32* %4
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
br label %14
14: ; preds = %13
%15 = load i32, i32* %4
%16 = add nsw i32 %15, -1
store i32 %16, i32* %4
br label %10
17: ; preds = %10
br label %18
18: ; preds = %17
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @DelayMS(i32 %0) {
ret void
}
void soru_6(const char s1[], const char s2[]) {}


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

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

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

LLVM IR (-O2):
define void @soru_6(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
void skin_buffer_init(char *buffer, size_t size) {}


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

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

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

LLVM IR (-O2):
define void @skin_buffer_init(i8* nocapture %0, i64 %1) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t clip_uint8(int a) {
  if (a & (~255))
    return (-a) >> 31;
  else
    return a;
}


x86 assembly (clang, -O0):
<clip_uint8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xffffff00,%eax
cmp    $0x0,%eax
je     1128 <clip_uint8+0x28>
xor    %eax,%eax
sub    -0x8(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    112e <clip_uint8+0x2e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clip_uint8>:
xor    %eax,%eax
test   %edi,%edi
setg   %al
neg    %eax
cmp    $0x100,%edi
cmovb  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clip_uint8(i32 %0) {
%2 = icmp ult i32 %0, 256
%3 = icmp sgt i32 %0, 0
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 %0, i32 %4
ret i32 %5
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double pop(struct lifo *);
double pow(double, double);
double opr_pow(struct lifo *stack) {
  double op1, op2;
  op1 = pop(stack);
  op2 = pop(stack);
  return pow(op2, op1);
}


x86 assembly (clang, -O0):
<opr_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <pop@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <pow@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_pow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1030 <pop@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <pop@plt>
movsd  0x8(%rsp),%xmm1
add    $0x10,%rsp
pop    %rbx
jmp    1040 <pow@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_pow(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
%4 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%5 = load %struct.lifo*, %struct.lifo** %2
%6 = call double @pop(%struct.lifo* %5)
store double %6, double* %3
%7 = load %struct.lifo*, %struct.lifo** %2
%8 = call double @pop(%struct.lifo* %7)
store double %8, double* %4
%9 = load double, double* %4
%10 = load double, double* %3
%11 = call double @pow(double %9, double %10)
ret double %11
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_pow(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @pop(%struct.lifo* %0)
%4 = tail call double @pow(double %3, double %2)
ret double %4
}
void ideCompileAndRun() {}


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

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

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

LLVM IR (-O2):
define void @ideCompileAndRun() {
ret void
}
/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
double get_cpu_time(void) { return ((double)clock()) / CLOCKS_PER_SEC; }


x86 assembly (clang, -O0):
<get_cpu_time>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec1(%rip),%rax
divsd  (%rax),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_time>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cvtsi2sd %rax,%xmm0
mov    0x2ec4(%rip),%rax
divsd  (%rax),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_cpu_time() {
%1 = call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global double 0.000000e+00
define double @get_cpu_time() {
%1 = tail call i64 (...) @clock()
%2 = sitofp i64 %1 to double
%3 = load double, double* @CLOCKS_PER_SEC
%4 = fdiv double %2, %3
ret double %4
}
/* Variables and functions */
int double_loop();
void double_call(char *p) {
  int i = double_loop();
  p[i] = 0;
}


x86 assembly (clang, -O0):
<double_call>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <double_loop@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<double_call>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <double_loop@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @double_call(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (...) @double_loop()
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @double_call(i8* nocapture writeonly %0) {
%2 = tail call i32 (...) @double_loop()
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 0, i8* %4
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  FILE *file = NULL;
  if (file != NULL) {
    char line[256];
    while (fgets(line, sizeof(line), file) != NULL) {
      fputs(line, stdout);
    }
    fclose(file);
  } else {
    perror("test.zasm");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     11b8 <main+0x78>
jmp    1171 <main+0x31>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x100,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     11aa <main+0x6a>
lea    -0x120(%rbp),%rdi
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
call   1040 <fputs@plt>
jmp    1171 <main+0x31>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
jmp    11c4 <main+0x84>
lea    0xe41(%rip),%rdi
call   1060 <perror@plt>
xor    %eax,%eax
add    $0x120,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stdout = global i32 0
@.str = [10 x i8] c"test.zasm\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [256 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32* null, i32** %6
%8 = load i32*, i32** %6
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %23
10: ; preds = %2
br label %11
11: ; preds = %16, %10
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%13 = load i32*, i32** %6
%14 = call i32* @fgets(i8* %12, i32 256, i32* %13)
%15 = icmp ne i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
%18 = load i32, i32* @stdout
%19 = call i32 @fputs(i8* %17, i32 %18)
br label %11
20: ; preds = %11
%21 = load i32*, i32** %6
%22 = call i32 @fclose(i32* %21)
br label %25
23: ; preds = %2
%24 = call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [10 x i8] c"test.zasm\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @perror(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
long long nano2ticks(long long nano) { return nano; }


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

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

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

LLVM IR (-O2):
define i64 @nano2ticks(i64 returned %0) {
ret i64 %0
}
void ckAsmClearTS(void) { __asm__ __volatile__("clts"); }


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

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

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

LLVM IR (-O2):
define void @ckAsmClearTS() {
tail call void asm sideeffect "clts", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int main() {
  int i = 0;
  if (i == 0) {
    i = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1123 <main+0x23>
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void *malloc(double);
int /*<<< orphan*/ printf(char *);
void *safeMalloc(double size) {
  void *ptr = malloc(size);
  if (ptr == NULL) {
    printf("Error: memory allocation failed. Out of memory?\n");
    exit(-1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<safeMalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    116c <safeMalloc+0x3c>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeMalloc>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <safeMalloc+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [49 x i8] c"Error: memory allocation failed. Out of memory?\0A\00"
define i8* @safeMalloc(double %0) {
%2 = alloca double
%3 = alloca i8*
store double %0, double* %2
%4 = load double, double* %2
%5 = call i8* @malloc(double %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@str = [48 x i8] c"Error: memory allocation failed. Out of memory?\00"
define noalias i8* @safeMalloc(double %0) {
%2 = tail call i8* @malloc(double %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  printf("Hola %c todos\n", 'a');
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Hola %c todos\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext 97)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Hola %c todos\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext 97)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ FCEU_DispMessage(char *);
void FCEUD_LoadStateFrom(void) { FCEU_DispMessage("Not implemented."); }


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_LoadStateFrom() {
%1 = call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"Not implemented.\00"
define void @FCEUD_LoadStateFrom() {
%1 = tail call i32 @FCEU_DispMessage(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}