#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*/ free(int *);
int /*<<< orphan*/ getchar();
scalar_t__ malloc(int);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ seprate(int);
int main(void) {
  int i, lines, *targets, *p;
  scanf("%d", &lines);
  getchar();
  p = targets = (int *)malloc((lines + 1) * sizeof(int));
  for (i = 0; i < lines; i++) {
    scanf("%d", p++);
    getchar();
  }
  *p = 0;
  p = targets;
  while (*p) {
    seprate(*p);
    p++;
  }
  free(targets);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d4 <main+0x84>
mov    -0x20(%rbp),%rsi
mov    %rsi,%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
lea    0xe46(%rip),%rdi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1198 <main+0x48>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x0,(%rax)
je     120f <main+0xbf>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1040 <seprate@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    11e6 <main+0x96>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xea2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x4(%rsp),%eax
lea    0x4(,%rax,4),%edi
call   1060 <malloc@plt>
mov    %rax,%r14
cmpl   $0x0,0x4(%rsp)
jle    11c1 <main+0x71>
lea    0xe70(%rip),%r15
mov    %r14,%rsi
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x4(%rsi),%rbx
mov    %r15,%rdi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x1,%ebp
mov    %rbx,%rsi
cmp    0x4(%rsp),%ebp
jl     11a0 <main+0x50>
jmp    11c4 <main+0x74>
mov    %r14,%rbx
movl   $0x0,(%rbx)
mov    (%r14),%edi
test   %edi,%edi
je     11ef <main+0x9f>
mov    %r14,%rbx
add    $0x4,%rbx
nopl   0x0(%rax,%rax,1)
call   1040 <seprate@plt>
mov    (%rbx),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    11e0 <main+0x90>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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 = call i32 (...) @getchar()
%5 = load i32, i32* %1
%6 = shl i32 %5, 2
%7 = add i32 %6, 4
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i32*
%10 = load i32, i32* %1
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %0, %12
%13 = phi i32* [ %15, %12 ], [ %9, %0 ]
%14 = phi i32 [ %18, %12 ], [ 0, %0 ]
%15 = getelementptr inbounds i32, i32* %13, i64 1
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%17 = call i32 (...) @getchar()
%18 = add nuw nsw i32 %14, 1
%19 = load i32, i32* %1
%20 = icmp slt i32 %18, %19
br i1 %20, label %12, label %21
21: ; preds = %12, %0
%22 = phi i32* [ %9, %0 ], [ %15, %12 ]
store i32 0, i32* %22
%23 = load i32, i32* %9
%24 = icmp eq i32 %23, 0
br i1 %24, label %32, label %25
25: ; preds = %21, %25
%26 = phi i32 [ %30, %25 ], [ %23, %21 ]
%27 = phi i32* [ %29, %25 ], [ %9, %21 ]
%28 = call i32 @seprate(i32 %26)
%29 = getelementptr inbounds i32, i32* %27, i64 1
%30 = load i32, i32* %29
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %25
32: ; preds = %25, %21
%33 = call i32 @free(i32* %9)
ret i32 0
}