#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, ...);
int main(int argc, char **argv) {
  while (true) {
    int nJack, nJill;
    scanf("%d %d\n", &nJack, &nJill);
    if (nJack == 0 && nJill == 0) {
      break;
    } else if (nJack > nJill)
      for (int i = 0; i < nJack + nJill; i++) {
        int cd = 0;
        scanf("%d\n", &cd);
        printf("cd %d\n", cd);
      }
  }
  return (EXIT_SUCCESS);
}


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    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
jne    1165 <main+0x45>
cmpl   $0x0,-0x18(%rbp)
jne    1165 <main+0x45>
jmp    11ce <main+0xae>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11c4 <main+0xa4>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    11bf <main+0x9f>
movl   $0x0,-0x20(%rbp)
lea    0xe6c(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x20(%rbp),%esi
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1178 <main+0x58>
jmp    11c4 <main+0xa4>
jmp    11c9 <main+0xa9>
jmp    1136 <main+0x16>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
add    $0x20,%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    0xecb(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
jne    116c <main+0x4c>
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe90(%rip),%r14
lea    0x14(%rsp),%r15
lea    0xe88(%rip),%rbx
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbp
jmp    11b2 <main+0x92>
nopl   0x0(%rax,%rax,1)
lea    0xe69(%rip),%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
mov    %eax,%edx
or     %ecx,%edx
je     1154 <main+0x34>
cmp    %ecx,%eax
jle    1190 <main+0x70>
add    %eax,%ecx
test   %ecx,%ecx
jle    1190 <main+0x70>
xor    %r12d,%r12d
nop
movl   $0x0,0x14(%rsp)
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%r12d
mov    0xc(%rsp),%eax
add    0x10(%rsp),%eax
cmp    %eax,%r12d
jl     11c0 <main+0xa0>
jmp    1190 <main+0x70>

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [7 x i8] c"cd %d\0A\00"
@EXIT_SUCCESS = global i32 0
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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %10
10: ; preds = %2, %38
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i32, i32* %7
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %14
br label %39
18: ; preds = %14, %10
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp sgt i32 %19, %20
br i1 %21, label %22, label %37
22: ; preds = %18
store i32 0, i32* %8
br label %23
23: ; preds = %33, %22
%24 = load i32, i32* %8
%25 = load i32, i32* %6
%26 = load i32, i32* %7
%27 = add nsw i32 %25, %26
%28 = icmp slt i32 %24, %27
br i1 %28, label %29, label %36
29: ; preds = %23
store i32 0, i32* %9
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%31 = load i32, i32* %9
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %29
%34 = load i32, i32* %8
%35 = add nsw i32 %34, 1
store i32 %35, i32* %8
br label %23
36: ; preds = %23
br label %37
37: ; preds = %36, %18
br label %38
38: ; preds = %37
br label %10
39: ; preds = %17
%40 = load i32, i32* @EXIT_SUCCESS
ret i32 %40
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [7 x i8] c"cd %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 0
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %40, label %14
14: ; preds = %2
%15 = bitcast i32* %5 to i8*
br label %16
16: ; preds = %14, %33
%17 = phi i32 [ %11, %14 ], [ %37, %33 ]
%18 = phi i32 [ %9, %14 ], [ %35, %33 ]
%19 = icmp sgt i32 %18, %17
%20 = add nsw i32 %17, %18
%21 = icmp sgt i32 %20, 0
%22 = select i1 %19, i1 %21, i1 false
br i1 %22, label %23, label %33
23: ; preds = %16, %23
%24 = phi i32 [ %28, %23 ], [ 0, %16 ]
store i32 0, i32* %5
%25 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%26 = load i32, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = add nuw nsw i32 %24, 1
%29 = load i32, i32* %3
%30 = load i32, i32* %4
%31 = add nsw i32 %30, %29
%32 = icmp slt i32 %28, %31
br i1 %32, label %23, label %33
33: ; preds = %23, %16
%34 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4)
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 0
%37 = load i32, i32* %4
%38 = icmp eq i32 %37, 0
%39 = select i1 %36, i1 %38, i1 false
br i1 %39, label %40, label %16
40: ; preds = %33, %2
%41 = load i32, i32* @EXIT_SUCCESS
ret i32 %41
}