#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*/ printf(char *, char *);
int /*<<< orphan*/ removeDigitFromStr(char *, char, char *);
int /*<<< orphan*/ scanf(char *, char *, char *);
int main(void) {
  char digit[500 + 1], str[500 + 1], result[500 + 1];
  while (1) {
    scanf("%s %s", digit, str);
    if (digit[0] == '0' && str[0] == '0' && str[1] == '\0')
      break;
    removeDigitFromStr(str, digit[0], result);
    printf("%s\n", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x600,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x200(%rbp),%rsi
lea    -0x400(%rbp),%rdx
lea    0xea9(%rip),%rdi
call   1050 <scanf@plt>
movsbl -0x200(%rbp),%eax
cmp    $0x30,%eax
jne    1191 <main+0x61>
movsbl -0x400(%rbp),%eax
cmp    $0x30,%eax
jne    1191 <main+0x61>
movsbl -0x3ff(%rbp),%eax
cmp    $0x0,%eax
jne    1191 <main+0x61>
jmp    11c5 <main+0x95>
lea    -0x400(%rbp),%rdi
mov    -0x200(%rbp),%al
lea    -0x600(%rbp),%rdx
movsbl %al,%esi
call   1040 <removeDigitFromStr@plt>
lea    -0x600(%rbp),%rsi
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x600,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x600,%rsp
lea    0xeb9(%rip),%rdi
lea    0x200(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x200(%rsp),%al
cmp    $0x30,%al
jne    116f <main+0x3f>
cmpb   $0x30,(%rsp)
jne    116f <main+0x3f>
cmpb   $0x0,0x1(%rsp)
je     11d0 <main+0xa0>
mov    %rsp,%r14
lea    0x400(%rsp),%rbx
lea    0xe85(%rip),%r15
lea    0xe78(%rip),%r12
lea    0x200(%rsp),%r13
movsbl %al,%esi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1040 <removeDigitFromStr@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
movzbl 0x200(%rsp),%eax
cmp    $0x30,%al
jne    1190 <main+0x60>
cmpb   $0x30,(%rsp)
jne    1190 <main+0x60>
cmpb   $0x0,0x1(%rsp)
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x600,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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