#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 atoi(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, char *);
char *trazi(char *);
int main() {
  char sms[160 + 1], kontrolni[1 + 1];
  int i, brPoruka;
  char *ime;
  scanf(" %[^\n]", kontrolni);
  brPoruka = atoi(kontrolni);
  for (i = 0; i < brPoruka; i++) {
    scanf(" %160[^#\n]", sms);
    ime = trazi(sms);
    if (ime != NULL) {
      printf("%s\n", ime);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb2(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xb2(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xbc(%rbp)
movl   $0x0,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
cmp    -0xbc(%rbp),%eax
jge    11f3 <main+0xb3>
lea    -0xb0(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xb0(%rbp),%rdi
call   1040 <trazi@plt>
mov    %rax,-0xc8(%rbp)
cmpq   $0x0,-0xc8(%rbp)
je     11da <main+0x9a>
mov    -0xc8(%rbp),%rsi
lea    0xe3d(%rip),%rdi
call   1030 <printf@plt>
jmp    11df <main+0x9f>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1181 <main+0x41>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb8,%rsp
lea    0xeab(%rip),%rdi
lea    0xe(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
test   %eax,%eax
jle    11ba <main+0x7a>
mov    %eax,%ebx
lea    0xe90(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xe8f(%rip),%r12
jmp    1195 <main+0x55>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%ebx
je     11ba <main+0x7a>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    %r15,%rdi
call   1040 <trazi@plt>
test   %rax,%rax
je     1190 <main+0x50>
mov    %r12,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
jmp    1190 <main+0x50>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %[^\0A]\00"
@.str.1 = [11 x i8] c" %160[^#\0A]\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [161 x i8]
%3 = alloca [2 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%10 = call i32 @atoi(i8* %9)
store i32 %10, i32* %5
store i32 0, i32* %4
br label %11
11: ; preds = %26, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %29
15: ; preds = %11
%16 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%19 = call i8* @trazi(i8* %18)
store i8* %19, i8** %6
%20 = load i8*, i8** %6
%21 = icmp ne i8* %20, null
br i1 %21, label %22, label %25
22: ; preds = %15
%23 = load i8*, i8** %6
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22, %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %11
29: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c" %[^\0A]\00"
@.str.1 = [11 x i8] c" %160[^#\0A]\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [161 x i8]
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [161 x i8], [161 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @atoi(i8* %4)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %18
8: ; preds = %0, %15
%9 = phi i32 [ %16, %15 ], [ 0, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%11 = call i8* @trazi(i8* %3)
%12 = icmp eq i8* %11, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
br label %15
15: ; preds = %8, %13
%16 = add nuw nsw i32 %9, 1
%17 = icmp eq i32 %16, %6
br i1 %17, label %18, label %8
18: ; preds = %15, %0
ret i32 0
}