#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char str1[50], str2[50];
  int i = 1;
  int j = 0;
  int k = 0;
  int cont = 0;
  int cont2 = 0;
  while (i != 0) {
    gets(str1);
    gets(str2);
    if ((strcmp(str1, "0") == 0) || (strcmp(str2, "0") == 0)) {
      break;
    }
    strcat(str1, str2);
    printf("%s\n", str1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x84(%rbp)
movl   $0x0,-0x88(%rbp)
movl   $0x0,-0x8c(%rbp)
movl   $0x0,-0x90(%rbp)
movl   $0x0,-0x94(%rbp)
cmpl   $0x0,-0x84(%rbp)
je     11fe <main+0xbe>
lea    -0x40(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x80(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x40(%rbp),%rdi
lea    0xe52(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     11d7 <main+0x97>
lea    -0x80(%rbp),%rdi
lea    0xe38(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11dc <main+0x9c>
jmp    11fe <main+0xbe>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0x40(%rbp),%rsi
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x44>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rsp,%rdi
call   1050 <gets@plt>
lea    0xe99(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d6 <main+0x96>
lea    0xe85(%rip),%r14
mov    %rsp,%r15
lea    0x40(%rsp),%rbx
lea    0xe78(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11d6 <main+0x96>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <strcat@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %r15,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @gets(i8* %3)
%6 = call i32 @gets(i8* %4)
%7 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %0, %12
%10 = call i64 @strcmp(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %9
%13 = call i32 @strcat(i8* %3, i8* %4)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%15 = call i32 @gets(i8* %3)
%16 = call i32 @gets(i8* %4)
%17 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %9
19: ; preds = %9, %12, %0
ret i32 0
}