#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *, ...);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  FILE *infile;
  int numSites;
  int i;
  int m1, m2, m3;
  infile = fopen("oldman.in", "r");
  fscanf(infile, "%d", &numSites);
  for (i = 0; i < numSites; i++) {
    fscanf(infile, "%d %d %d", &m1, &m2, &m3);
    printf("Set #%d: ", i + 1);
    if ((m1 == m2) && (m1 == m3) && (m2 == m3))
      printf("Sorry, too flat.\n");
    else
      printf("Shows potential!\n");
  }
  fclose(infile);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    0xead(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea1(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1050 <fscanf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1219 <main+0xd9>
mov    -0x10(%rbp),%rdi
lea    0xe72(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%esi
add    $0x1,%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    11f8 <main+0xb8>
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    11f8 <main+0xb8>
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jne    11f8 <main+0xb8>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1206 <main+0xc6>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120b <main+0xcb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1183 <main+0x43>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9b(%rip),%rdi
lea    0xe9e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
lea    0xe97(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1202 <main+0xb2>
lea    0xc(%rsp),%r13
lea    0xe78(%rip),%rbp
lea    0xe8c(%rip),%r15
lea    0xe74(%rip),%r12
xor    %r14d,%r14d
xchg   %ax,%ax
mov    %rbx,%rdi
lea    0xe52(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %r13,%r8
xor    %eax,%eax
call   1060 <fscanf@plt>
add    $0x1,%r14d
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
xor    %eax,%ecx
xor    0xc(%rsp),%eax
or     %ecx,%eax
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
cmp    0x8(%rsp),%r14d
jl     11b0 <main+0x60>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"oldman.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [9 x i8] c"%d %d %d\00"
@.str.4 = [10 x i8] c"Set #%d: \00"
@.str.5 = [18 x i8] c"Sorry, too flat.\0A\00"
@.str.6 = [18 x i8] c"Shows potential!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %2
%9 = load i32*, i32** %2
%10 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
store i32 0, i32* %4
br label %11
11: ; preds = %37, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %40
15: ; preds = %11
%16 = load i32*, i32** %2
%17 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32* %5, i32* %6, i32* %7)
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %34
24: ; preds = %15
%25 = load i32, i32* %5
%26 = load i32, i32* %7
%27 = icmp eq i32 %25, %26
br i1 %27, label %28, label %34
28: ; preds = %24
%29 = load i32, i32* %6
%30 = load i32, i32* %7
%31 = icmp eq i32 %29, %30
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
br label %36
34: ; preds = %28, %24, %15
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
br label %37
37: ; preds = %36
%38 = load i32, i32* %4
%39 = add nsw i32 %38, 1
store i32 %39, i32* %4
br label %11
40: ; preds = %11
%41 = load i32*, i32** %2
%42 = call i32 @fclose(i32* %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"oldman.in\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [9 x i8] c"%d %d %d\00"
@.str.4 = [10 x i8] c"Set #%d: \00"
@str = [17 x i8] c"Shows potential!\00"
@str.7 = [17 x i8] c"Sorry, too flat.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %0, %13
%14 = phi i32 [ %16, %13 ], [ 0, %0 ]
%15 = call i32 (i32*, i8*, i32*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%16 = add nuw nsw i32 %14, 1
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp eq i32 %18, %19
%21 = load i32, i32* %4
%22 = icmp eq i32 %18, %21
%23 = select i1 %20, i1 %22, i1 false
%24 = select i1 %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str.7, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0)
%25 = call i32 @puts(i8* dereferenceable(1) %24)
%26 = load i32, i32* %1
%27 = icmp slt i32 %16, %26
br i1 %27, label %13, label %28
28: ; preds = %13, %0
%29 = call i32 @fclose(i32* %9)
ret i32 0
}