#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 *, int);
scalar_t__ scanf(char *, int *, int *);
int main(int argc, char const *argv[]) {
  int a, b;
  while (scanf("%d%d", &a, &b) && (a + b) != 0) {
    printf("%d\n", a + b);
  }
  return 0;
}


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
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     116b <main+0x4b>
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    117b <main+0x5b>
jmp    1192 <main+0x72>
mov    -0x14(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
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    0xed1(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
test   %rax,%rax
je     1184 <main+0x64>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
je     1184 <main+0x64>
lea    0xeb4(%rip),%r14
lea    0xea8(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
test   %rax,%rax
je     1184 <main+0x64>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
jne    1160 <main+0x40>
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 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %18, %2
%9 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = add nsw i32 %12, %13
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %11, %8
%17 = phi i1 [ false, %8 ], [ %15, %11 ]
br i1 %17, label %18, label %23
18: ; preds = %16
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %8
23: ; preds = %16
ret i32 0
}

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