#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int niggers, sum = 0;
  while (sum != 12) {
    do
      scanf("%d", &niggers);
    while (niggers < 0 || niggers > 12);
    sum += niggers;
    if (sum > 12) {
      printf("Error:\n");
      return -1;
    }
  }
  printf("OK!Tickets sold out :>3\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
je     11a9 <main+0x89>
jmp    1145 <main+0x25>
lea    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     116e <main+0x4e>
cmpl   $0xc,-0x8(%rbp)
setg   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1145 <main+0x25>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xc,-0xc(%rbp)
jle    11a4 <main+0x84>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bc <main+0x9c>
jmp    1136 <main+0x16>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
lea    0xece(%rip),%r12
lea    0xec4(%rip),%rbp
lea    0x4(%rsp),%rbx
lea    0xed3(%rip),%r15
xor    %r13d,%r13d
nopl   0x0(%rax,%rax,1)
cmp    $0xc,%r13d
je     1185 <main+0x65>
cs nopw 0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0xc,%eax
ja     1160 <main+0x40>
add    %eax,%r13d
cmp    $0xd,%r13d
jl     1150 <main+0x30>
mov    $0xffffffff,%r14d
jmp    1188 <main+0x68>
mov    %r12,%r15
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Error:\0A\00"
@.str.2 = [25 x i8] c"OK!Tickets sold out :>3\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
br label %4
4: ; preds = %26, %0
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 12
br i1 %6, label %7, label %27
7: ; preds = %4
br label %8
8: ; preds = %16, %7
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %10
10: ; preds = %8
%11 = load i32, i32* %2
%12 = icmp slt i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %10
%14 = load i32, i32* %2
%15 = icmp sgt i32 %14, 12
br label %16
16: ; preds = %13, %10
%17 = phi i1 [ true, %10 ], [ %15, %13 ]
br i1 %17, label %8, label %18
18: ; preds = %16
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = add nsw i32 %20, %19
store i32 %21, i32* %3
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 12
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %1
br label %29
26: ; preds = %18
br label %4
27: ; preds = %4
%28 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %29
29: ; preds = %27, %24
%30 = load i32, i32* %1
ret i32 %30
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [24 x i8] c"OK!Tickets sold out :>3\00"
@str.3 = [7 x i8] c"Error:\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %10, %0
%4 = phi i32 [ 0, %0 ], [ %11, %10 ]
%5 = icmp eq i32 %4, 12
br i1 %5, label %13, label %6
6: ; preds = %3, %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp ugt i32 %8, 12
br i1 %9, label %6, label %10
10: ; preds = %6
%11 = add nsw i32 %8, %4
%12 = icmp sgt i32 %11, 12
br i1 %12, label %13, label %3
13: ; preds = %3, %10
%14 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0), %10 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0), %3 ]
%15 = phi i32 [ -1, %10 ], [ 0, %3 ]
%16 = call i32 @puts(i8* dereferenceable(1) %14)
ret i32 %15
}