#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*/ find_pairs(int);
int /*<<< orphan*/ printf(char *);
int scanf(char *, int *);
int main(int argc, char **argv) {
  int n;
  int rc;
  if ((rc = scanf("%d", &n)) != 1) {
    return (1);
  }
  int first = 0;
  while (n != 0) {
    if (first == 1) {
      printf("\n");
    }
    first = 1;
    find_pairs(n);
    if ((rc = scanf("%d", &n)) != 1) {
      return (1);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x1,%eax
je     116e <main+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    11d1 <main+0xa1>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     11d1 <main+0xa1>
cmpl   $0x1,-0x1c(%rbp)
jne    1195 <main+0x65>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <find_pairs@plt>
lea    0xe55(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x1,%eax
je     11cc <main+0x9c>
movl   $0x1,-0x4(%rbp)
jmp    11d1 <main+0xa1>
jmp    1175 <main+0x45>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    $0x1,%r14d
cmp    $0x1,%eax
jne    11a7 <main+0x77>
xor    %ecx,%ecx
lea    0xea3(%rip),%rbx
lea    0xc(%rsp),%rbp
jmp    1187 <main+0x57>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <find_pairs@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    $0x1,%cl
cmp    $0x1,%eax
jne    11a7 <main+0x77>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     11a4 <main+0x74>
test   $0x1,%cl
je     1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0xc(%rsp),%edi
jmp    1170 <main+0x40>
xor    %r14d,%r14d
mov    %r14d,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %20
7: ; preds = %2, %15
%8 = phi i1 [ true, %15 ], [ false, %2 ]
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %20, label %11
11: ; preds = %7
br i1 %8, label %12, label %15
12: ; preds = %11
%13 = call i32 @putchar(i32 10)
%14 = load i32, i32* %3
br label %15
15: ; preds = %12, %11
%16 = phi i32 [ %14, %12 ], [ %9, %11 ]
%17 = call i32 @find_pairs(i32 %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%19 = icmp eq i32 %18, 1
br i1 %19, label %7, label %20
20: ; preds = %15, %7, %2
%21 = phi i32 [ 1, %2 ], [ 0, %7 ], [ 1, %15 ]
ret i32 %21
}