#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*/ print_words(int *);
int /*<<< orphan*/ printf(char *);
scalar_t__ read_number(int *);
int main(void) {
  printf("Enter 7 consecutive digits representing a US phone number (without "
         "area code)\n");
  printf("> ");
  int phone_number[7];
  while (read_number(phone_number)) {
    print_words(phone_number);
    printf("> ");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <read_number@plt>
cmp    $0x0,%rax
je     1184 <main+0x54>
lea    -0x20(%rbp),%rdi
call   1040 <print_words@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <main+0x27>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1060 <read_number@plt>
test   %rax,%rax
je     119d <main+0x5d>
mov    %rsp,%rbx
lea    0xe8a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <print_words@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1060 <read_number@plt>
test   %rax,%rax
jne    1180 <main+0x40>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [79 x i8] c"Enter 7 consecutive digits representing a US phone number (without area code)\0A\00"
@.str.1 = [3 x i8] c"> \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i32]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([79 x i8], [79 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %9, %0
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%7 = call i64 @read_number(i32* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %5
%10 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%11 = call i32 @print_words(i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %5
13: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"> \00"
@str = [78 x i8] c"Enter 7 consecutive digits representing a US phone number (without area code)\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = bitcast [7 x i32]* %1 to i8*
%5 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%6 = call i64 @read_number(i32* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %0, %8
%9 = call i32 @print_words(i32* %5)
%10 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%11 = call i64 @read_number(i32* %5)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %8
13: ; preds = %8, %0
ret i32 0
}