#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int scanf(char *, int *);
int main(void) {
  int number;
  char ch;
  while (scanf("%d", &number) == 1) {
    printf("%d\n", number);
    while ((ch = getchar()) != '\n')
      putchar(ch);
    putchar('\n');
  }
  printf("-------------------------------\n");
  while (scanf("%d", &number) != 1) {
    printf("%d\n", number);
    while ((ch = getchar()) != '\n')
      putchar(ch);
    putchar('\n');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
jne    11ac <main+0x6c>
mov    -0x8(%rbp),%esi
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     119d <main+0x5d>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    1179 <main+0x39>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    114f <main+0xf>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3f(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x1,%eax
je     1217 <main+0xd7>
mov    -0x8(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     1208 <main+0xc8>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
jmp    11e4 <main+0xa4>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11ba <main+0x7a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    11d5 <main+0x85>
lea    0xe8d(%rip),%r14
lea    0xe83(%rip),%r15
lea    0xc(%rsp),%rbx
jmp    11aa <main+0x5a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    11d5 <main+0x85>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1190 <main+0x40>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11c0 <main+0x70>
lea    0xe2b(%rip),%rdi
call   1040 <puts@plt>
lea    0xe18(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
jne    1203 <main+0xb3>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xdf9(%rip),%r14
lea    0xdef(%rip),%r15
lea    0xc(%rsp),%rbx
jmp    123a <main+0xea>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmp    $0x1,%eax
je     11f7 <main+0xa7>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0xa,%al
je     1220 <main+0xd0>
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1250 <main+0x100>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@str = [32 x i8] c"-------------------------------\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %19
5: ; preds = %0, %15
%6 = load i32, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call signext i8 (...) @getchar()
%9 = icmp eq i8 %8, 10
br i1 %9, label %15, label %10
10: ; preds = %5, %10
%11 = phi i8 [ %13, %10 ], [ %8, %5 ]
%12 = call i32 @putchar(i8 signext %11)
%13 = call signext i8 (...) @getchar()
%14 = icmp eq i8 %13, 10
br i1 %14, label %15, label %10
15: ; preds = %10, %5
%16 = call i32 @putchar(i8 signext 10)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%18 = icmp eq i32 %17, 1
br i1 %18, label %5, label %19
19: ; preds = %15, %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%22 = icmp eq i32 %21, 1
br i1 %22, label %37, label %23
23: ; preds = %19, %33
%24 = load i32, i32* %1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = call signext i8 (...) @getchar()
%27 = icmp eq i8 %26, 10
br i1 %27, label %33, label %28
28: ; preds = %23, %28
%29 = phi i8 [ %31, %28 ], [ %26, %23 ]
%30 = call i32 @putchar(i8 signext %29)
%31 = call signext i8 (...) @getchar()
%32 = icmp eq i8 %31, 10
br i1 %32, label %33, label %28
33: ; preds = %28, %23
%34 = call i32 @putchar(i8 signext 10)
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %23
37: ; preds = %33, %19
ret i32 0
}