xunge/DecIR huggingface dataset:
int next(int number) {
  int sum = 0;
  while (number != 0) {
    int digit = number % 10;
    number /= 10;
    sum += digit * digit;
  }
  return sum;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <next+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    110e <next+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
xor    %eax,%eax
test   %edi,%edi
je     113e <next+0x3e>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <next+0x10>
ret

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

LLVM IR (-O2):
define i32 @next(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = sdiv i32 %4, 10
%8 = mul nsw i32 %6, %6
%9 = add nuw nsw i32 %8, %5
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %9, %3 ]
ret i32 %13
}
/* Variables and functions */
int f();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i;
  i = f();
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xebd(%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 <f@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *adding, const void *in_tree) {
  return strcmp((char *)adding, (char *)in_tree);
}


x86 assembly (clang, -O0):
<compare>:
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>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @compare(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 i32 @strcmp(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ gen_strnchr(char *, int, int, char *);
int /*<<< orphan*/ init_buff(char *, int const);
int mksym_i32();
char *strnchr(char *, int, int);
void test_strnchr() {
  const int len = 5;
  char s[len];
  init_buff(s, len);
  int c = mksym_i32();
  int n = 4;
  char *res = strnchr(s, n, c);
  gen_strnchr(s, n, c, res);
}


x86 assembly (clang, -O0):
<test_strnchr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x5,-0x4(%rbp)
mov    %rsp,%rax
mov    %rax,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    $0x5,%esi
call   1050 <init_buff@plt>
mov    $0x0,%al
call   1040 <mksym_i32@plt>
mov    %eax,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    -0x30(%rbp),%rdi
call   1030 <strnchr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    -0x30(%rbp),%rdi
call   1060 <gen_strnchr@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strnchr>:
push   %rbp
push   %rbx
push   %rax
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1050 <init_buff@plt>
xor    %eax,%eax
call   1040 <mksym_i32@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1030 <strnchr@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    %rax,%rcx
call   1060 <gen_strnchr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @test_strnchr() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 5, i32* %1
%6 = call i8* @llvm.stacksave()
store i8* %6, i8** %2
%7 = alloca i8, i64 5
%8 = call i32 @init_buff(i8* %7, i32 5)
%9 = call i32 (...) @mksym_i32()
store i32 %9, i32* %3
store i32 4, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %3
%12 = call i8* @strnchr(i8* %7, i32 %10, i32 %11)
store i8* %12, i8** %5
%13 = load i32, i32* %4
%14 = load i32, i32* %3
%15 = load i8*, i8** %5
%16 = call i32 @gen_strnchr(i8* %7, i32 %13, i32 %14, i8* %15)
%17 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @test_strnchr() {
%1 = alloca [5 x i8]
%2 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%3 = call i32 @init_buff(i8* %2, i32 5)
%4 = call i32 (...) @mksym_i32()
%5 = call i8* @strnchr(i8* %2, i32 4, i32 %4)
%6 = call i32 @gen_strnchr(i8* %2, i32 4, i32 %4, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void error(const char *msg) {
  perror(msg);
  exit(0);
}


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

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

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

LLVM IR (-O2):
define void @error(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a[] = {16, 14, 19, 21, 12, 15, 18, 13};
  int *p;
  p = &a[2];
  printf("*p = %d\n", *p);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [8 x i32] [i32 16, i32 14, i32 19, i32 21, i32 12, i32 15, i32 18, i32 13]
@.str = [9 x i8] c"*p = %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = alloca i32*
%3 = bitcast [8 x i32]* %1 to i8*
%4 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 2
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"*p = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 19)
ret i32 0
}
int CheckPrefix(const char *prefix) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @CheckPrefix(i8* nocapture readnone %0) {
ret i32 1
}
int remap_y(int y) {
  if (y == 1) {
    return 0;
  } else if (y == 2) {
    return 3;
  } else {
    return 6;
  }
}


x86 assembly (clang, -O0):
<remap_y>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    111d <remap_y+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    113a <remap_y+0x3a>
cmpl   $0x2,-0x8(%rbp)
jne    1133 <remap_y+0x33>
movl   $0x3,-0x4(%rbp)
jmp    113a <remap_y+0x3a>
movl   $0x6,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap_y>:
xor    %eax,%eax
cmp    $0x2,%edi
setne  %al
lea    (%rax,%rax,2),%ecx
add    $0x3,%ecx
xor    %eax,%eax
cmp    $0x1,%edi
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @remap_y(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i32 3, i32 6
%4 = icmp eq i32 %0, 1
%5 = select i1 %4, i32 0, i32 %3
ret i32 %5
}
/* Variables and functions */
scalar_t__ i2c_write(unsigned char *, int);
int register_write(unsigned char reg, unsigned short data) {
  int rc = -1;
  unsigned char bite[4];
  bite[0] = reg;
  bite[1] = (data >> 8) & 0xFF;
  bite[2] = (data & 0xFF);
  if (i2c_write(bite, 3) == 0) {
    rc = 0;
  }
  return rc;
}


x86 assembly (clang, -O0):
<register_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0xc(%rbp)
movzwl -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,-0xb(%rbp)
movzwl -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0xa(%rbp)
lea    -0xc(%rbp),%rdi
mov    $0x3,%esi
call   1030 <i2c_write@plt>
cmp    $0x0,%rax
jne    116c <register_write+0x5c>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_write>:
push   %rax
mov    %esi,%eax
mov    %dil,0x4(%rsp)
mov    %ah,0x5(%rsp)
mov    %al,0x6(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x3,%esi
call   1030 <i2c_write@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @register_write(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca i8
%4 = alloca i16
%5 = alloca i32
%6 = alloca [4 x i8]
store i8 %0, i8* %3
store i16 %1, i16* %4
store i32 -1, i32* %5
%7 = load i8, i8* %3
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i16, i16* %4
%10 = zext i16 %9 to i32
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
store i8 %13, i8* %14
%15 = load i16, i16* %4
%16 = zext i16 %15 to i32
%17 = and i32 %16, 255
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
store i8 %18, i8* %19
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%21 = call i64 @i2c_write(i8* %20, i32 3)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %2
store i32 0, i32* %5
br label %24
24: ; preds = %23, %2
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @register_write(i8 zeroext %0, i16 zeroext %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
store i8 %0, i8* %4
%5 = lshr i16 %1, 8
%6 = trunc i16 %5 to i8
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %6, i8* %7
%8 = trunc i16 %1 to i8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %8, i8* %9
%10 = call i64 @i2c_write(i8* %4, i32 3)
%11 = icmp ne i64 %10, 0
%12 = sext i1 %11 to i32
ret i32 %12
}
int main() {
  int x = 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
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 1, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct stat {
  int st_size;
};
typedef int int64_t;

/* Variables and functions */
scalar_t__ EOVERFLOW;
scalar_t__ errno;
int stat(char const *, struct stat *);
int64_t file_length(const char *file_name) {
  struct stat s;
  int r;
  r = stat(file_name, &s);
  if (r == 0)
    return s.st_size;
  if (errno == EOVERFLOW)
    return 0x7fffffff;
  return -1;
}


x86 assembly (clang, -O0):
<file_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    1141 <file_length+0x31>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116e <file_length+0x5e>
mov    0x2e90(%rip),%rax
mov    (%rax),%rax
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
jne    1167 <file_length+0x57>
movl   $0x7fffffff,-0x4(%rbp)
jmp    116e <file_length+0x5e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_length>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
je     1140 <file_length+0x30>
mov    0x2eb4(%rip),%rax
mov    (%rax),%rax
mov    0x2ec2(%rip),%rcx
cmp    (%rcx),%rax
mov    $0x7fffffff,%ecx
mov    $0xffffffff,%eax
cmove  %ecx,%eax
pop    %rcx
ret
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@errno = global i64 0
@EOVERFLOW = global i64 0
define i32 @file_length(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %19
13: ; preds = %1
%14 = load i64, i64* @errno
%15 = load i64, i64* @EOVERFLOW
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 2147483647, i32* %2
br label %19
18: ; preds = %13
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %17, %10
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@errno = global i64 0
@EOVERFLOW = global i64 0
define i32 @file_length(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
br label %14
9: ; preds = %1
%10 = load i64, i64* @errno
%11 = load i64, i64* @EOVERFLOW
%12 = icmp eq i64 %10, %11
%13 = select i1 %12, i32 2147483647, i32 -1
br label %14
14: ; preds = %9, %6
%15 = phi i32 [ %8, %6 ], [ %13, %9 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_error_footer() { printf("\n!!!!!!!!! E R R O R !!!!!!!!!\n\n"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"\0A!!!!!!!!! E R R O R !!!!!!!!!\0A\0A\00"
define void @print_error_footer() {
%1 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [32 x i8] c"\0A!!!!!!!!! E R R O R !!!!!!!!!\0A\00"
define void @print_error_footer() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fgetc(int /*<<< orphan*/ *);
int getc(FILE *stream) { return (fgetc(stream)); }


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

x86 assembly (clang, -O2):
<getc>:
jmp    1030 <fgetc@plt>

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

LLVM IR (-O2):
define i32 @getc(i32* nocapture %0) {
%2 = tail call i32 @fgetc(i32* %0)
ret i32 %2
}
extern void extern_extern_prepostdeclared(void) {}


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

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

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

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

/* Variables and functions */
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ perror(char *);
int Bind(int sockfd, struct sockaddr *my_addr, int addrlen) {
  if (bind(sockfd, my_addr, addrlen) < 0) {
    perror("Bind() error");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<Bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <bind@plt>
cmp    $0x0,%rax
jge    1163 <Bind+0x43>
lea    0xeae(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <Bind+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bind>:
push   %rax
call   1030 <bind@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
js     1132 <Bind+0x12>
pop    %rcx
ret
lea    0xec7(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [13 x i8] c"Bind() error\00"
define i32 @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i64 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ -1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ __setCHRBank6Low(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ vrc2_4_SetChrROMBank6();
void vrc2_4_setParamsEXX0(uint16_t addr, uint8_t val) {
  __setCHRBank6Low(addr, val);
  vrc2_4_SetChrROMBank6();
}


x86 assembly (clang, -O0):
<vrc2_4_setParamsEXX0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <__setCHRBank6Low@plt>
mov    $0x0,%al
call   1040 <vrc2_4_SetChrROMBank6@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @vrc2_4_setParamsEXX0(i32 %0, i32 %1) {
%3 = tail call i32 @__setCHRBank6Low(i32 %0, i32 %1)
%4 = tail call i32 (...) @vrc2_4_SetChrROMBank6()
ret void
}
int findweek(int yday, int startday, int today) {
  int days_into_this_week = today - startday;
  int last_weekstart;
  if (days_into_this_week < 0)
    days_into_this_week += 7;
  last_weekstart = yday - days_into_this_week;
  if (last_weekstart <= 0)
    return 1;
  return last_weekstart / 7 + 1;
}


x86 assembly (clang, -O0):
<findweek>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1129 <findweek+0x29>
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1148 <findweek+0x48>
movl   $0x1,-0x4(%rbp)
jmp    1159 <findweek+0x59>
mov    -0x18(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findweek>:
mov    %edi,%eax
sub    %esi,%edx
lea    0x7(%rdx),%ecx
test   %edx,%edx
cmovns %edx,%ecx
sub    %ecx,%eax
jle    112a <findweek+0x2a>
mov    %eax,%ecx
imul   $0x24924925,%rcx,%rcx
shr    $0x20,%rcx
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x2,%eax
add    $0x1,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @findweek(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = icmp slt i32 %4, 0
%6 = add nsw i32 %4, 7
%7 = select i1 %5, i32 %6, i32 %4
%8 = sub nsw i32 %0, %7
%9 = icmp slt i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = udiv i32 %8, 7
%12 = add nuw nsw i32 %11, 1
br label %13
13: ; preds = %3, %10
%14 = phi i32 [ %12, %10 ], [ 1, %3 ]
ret i32 %14
}
int __max_int(int x, int y) { return ((x) > (y) ? (x) : (y)); }


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

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

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

LLVM IR (-O2):
define i32 @__max_int(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
void f2(int size) {
  void *ptr = malloc(size);
  free(ptr);
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
call   1040 <malloc@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @f2(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
define void @f2(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ mp_decode_extl(char const **, int /*<<< orphan*/ *);
const char *mp_decode_ext(const char **data, int8_t *type, uint32_t *len) {
  assert(len != NULL);
  *len = mp_decode_extl(data, type);
  const char *str = *data;
  *data += *len;
  return str;
}


x86 assembly (clang, -O0):
<mp_decode_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <mp_decode_extl@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
movslq %edx,%rdx
add    %rdx,%rcx
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp_decode_ext>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rdx,%rdx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <mp_decode_extl@plt>
mov    %eax,(%r15)
mov    (%rbx),%rcx
cltq
add    %rcx,%rax
mov    %rax,(%rbx)
mov    %rcx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @mp_decode_ext(i8** %0, i32* %1, i32* %2) {
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
store i8** %0, i8*** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = icmp ne i32* %8, null
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load i8**, i8*** %4
%13 = load i32*, i32** %5
%14 = call i32 @mp_decode_extl(i8** %12, i32* %13)
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
store i8* %17, i8** %7
%18 = load i32*, i32** %6
%19 = load i32, i32* %18
%20 = load i8**, i8*** %4
%21 = load i8*, i8** %20
%22 = sext i32 %19 to i64
%23 = getelementptr inbounds i8, i8* %21, i64 %22
store i8* %23, i8** %20
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
define i8* @mp_decode_ext(i8** %0, i32* %1, i32* writeonly %2) {
%4 = icmp ne i32* %2, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @mp_decode_extl(i8** %0, i32* %1)
store i32 %7, i32* %2
%8 = load i8*, i8** %0
%9 = sext i32 %7 to i64
%10 = getelementptr inbounds i8, i8* %8, i64 %9
store i8* %10, i8** %0
ret i8* %8
}
int cmp_wordhashdata(const void *s1, const void *s2) {
  long *i = (long *)s1;
  long *j = (long *)s2;
  long d = (*i - *j);
  if (d == (long)0)
    return 0;
  else if (d > (long)0)
    return 1;
  else
    return -1;
}


x86 assembly (clang, -O0):
<cmp_wordhashdata>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    -0x28(%rbp),%rcx
sub    (%rcx),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1145 <cmp_wordhashdata+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1163 <cmp_wordhashdata+0x63>
cmpq   $0x0,-0x30(%rbp)
jle    115c <cmp_wordhashdata+0x5c>
movl   $0x1,-0x4(%rbp)
jmp    1163 <cmp_wordhashdata+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_wordhashdata>:
mov    (%rdi),%rax
mov    (%rsi),%rcx
mov    %rax,%rdx
sub    %rcx,%rdx
xor    %esi,%esi
test   %rdx,%rdx
setg   %sil
xor    %edx,%edx
cmp    %rcx,%rax
lea    -0x1(%rsi,%rsi,1),%eax
cmove  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_wordhashdata(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = icmp eq i64 %7, 0
%9 = icmp sgt i64 %7, 0
%10 = select i1 %9, i32 1, i32 -1
%11 = select i1 %8, i32 0, i32 %10
ret i32 %11
}
/* Variables and functions */
char *ctermid(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char string[16];
  char *rs = ctermid(string);
  if (rs) {
    printf("%s\n", rs);
    printf("%s\n", string);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <ctermid@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1167 <main+0x47>
mov    -0x28(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsp,%rdi
call   1040 <ctermid@plt>
test   %rax,%rax
je     114f <main+0x2f>
lea    0xec7(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i8* @ctermid(i8* %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %0
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %8
8: ; preds = %5, %0
ret i32 0
}
void *test_anti_range_54(int n) {
  extern void *alloc_anti_range_54(int) __attribute__((alloc_size(1)));
  if (0x7fffffff - 1 <= n && n <= 0x7fffffff - 1)
    n = 0x7fffffff - 1 - 1;
  return alloc_anti_range_54(n);
}


x86 assembly (clang, -O0):
<test_anti_range_54>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7ffffffe,%eax
cmp    -0x4(%rbp),%eax
jg     113d <test_anti_range_54+0x2d>
cmpl   $0x7ffffffe,-0x4(%rbp)
jg     113d <test_anti_range_54+0x2d>
movl   $0x7ffffffd,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <alloc_anti_range_54@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_anti_range_54>:
cmp    $0x7ffffffe,%edi
mov    $0x7ffffffd,%eax
cmove  %eax,%edi
jmp    1030 <alloc_anti_range_54@plt>

LLVM IR (-O0):
define i8* @test_anti_range_54(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 2147483646, %3
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 2147483646
br i1 %7, label %8, label %9
8: ; preds = %5
store i32 2147483645, i32* %2
br label %9
9: ; preds = %8, %5, %1
%10 = load i32, i32* %2
%11 = call i8* @alloc_anti_range_54(i32 %10)
ret i8* %11
}

LLVM IR (-O2):
define i8* @test_anti_range_54(i32 %0) {
%2 = icmp eq i32 %0, 2147483646
%3 = select i1 %2, i32 2147483645, i32 %0
%4 = tail call i8* @alloc_anti_range_54(i32 %3)
ret i8* %4
}
int *foo(int *p) { return p + 4; }


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

x86 assembly (clang, -O2):
<foo>:
lea    0x10(%rdi),%rax
ret

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

LLVM IR (-O2):
define i32* @foo(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 4
ret i32* %2
}
/* Variables and functions */
unsigned int *returnUnsignedArray();
int nonnegative_array() {
  unsigned int *a = returnUnsignedArray();
  if (a[0] < 0) {
    int y = 1 / 0;
  }
}


x86 assembly (clang, -O0):
<nonnegative_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <returnUnsignedArray@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jae    1133 <nonnegative_array+0x23>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @nonnegative_array() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = call i32* (...) @returnUnsignedArray()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = icmp ult i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 poison, i32* %3
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @nonnegative_array() {
%1 = tail call i32* (...) @returnUnsignedArray()
ret i32 undef
}
/* Variables and functions */
void *compare_size_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_size_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_size_context() {
ret i8* null
}
/* Variables and functions */
int sqrt2(int);
int sqrt1(int x) { return sqrt2(x); }


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

x86 assembly (clang, -O2):
<sqrt1>:
jmp    1030 <sqrt2@plt>

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

LLVM IR (-O2):
define i32 @sqrt1(i32 %0) {
%2 = tail call i32 @sqrt2(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ marshallInt(int const, unsigned char **);
int /*<<< orphan*/ safeWrite(int const, unsigned char *, int);
void WriteInt(int const socketFd, int const value) {
  unsigned char buffer[4];
  marshallInt(value, &buffer);
  safeWrite(socketFd, buffer, sizeof(buffer));
}


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

x86 assembly (clang, -O2):
<WriteInt>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <marshallInt@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <safeWrite@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @WriteInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [4 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = bitcast [4 x i8]* %5 to i8**
%8 = call i32 @marshallInt(i32 %6, i8** %7)
%9 = load i32, i32* %3
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%11 = call i32 @safeWrite(i32 %9, i8* %10, i32 4)
ret void
}

LLVM IR (-O2):
define void @WriteInt(i32 %0, i32 %1) {
%3 = alloca [4 x i8]
%4 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%5 = bitcast [4 x i8]* %3 to i8**
%6 = call i32 @marshallInt(i32 %1, i8** %5)
%7 = call i32 @safeWrite(i32 %0, i8* %4, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_average_and_max();
int /*<<< orphan*/ get_variation();
int /*<<< orphan*/ init();
int /*<<< orphan*/ output();
int main() {
  init();
  get_average_and_max();
  get_variation();
  output();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <init@plt>
xor    %eax,%eax
call   1060 <get_average_and_max@plt>
xor    %eax,%eax
call   1040 <get_variation@plt>
xor    %eax,%eax
call   1030 <output@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @init()
%3 = call i32 (...) @get_average_and_max()
%4 = call i32 (...) @get_variation()
%5 = call i32 (...) @output()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @init()
%2 = tail call i32 (...) @get_average_and_max()
%3 = tail call i32 (...) @get_variation()
%4 = tail call i32 (...) @output()
ret i32 0
}
void shiftBag(int *doubleBag) {
  int i;
  for (i = 0; i < 13; i++) {
    doubleBag[i] = doubleBag[i + 1];
  }
  doubleBag[i] = -1;
}


x86 assembly (clang, -O0):
<shiftBag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xd,-0xc(%rbp)
jge    1142 <shiftBag+0x42>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <shiftBag+0xf>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0xffffffff,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<shiftBag>:
movups 0x4(%rdi),%xmm0
movups 0x14(%rdi),%xmm1
movups 0x24(%rdi),%xmm2
movups %xmm0,(%rdi)
movups %xmm1,0x10(%rdi)
movups %xmm2,0x20(%rdi)
mov    0x34(%rdi),%eax
mov    %eax,0x30(%rdi)
movl   $0xffffffff,0x34(%rdi)
ret

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

LLVM IR (-O2):
define void @shiftBag(i32* nocapture %0) {
%2 = bitcast i32* %0 to i8*
%3 = getelementptr i32, i32* %0, i64 1
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds i32, i32* %0, i64 13
store i32 -1, i32* %5
ret void
}
void test_43_2(int *mem) { __atomic_nand_fetch(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_43_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x28(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1150 <test_43_2+0x50>
jmp    1122 <test_43_2+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
and    %ecx,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_43_2>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_43_2+0x10>
ret

LLVM IR (-O0):
define void @test_43_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 -1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw nand i32* %5, i32 %6 acq_rel
%8 = and i32 %7, %6
%9 = xor i32 %8, -1
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test_43_2(i32* nocapture %0) {
%2 = atomicrmw nand i32* %0, i32 -1 acq_rel
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int skip(FILE *f, char end) {
  int c;
  while (((c = fgetc(f)) != end) && (c != EOF)) {
    continue;
  }
  if (c == EOF)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<skip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
movsbl -0x11(%rbp),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x19(%rbp)
je     1153 <skip+0x43>
mov    -0x18(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1163 <skip+0x53>
jmp    1168 <skip+0x58>
jmp    1122 <skip+0x12>
mov    -0x18(%rbp),%eax
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%eax
jne    1186 <skip+0x76>
movl   $0x1,-0x4(%rbp)
jmp    118d <skip+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2ec8(%rip),%r14
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    (%r14),%edx
cmp    %ebp,%eax
je     1133 <skip+0x23>
cmp    %edx,%eax
jne    1120 <skip+0x10>
xor    %ecx,%ecx
cmp    %edx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip(i32* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i32
store i32* %0, i32** %4
store i8 %1, i8* %5
br label %7
7: ; preds = %19, %2
%8 = load i32*, i32** %4
%9 = call i32 @fgetc(i32* %8)
store i32 %9, i32* %6
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %9, %11
br i1 %12, label %13, label %17
13: ; preds = %7
%14 = load i32, i32* %6
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
br label %17
17: ; preds = %13, %7
%18 = phi i1 [ false, %7 ], [ %16, %13 ]
br i1 %18, label %19, label %20
19: ; preds = %17
br label %7
20: ; preds = %17
%21 = load i32, i32* %6
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skip(i32* nocapture %0, i8 signext %1) {
%3 = sext i8 %1 to i32
br label %4
4: ; preds = %4, %2
%5 = tail call i32 @fgetc(i32* %0)
%6 = icmp ne i32 %5, %3
%7 = load i32, i32* @EOF
%8 = icmp ne i32 %5, %7
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %4, label %10
10: ; preds = %4
%11 = icmp eq i32 %5, %7
%12 = zext i1 %11 to i32
ret i32 %12
}
c() { return 'c'; }


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

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

LLVM IR (-O0):
define i32 @c() {
ret i32 99
}

LLVM IR (-O2):
define i32 @c() {
ret i32 99
}
void INT_Excep_PERIB_INTB154(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB154() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bytes_per_line;
};
typedef TYPE_1__ XImage;

/* Variables and functions */
int get_XImage_bytes_per_line(void *_p) {
  return (int)((XImage *)_p)->bytes_per_line;
}


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

x86 assembly (clang, -O2):
<get_XImage_bytes_per_line>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XImage_bytes_per_line(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XImage_bytes_per_line(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}