#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 find(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int n, f, k, i;
  while (1) {
    f = 0;
    scanf("%d%d", &n, &k);
    if (!n || !k)
      break;
    f = find(n, k);
    printf("%d %d %d\n", n, k, f);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     116e <main+0x3e>
cmpl   $0x0,-0x10(%rbp)
jne    1173 <main+0x43>
jmp    119b <main+0x6b>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <find@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xec1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     11b3 <main+0x83>
mov    (%rsp),%esi
test   %esi,%esi
je     11b3 <main+0x83>
lea    0xea3(%rip),%r14
lea    0xe97(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1040 <find@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edx
mov    %r14,%rdi
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     11b3 <main+0x83>
mov    (%rsp),%esi
test   %esi,%esi
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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