#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ pan(long long);
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int);
int sum(int, int);
int three(long long, int);
int prop(long long n) {
  if (!pan(n))
    return 0;
  int p2 = three(n, 2);
  int t2 = sum(p2, 0);
  int t3 = sum(three(n, 3), 1);
  int t4 = sum(three(n, 4), 2);
  int t5 = sum(three(n, 5), 3);
  int t6 = sum(three(n, 6), 4);
  int t7 = sum(three(n, 7), 5);
  int t8 = sum(three(n, 8), 6);
  printf("%d:%d %d %d %d %d %d %d\n", p2, t2, t3, t4, t5, t6, t7, t8);
  return t2 && t3 && t4 && t5 && t6 && t7 && t8;
}


x86 assembly (clang, -O0):
<prop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <pan@plt>
cmp    $0x0,%eax
jne    116a <prop+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    12da <prop+0x19a>
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1060 <three@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1040 <sum@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <sum@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <sum@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x5,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x6,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <sum@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <sum@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1040 <sum@plt>
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    -0x28(%rbp),%r11d
mov    -0x2c(%rbp),%r10d
mov    -0x30(%rbp),%eax
lea    0xda7(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x31(%rbp)
je     12cf <prop+0x18f>
xor    %eax,%eax
cmpl   $0x0,-0x1c(%rbp)
mov    %al,-0x31(%rbp)
je     12cf <prop+0x18f>
xor    %eax,%eax
cmpl   $0x0,-0x20(%rbp)
mov    %al,-0x31(%rbp)
je     12cf <prop+0x18f>
xor    %eax,%eax
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x31(%rbp)
je     12cf <prop+0x18f>
xor    %eax,%eax
cmpl   $0x0,-0x28(%rbp)
mov    %al,-0x31(%rbp)
je     12cf <prop+0x18f>
xor    %eax,%eax
cmpl   $0x0,-0x2c(%rbp)
mov    %al,-0x31(%rbp)
je     12cf <prop+0x18f>
cmpl   $0x0,-0x30(%rbp)
setne  %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prop>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
call   1050 <pan@plt>
test   %eax,%eax
je     129b <prop+0x15b>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1060 <three@plt>
mov    %eax,%r12d
mov    %eax,%edi
xor    %esi,%esi
call   1040 <sum@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
mov    $0x3,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1040 <sum@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
mov    $0x4,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1040 <sum@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x5,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x3,%esi
call   1040 <sum@plt>
mov    %eax,0x4(%rsp)
mov    %rbx,%rdi
mov    $0x6,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <sum@plt>
mov    %rax,0x10(%rsp)
mov    %rbx,%rdi
mov    $0x7,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x5,%esi
call   1040 <sum@plt>
mov    %eax,%r15d
mov    %r15,0x8(%rsp)
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <three@plt>
mov    %eax,%edi
mov    $0x6,%esi
call   1040 <sum@plt>
mov    %eax,%ebx
sub    $0x8,%rsp
lea    0xdcd(%rip),%rdi
mov    %r12d,%esi
mov    %r13d,%r12d
mov    %r13d,%edx
mov    %r14d,%r13d
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    0xc(%rsp),%r14d
mov    %r14d,%r9d
push   %rbx
push   %r15
mov    0x28(%rsp),%r15
push   %r15
call   1030 <printf@plt>
add    $0x20,%rsp
test   %r12d,%r12d
setne  %al
test   %r13d,%r13d
setne  %cl
and    %al,%cl
test   %ebp,%ebp
setne  %al
test   %r14d,%r14d
setne  %dl
and    %al,%dl
and    %cl,%dl
test   %r15d,%r15d
setne  %al
cmpl   $0x0,0x8(%rsp)
setne  %cl
and    %al,%cl
test   %ebx,%ebx
setne  %al
and    %cl,%al
and    %dl,%al
movzbl %al,%eax
jmp    129d <prop+0x15d>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"%d:%d %d %d %d %d %d %d\0A\00"
define i32 @prop(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i64 %0, i64* %3
%12 = load i64, i64* %3
%13 = call i32 @pan(i64 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %1
store i32 0, i32* %2
br label %71
16: ; preds = %1
%17 = load i64, i64* %3
%18 = call i32 @three(i64 %17, i32 2)
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = call i32 @sum(i32 %19, i32 0)
store i32 %20, i32* %5
%21 = load i64, i64* %3
%22 = call i32 @three(i64 %21, i32 3)
%23 = call i32 @sum(i32 %22, i32 1)
store i32 %23, i32* %6
%24 = load i64, i64* %3
%25 = call i32 @three(i64 %24, i32 4)
%26 = call i32 @sum(i32 %25, i32 2)
store i32 %26, i32* %7
%27 = load i64, i64* %3
%28 = call i32 @three(i64 %27, i32 5)
%29 = call i32 @sum(i32 %28, i32 3)
store i32 %29, i32* %8
%30 = load i64, i64* %3
%31 = call i32 @three(i64 %30, i32 6)
%32 = call i32 @sum(i32 %31, i32 4)
store i32 %32, i32* %9
%33 = load i64, i64* %3
%34 = call i32 @three(i64 %33, i32 7)
%35 = call i32 @sum(i32 %34, i32 5)
store i32 %35, i32* %10
%36 = load i64, i64* %3
%37 = call i32 @three(i64 %36, i32 8)
%38 = call i32 @sum(i32 %37, i32 6)
store i32 %38, i32* %11
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = load i32, i32* %8
%44 = load i32, i32* %9
%45 = load i32, i32* %10
%46 = load i32, i32* %11
%47 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %39, i32 %40, i32 %41, i32 %42, i32 %43, i32 %44, i32 %45, i32 %46)
%48 = load i32, i32* %5
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %68
50: ; preds = %16
%51 = load i32, i32* %6
%52 = icmp ne i32 %51, 0
br i1 %52, label %53, label %68
53: ; preds = %50
%54 = load i32, i32* %7
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %68
56: ; preds = %53
%57 = load i32, i32* %8
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i32, i32* %9
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %68
62: ; preds = %59
%63 = load i32, i32* %10
%64 = icmp ne i32 %63, 0
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = load i32, i32* %11
%67 = icmp ne i32 %66, 0
br label %68
68: ; preds = %65, %62, %59, %56, %53, %50, %16
%69 = phi i1 [ false, %62 ], [ false, %59 ], [ false, %56 ], [ false, %53 ], [ false, %50 ], [ false, %16 ], [ %67, %65 ]
%70 = zext i1 %69 to i32
store i32 %70, i32* %2
br label %71
71: ; preds = %68, %15
%72 = load i32, i32* %2
ret i32 %72
}

LLVM IR (-O2):
@.str = [25 x i8] c"%d:%d %d %d %d %d %d %d\0A\00"
define i32 @prop(i64 %0) {
%2 = tail call i32 @pan(i64 %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %34, label %4
4: ; preds = %1
%5 = tail call i32 @three(i64 %0, i32 2)
%6 = tail call i32 @sum(i32 %5, i32 0)
%7 = tail call i32 @three(i64 %0, i32 3)
%8 = tail call i32 @sum(i32 %7, i32 1)
%9 = tail call i32 @three(i64 %0, i32 4)
%10 = tail call i32 @sum(i32 %9, i32 2)
%11 = tail call i32 @three(i64 %0, i32 5)
%12 = tail call i32 @sum(i32 %11, i32 3)
%13 = tail call i32 @three(i64 %0, i32 6)
%14 = tail call i32 @sum(i32 %13, i32 4)
%15 = tail call i32 @three(i64 %0, i32 7)
%16 = tail call i32 @sum(i32 %15, i32 5)
%17 = tail call i32 @three(i64 %0, i32 8)
%18 = tail call i32 @sum(i32 %17, i32 6)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14, i32 %16, i32 %18)
%20 = icmp ne i32 %6, 0
%21 = icmp ne i32 %8, 0
%22 = select i1 %20, i1 %21, i1 false
%23 = icmp ne i32 %10, 0
%24 = select i1 %22, i1 %23, i1 false
%25 = icmp ne i32 %12, 0
%26 = select i1 %24, i1 %25, i1 false
%27 = icmp ne i32 %14, 0
%28 = select i1 %26, i1 %27, i1 false
%29 = icmp ne i32 %16, 0
%30 = select i1 %28, i1 %29, i1 false
%31 = icmp ne i32 %18, 0
%32 = and i1 %30, %31
%33 = zext i1 %32 to i32
br label %34
34: ; preds = %1, %4
%35 = phi i32 [ %33, %4 ], [ 0, %1 ]
ret i32 %35
}