xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int main() {
  write(1,
        "\x1b"
        "[H"
        "\x1b"
        "[J",
        6);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1,%edi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[H\1B[J\00"
define i32 @main() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
void remove_char(char *str, char c) {
  char *dest = str;
  char *src = str;
  while (*src) {
    if (*src != c)
      *dest++ = *src;
    src++;
  }
  *dest = '\0';
}


x86 assembly (clang, -O0):
<remove_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1166 <remove_char+0x66>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     1155 <remove_char+0x55>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <remove_char+0x1e>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<remove_char>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <remove_char+0x28>
lea    0x1(%rdi),%rax
jmp    111b <remove_char+0x1b>
nopl   0x0(%rax)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1128 <remove_char+0x28>
cmp    %sil,%cl
je     1110 <remove_char+0x10>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <remove_char+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @remove_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %17, label %5
5: ; preds = %2, %12
%6 = phi i8 [ %15, %12 ], [ %3, %2 ]
%7 = phi i8* [ %14, %12 ], [ %0, %2 ]
%8 = phi i8* [ %13, %12 ], [ %0, %2 ]
%9 = icmp eq i8 %6, %1
br i1 %9, label %12, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %6, i8* %8
br label %12
12: ; preds = %10, %5
%13 = phi i8* [ %11, %10 ], [ %8, %5 ]
%14 = getelementptr inbounds i8, i8* %7, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %5
17: ; preds = %12, %2
%18 = phi i8* [ %0, %2 ], [ %13, %12 ]
store i8 0, i8* %18
ret void
}
int equalstring2(char *a, char *b) {
  int i = 0;
  do {
    if (a[i] == b[i])
      i++;
    else
      return (0);
  } while (a[i - 1] != '\0');
  return (1);
}


x86 assembly (clang, -O0):
<equalstring2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    1141 <equalstring2+0x41>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114d <equalstring2+0x4d>
movl   $0x0,-0x4(%rbp)
jmp    1173 <equalstring2+0x73>
jmp    1152 <equalstring2+0x52>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1113 <equalstring2+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalstring2>:
xor    %eax,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
cmp    (%rsi,%rcx,1),%dl
jne    1126 <equalstring2+0x26>
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <equalstring2+0x10>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @equalstring2(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i64 [ %11, %10 ], [ 0, %2 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %1, i64 %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = add nuw i64 %4, 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %13, label %3
13: ; preds = %10, %3
%14 = phi i32 [ 0, %3 ], [ 1, %10 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int water;
  scanf("%i", &water);
  int trips = water / 24;
  if (water % 24 != 0) {
    trips++;
  }
  printf("%i\n", trips);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x18,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     116a <main+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x2aaaaaab,%rax,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rsi
imul   $0xaaaaaaab,%eax,%eax
add    $0x2aaaaaa8,%eax
ror    $0x3,%eax
add    %ecx,%esi
cmp    $0xaaaaaab,%eax
sbb    $0xffffffff,%esi
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = sdiv i32 %4, 24
%6 = srem i32 %4, 24
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
%9 = add nsw i32 %5, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int ts_minus_msec(const struct timespec *s1, const struct timespec *s2) {
  return (s1->tv_sec - s2->tv_sec) * 1000 +
         (s1->tv_nsec - s2->tv_nsec) / 1000000;
}


x86 assembly (clang, -O0):
<ts_minus_msec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3e8,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    $0xf4240,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_minus_msec>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
sub    (%rsi),%eax
imul   $0x3e8,%eax,%edx
sub    0x4(%rsi),%ecx
movslq %ecx,%rax
imul   $0x431bde83,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x32,%rax
add    %ecx,%eax
add    %edx,%eax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @ts_minus_msec(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000
%13 = load %struct.timespec*, %struct.timespec** %3
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.timespec*, %struct.timespec** %4
%17 = getelementptr inbounds %struct.timespec, %struct.timespec* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = sub nsw i32 %15, %18
%20 = sdiv i32 %19, 1000000
%21 = add nsw i32 %12, %20
ret i32 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @ts_minus_msec(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%12 = load i32, i32* %11
%13 = sub nsw i32 %10, %12
%14 = sdiv i32 %13, 1000000
%15 = add nsw i32 %14, %8
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ AutonomousCodePlaceholderForTesting();
int /*<<< orphan*/ UserControlCodePlaceholderForTesting();
void DO_NOT_CALL_THIS_FUNCTION(void) {
  DO_NOT_CALL_THIS_FUNCTION();
  UserControlCodePlaceholderForTesting();
  AutonomousCodePlaceholderForTesting();
}


x86 assembly (clang, -O0):
<DO_NOT_CALL_THIS_FUNCTION>:
push   %rbp
mov    %rsp,%rbp
call   1040 <DO_NOT_CALL_THIS_FUNCTION@plt>
mov    $0x0,%al
call   1050 <UserControlCodePlaceholderForTesting@plt>
mov    $0x0,%al
call   1030 <AutonomousCodePlaceholderForTesting@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DO_NOT_CALL_THIS_FUNCTION>:
push   %rax
call   1040 <DO_NOT_CALL_THIS_FUNCTION@plt>
xor    %eax,%eax
call   1050 <UserControlCodePlaceholderForTesting@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <AutonomousCodePlaceholderForTesting@plt>

LLVM IR (-O0):
define void @DO_NOT_CALL_THIS_FUNCTION() {
%1 = call i32 (...) @UserControlCodePlaceholderForTesting()
%2 = call i32 (...) @AutonomousCodePlaceholderForTesting()
ret void
}

LLVM IR (-O2):
define void @DO_NOT_CALL_THIS_FUNCTION() {
tail call void @DO_NOT_CALL_THIS_FUNCTION()
%1 = tail call i32 (...) @UserControlCodePlaceholderForTesting()
%2 = tail call i32 (...) @AutonomousCodePlaceholderForTesting()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ltox(int, char *);
int /*<<< orphan*/ puts_k(char *);
void putl_k(int value) {
  char buff[12];
  ltox(value, buff);
  puts_k(buff);
}


x86 assembly (clang, -O0):
<putl_k>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
call   1040 <ltox@plt>
lea    -0x10(%rbp),%rdi
call   1030 <puts_k@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putl_k>:
push   %rbx
sub    $0x10,%rsp
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <ltox@plt>
mov    %rbx,%rdi
call   1030 <puts_k@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @putl_k(i32 %0) {
%2 = alloca i32
%3 = alloca [12 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%6 = call i32 @ltox(i32 %4, i8* %5)
%7 = getelementptr inbounds [12 x i8], [12 x i8]* %3, i64 0, i64 0
%8 = call i32 @puts_k(i8* %7)
ret void
}

LLVM IR (-O2):
define void @putl_k(i32 %0) {
%2 = alloca [12 x i8]
%3 = getelementptr inbounds [12 x i8], [12 x i8]* %2, i64 0, i64 0
%4 = call i32 @ltox(i32 %0, i8* %3)
%5 = call i32 @puts_k(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(void) {
  extern char *__progname;
  printf("Usage: %s [-cfnpw] [-hvl]\n", __progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
mov    (%rax),%rsi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%rsi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: %s [-cfnpw] [-hvl]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i8*, i8** @__progname
%2 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: %s [-cfnpw] [-hvl]\0A\00"
@__progname = external global i8*
define void @usage() {
%1 = load i8*, i8** @__progname
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ fprint_bit_array(int /*<<< orphan*/, int,
                                    int /*<<< orphan*/ *, int);
int /*<<< orphan*/ stdout;
void print_bit_array(int len, uint64_t *array, int number) {
  fprint_bit_array(stdout, len, array, number);
}


x86 assembly (clang, -O0):
<print_bit_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <fprint_bit_array@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bit_array>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fprint_bit_array@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @print_bit_array(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stdout
%8 = load i32, i32* %4
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = call i32 @fprint_bit_array(i32 %7, i32 %8, i32* %9, i32 %10)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @print_bit_array(i32 %0, i32* %1, i32 %2) {
%4 = load i32, i32* @stdout
%5 = tail call i32 @fprint_bit_array(i32 %4, i32 %0, i32* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_usage(char *argv[]) {
  printf("P1 Usage: \n");
  printf("\t %s fpnum \n", argv[0]);
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xee2(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"P1 Usage: \0A\00"
@.str.1 = [13 x i8] c"\09 %s fpnum \0A\00"
define void @print_usage(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"\09 %s fpnum \0A\00"
@str = [11 x i8] c"P1 Usage: \00"
define void @print_usage(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int factRecursive(int);
int main() { return factRecursive(6); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x6,%edi
jmp    1030 <factRecursive@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @factRecursive(i32 6)
ret i32 %1
}
/* Variables and functions */
char *method_str(unsigned int);
int /*<<< orphan*/ set_error(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
void unrecognized_method(unsigned method) {
  char buf[64];
  snprintf(buf, 64, "unrecognized compression method '%s'", method_str(method));
  buf[63] = '\0';
  set_error(buf);
}


x86 assembly (clang, -O0):
<unrecognized_method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <method_str@plt>
mov    -0x58(%rbp),%rdi
mov    %rax,%rcx
mov    $0x40,%esi
lea    0xea2(%rip),%rdx
call   1030 <snprintf@plt>
movb   $0x0,-0x11(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <set_error@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unrecognized_method>:
push   %rbx
sub    $0x40,%rsp
call   1050 <method_str@plt>
lea    0xebf(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %rax,%rcx
call   1030 <snprintf@plt>
movb   $0x0,0x3f(%rsp)
mov    %rbx,%rdi
call   1040 <set_error@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"unrecognized compression method '%s'\00"
define void @unrecognized_method(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i8* @method_str(i32 %5)
%7 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 63
store i8 0, i8* %8
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%10 = call i32 @set_error(i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"unrecognized compression method '%s'\00"
define void @unrecognized_method(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = tail call i8* @method_str(i32 %0)
%5 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 63
store i8 0, i8* %6
%7 = call i32 @set_error(i8* %3)
ret void
}
int validate_int_HR(int hr) { return ((hr < 190) && (hr > 45) ? hr : 0); }


x86 assembly (clang, -O0):
<validate_int_HR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xbe,-0x4(%rbp)
jge    1129 <validate_int_HR+0x29>
cmpl   $0x2d,-0x4(%rbp)
jle    1129 <validate_int_HR+0x29>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <validate_int_HR+0x33>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <validate_int_HR+0x33>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<validate_int_HR>:
lea    -0x2e(%rdi),%ecx
xor    %eax,%eax
cmp    $0x90,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @validate_int_HR(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 190
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 45
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i32, i32* %2
br label %11
10: ; preds = %5, %1
br label %11
11: ; preds = %10, %8
%12 = phi i32 [ %9, %8 ], [ 0, %10 ]
ret i32 %12
}

LLVM IR (-O2):
define i32 @validate_int_HR(i32 %0) {
%2 = add i32 %0, -46
%3 = icmp ult i32 %2, 144
%4 = select i1 %3, i32 %0, i32 0
ret i32 %4
}
void ConvertLinedef(void) {}


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

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

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

LLVM IR (-O2):
define void @ConvertLinedef() {
ret void
}
void RTZipCompDestroy(void) {}


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

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

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

LLVM IR (-O2):
define void @RTZipCompDestroy() {
ret void
}
int do_425() { return 425; }


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

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

LLVM IR (-O0):
define i32 @do_425() {
ret i32 425
}

LLVM IR (-O2):
define i32 @do_425() {
ret i32 425
}
void hg_enter_powersave(void) { ; }


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

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

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

LLVM IR (-O2):
define void @hg_enter_powersave() {
ret void
}
/* Type definitions */
struct struct_automata {
  int dummy;
};

/* Variables and functions */
int *_func_in_move_stat(struct struct_automata *, int *, int *, int *, int,
                        int /*<<< orphan*/);
int *func_in_move_stat(struct struct_automata *p, int *stat_p, int *input_p,
                       int *move_p, int mode) {
  return _func_in_move_stat(p, stat_p, input_p, move_p, mode, 0);
}


x86 assembly (clang, -O0):
<func_in_move_stat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
xor    %r9d,%r9d
call   1030 <_func_in_move_stat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_in_move_stat>:
xor    %r9d,%r9d
jmp    1030 <_func_in_move_stat@plt>

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

LLVM IR (-O2):
%struct.struct_automata = type { i32 }
define i32* @func_in_move_stat(%struct.struct_automata* %0, i32* %1, i32* %2, i32* %3, i32 %4) {
%6 = tail call i32* @_func_in_move_stat(%struct.struct_automata* %0, i32* %1, i32* %2, i32* %3, i32 %4, i32 0)
ret i32* %6
}
/* Variables and functions */
int /*<<< orphan*/ setakpos(int);
void op_setright() { setakpos(1); }


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

x86 assembly (clang, -O2):
<op_setright>:
mov    $0x1,%edi
jmp    1030 <setakpos@plt>

LLVM IR (-O0):
define void @op_setright() {
%1 = call i32 @setakpos(i32 1)
ret void
}

LLVM IR (-O2):
define void @op_setright() {
%1 = tail call i32 @setakpos(i32 1)
ret void
}
void zf(__int128 ct) {
  __int128 *rk = &ct;
  if (0) {
    int jj;
  t9:
    for (jj = 0; jj < 60; ++jj) {
    }
    __builtin_unreachable();
  }
  while (*rk < 1)
    ++*rk;
  goto t9;
}


x86 assembly (clang, -O0):
<zf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
test   $0x1,%al
jne    1133 <zf+0x33>
jmp    115c <zf+0x5c>
jmp    1138 <zf+0x38>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x3c,-0x2c(%rbp)
jge    115c <zf+0x5c>
jmp    114e <zf+0x4e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    113f <zf+0x3f>
jmp    1161 <zf+0x61>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    0x8(%rax),%rcx
xor    %eax,%eax
neg    %rdx
sbb    %rcx,%rax
jl     119e <zf+0x9e>
jmp    117f <zf+0x7f>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdx
mov    0x8(%rax),%rcx
add    $0x1,%rdx
adc    $0x0,%rcx
mov    %rdx,(%rax)
mov    %rcx,0x8(%rax)
jmp    1161 <zf+0x61>
jmp    1138 <zf+0x38>

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @zf(i64 %0, i64 %1) {
%3 = alloca i128
%4 = alloca i128
%5 = alloca i128*
%6 = alloca i32
%7 = bitcast i128* %3 to { i64, i64 }*
%8 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 0
store i64 %0, i64* %8
%9 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %7, i32 0, i32 1
store i64 %1, i64* %9
%10 = load i128, i128* %3
store i128 %10, i128* %4
store i128* %4, i128** %5
br i1 false, label %11, label %21
11: ; preds = %2
br label %12
12: ; preds = %30, %11
store i32 0, i32* %6
br label %13
13: ; preds = %17, %12
%14 = load i32, i32* %6
%15 = icmp slt i32 %14, 60
br i1 %15, label %16, label %20
16: ; preds = %13
br label %17
17: ; preds = %16
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %13
20: ; preds = %13
unreachable
21: ; preds = %2
br label %22
22: ; preds = %26, %21
%23 = load i128*, i128** %5
%24 = load i128, i128* %23
%25 = icmp slt i128 %24, 1
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i128*, i128** %5
%28 = load i128, i128* %27
%29 = add nsw i128 %28, 1
store i128 %29, i128* %27
br label %22
30: ; preds = %22
br label %12
}

LLVM IR (-O2):
unsigned long long zigzagdec63(unsigned long long x) {
  return (x >> 2 | (x & 2) << 62) ^ -(x & 1);
}


x86 assembly (clang, -O0):
<zigzagdec63>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x2,%rax
mov    -0x8(%rbp),%rcx
and    $0x2,%rcx
shl    $0x3e,%rcx
or     %rcx,%rax
mov    -0x8(%rbp),%rdx
and    $0x1,%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzagdec63>:
mov    %rdi,%rcx
rol    $0x3e,%rcx
movabs $0xbfffffffffffffff,%rax
ff ff bf
and    %rcx,%rax
and    $0x1,%edi
neg    %rdi
xor    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @zigzagdec63(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 2
%5 = load i64, i64* %2
%6 = and i64 %5, 2
%7 = shl i64 %6, 62
%8 = or i64 %4, %7
%9 = load i64, i64* %2
%10 = and i64 %9, 1
%11 = sub i64 0, %10
%12 = xor i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @zigzagdec63(i64 %0) {
%2 = lshr i64 %0, 2
%3 = shl i64 %0, 62
%4 = and i64 %3, -9223372036854775808
%5 = or i64 %4, %2
%6 = and i64 %0, 1
%7 = sub nsw i64 0, %6
%8 = xor i64 %5, %7
ret i64 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ InitApp();
int /*<<< orphan*/ set_leds(int /*<<< orphan*/, int, int, int /*<<< orphan*/);
int32_t main(void) {
  InitApp();
  set_leds(0, 1, 1, 0);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <InitApp@plt>
xor    %ecx,%ecx
mov    $0x1,%edx
mov    %ecx,%edi
mov    %edx,%esi
call   1040 <set_leds@plt>
jmp    1146 <main+0x26>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <InitApp@plt>
xor    %edi,%edi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1040 <set_leds@plt>
nopl   0x0(%rax,%rax,1)
jmp    1140 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @InitApp()
%3 = call i32 @set_leds(i32 0, i32 1, i32 1, i32 0)
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @InitApp()
%2 = tail call i32 @set_leds(i32 0, i32 1, i32 1, i32 0)
br label %3
3: ; preds = %0, %3
br label %3
}
__attribute__((pure)) _Complex char foo_char(int x) {
  _Complex char r;
  __real r = x + 1;
  __imag r = x - 1;
  return r;
}


x86 assembly (clang, -O0):
<foo_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0xf(%rbp)
mov    -0x10(%rbp),%cl
mov    -0xf(%rbp),%al
mov    %cl,-0x8(%rbp)
mov    %al,-0x7(%rbp)
mov    -0x8(%rbp),%ax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo_char>:
lea    0x1(%rdi),%eax
shl    $0x8,%edi
movzbl %al,%eax
add    %edi,%eax
add    $0xffffff00,%eax
ret

LLVM IR (-O0):
define i16 @foo_char(i32 %0) {
%2 = alloca { i8, i8 }
%3 = alloca i32
%4 = alloca { i8, i8 }
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = add nsw i32 %5, 1
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %4, i32 0, i32 0
store i8 %7, i8* %8
%9 = load i32, i32* %3
%10 = sub nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %4, i32 0, i32 1
store i8 %11, i8* %12
%13 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %4, i32 0, i32 0
%14 = load i8, i8* %13
%15 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %4, i32 0, i32 1
%16 = load i8, i8* %15
%17 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %2, i32 0, i32 0
%18 = getelementptr inbounds { i8, i8 }, { i8, i8 }* %2, i32 0, i32 1
store i8 %14, i8* %17
store i8 %16, i8* %18
%19 = bitcast { i8, i8 }* %2 to i16*
%20 = load i16, i16* %19
ret i16 %20
}

LLVM IR (-O2):
define i16 @foo_char(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = add i16 %2, 1
%4 = shl i16 %2, 8
%5 = add i16 %4, -256
%6 = and i16 %3, 255
%7 = or i16 %5, %6
ret i16 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ex(void) {
  printf("Ex called!");
  return;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Ex called!\00"
define void @ex() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Ex called!\00"
define void @ex() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *calloc(unsigned int, unsigned int);
int /*<<< orphan*/ no_space();
char *allocate(unsigned n) {
  register char *p;
  p = NULL;
  if (n) {
    p = (calloc((unsigned)(1), (unsigned)(n)));
    if (!p)
      no_space();
  }
  return (p);
}


x86 assembly (clang, -O0):
<allocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1165 <allocate+0x45>
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1160 <allocate+0x40>
mov    $0x0,%al
call   1030 <no_space@plt>
jmp    1165 <allocate+0x45>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate>:
push   %rbx
test   %edi,%edi
je     1144 <allocate+0x24>
mov    %edi,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <allocate+0x26>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <no_space@plt>
jmp    1146 <allocate+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @allocate(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = tail call i8* @calloc(i32 1, i32 %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 (...) @no_space()
br label %8
8: ; preds = %3, %6, %1
%9 = phi i8* [ %4, %3 ], [ null, %6 ], [ null, %1 ]
ret i8* %9
}
int SC68tolower(int c) { return (c < 'A' || c > 'Z') ? c : (c - 'A' + 'a'); }


x86 assembly (clang, -O0):
<SC68tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     111b <SC68tolower+0x1b>
cmpl   $0x5a,-0x4(%rbp)
jle    1126 <SC68tolower+0x26>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <SC68tolower+0x32>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SC68tolower>:
lea    -0x5b(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0xffffffe6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @SC68tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 65
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 90
br i1 %7, label %8, label %10
8: ; preds = %5, %1
%9 = load i32, i32* %2
br label %14
10: ; preds = %5
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 65
%13 = add nsw i32 %12, 97
br label %14
14: ; preds = %10, %8
%15 = phi i32 [ %9, %8 ], [ %13, %10 ]
ret i32 %15
}

LLVM IR (-O2):
define i32 @SC68tolower(i32 %0) {
%2 = add i32 %0, -91
%3 = icmp ult i32 %2, -26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
int match(word, sent)
char *word;
char *sent;
{
  char *str = strstr(sent, word);
  if (str)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1148 <match+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <match+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rax
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %1, i8* dereferenceable(1) %0)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
char *langRomTypeMegaRam512() { return "512kB MegaRAM"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"512kB MegaRAM\00"
define i8* @langRomTypeMegaRam512() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"512kB MegaRAM\00"
define i8* @langRomTypeMegaRam512() {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ lprintf(char *);
void Check_Label() {
  lprintf("\t");
  return;
}


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

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
define void @Check_Label() {
%1 = tail call i32 @lprintf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct EV_IntList {
  int dummy;
};

/* Variables and functions */
scalar_t__ _biggestInList(struct EV_IntList *);
struct EV_IntList *_getIntList();
int /*<<< orphan*/ printf(char *, long);
long _main() {
  struct EV_IntList *EV_list;
  EV_list = _getIntList();
  printf("%ld\n", (long)_biggestInList(EV_list));
  return 0;
}


x86 assembly (clang, -O0):
<_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <_getIntList@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <_biggestInList@plt>
mov    %rax,%rsi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_main>:
push   %rax
xor    %eax,%eax
call   1030 <_getIntList@plt>
mov    %rax,%rdi
call   1050 <_biggestInList@plt>
lea    0xeb9(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.EV_IntList = type { i32 }
@.str = [5 x i8] c"%ld\0A\00"
define i64 @_main() {
%1 = alloca %struct.EV_IntList*
%2 = call %struct.EV_IntList* (...) @_getIntList()
store %struct.EV_IntList* %2, %struct.EV_IntList** %1
%3 = load %struct.EV_IntList*, %struct.EV_IntList** %1
%4 = call i64 @_biggestInList(%struct.EV_IntList* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i64 0
}

LLVM IR (-O2):
%struct.EV_IntList = type { i32 }
@.str = [5 x i8] c"%ld\0A\00"
define i64 @_main() {
%1 = tail call %struct.EV_IntList* (...) @_getIntList()
%2 = tail call i64 @_biggestInList(%struct.EV_IntList* %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 %2)
ret i64 0
}
/* Variables and functions */
int diminuto_ipcl_datagram_peer_generic(char const *);
int diminuto_ipcl_datagram_peer(const char *path) {
  return diminuto_ipcl_datagram_peer_generic(path);
}


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

x86 assembly (clang, -O2):
<diminuto_ipcl_datagram_peer>:
jmp    1030 <diminuto_ipcl_datagram_peer_generic@plt>

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

LLVM IR (-O2):
define i32 @diminuto_ipcl_datagram_peer(i8* %0) {
%2 = tail call i32 @diminuto_ipcl_datagram_peer_generic(i8* %0)
ret i32 %2
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ fatal(char *);
void *ec_calloc(size_t nmemb, size_t size) {
  void *ptr;
  ptr = calloc(nmemb, size);
  if (ptr == NULL)
    fatal("in ec_calloc() on memory allocation");
  return ptr;
}


x86 assembly (clang, -O0):
<ec_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <ec_calloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <fatal@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_calloc>:
push   %rbx
call   1030 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <ec_calloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"in ec_calloc() on memory allocation\00"
define i8* @ec_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @fatal(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i8*, i8** %5
ret i8* %14
}

LLVM IR (-O2):
@.str = [36 x i8] c"in ec_calloc() on memory allocation\00"
define noalias i8* @ec_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @fatal(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
void init_device() {}


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

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

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

LLVM IR (-O2):
define void @init_device() {
ret void
}
int incr(int x) { return x + 1; }


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

x86 assembly (clang, -O2):
<incr>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @incr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
ret i32 %4
}

LLVM IR (-O2):
define i32 @incr(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int test_imm_20uint16_mem(unsigned short *val) {
  return ((*val) & (-0x20 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_20uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffe0,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_20uint16_mem>:
cmpw   $0x20,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_20uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = icmp ult i16 %2, 32
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void f15(void) {
  ({
    goto a;
  a:
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
  0;
}


x86 assembly (clang, -O0):
<f15>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @f15() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __tgt_register_requires(int);
void run_reg_requires() {
  __tgt_register_requires(1);
  __tgt_register_requires(1);
}


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

x86 assembly (clang, -O2):
<run_reg_requires>:
push   %rax
mov    $0x1,%edi
call   1030 <__tgt_register_requires@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <__tgt_register_requires@plt>

LLVM IR (-O0):
define void @run_reg_requires() {
%1 = call i32 @__tgt_register_requires(i32 1)
%2 = call i32 @__tgt_register_requires(i32 1)
ret void
}

LLVM IR (-O2):
define void @run_reg_requires() {
%1 = tail call i32 @__tgt_register_requires(i32 1)
%2 = tail call i32 @__tgt_register_requires(i32 1)
ret void
}