#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*/ strcpy(char *, char *);
int /*<<< orphan*/ strlwr(char *);
char *strstr(char *, char *);
char *strtok(char *, char *);
char *trazi(char *sms) {
  char copy[160 + 1];
  int dob;
  strcpy(copy, sms);
  strlwr(copy);
  char *ime = NULL, *godine = NULL;
  char delimit[] = "()";
  ime = strtok(copy, delimit);
  godine = strtok(NULL, delimit);
  dob = atoi(godine);
  char *crn = NULL, *bogat = NULL, *visok = NULL;
  crn = strstr(copy, "crn");
  bogat = strstr(copy, "bogat");
  visok = strstr(copy, "visok");
  if ((crn != NULL || bogat != NULL || visok != NULL) || (dob <= 45)) {
    return ime;
  } else {
    return NULL;
  }
}


x86 assembly (clang, -O0):
<trazi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0xc0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcpy@plt>
lea    -0xc0(%rbp),%rdi
call   1030 <strlwr@plt>
movq   $0x0,-0xd0(%rbp)
movq   $0x0,-0xd8(%rbp)
mov    0xe68(%rip),%ax
mov    %ax,-0xdb(%rbp)
mov    0xe5d(%rip),%al
mov    %al,-0xd9(%rbp)
lea    -0xc0(%rbp),%rdi
lea    -0xdb(%rbp),%rsi
call   1050 <strtok@plt>
mov    %rax,-0xd0(%rbp)
lea    -0xdb(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1050 <strtok@plt>
mov    %rax,-0xd8(%rbp)
mov    -0xd8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0xc4(%rbp)
movq   $0x0,-0xe8(%rbp)
movq   $0x0,-0xf0(%rbp)
movq   $0x0,-0xf8(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xde6(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,-0xe8(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xdd0(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,-0xf0(%rbp)
lea    -0xc0(%rbp),%rdi
lea    0xdbc(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,-0xf8(%rbp)
cmpq   $0x0,-0xe8(%rbp)
jne    1294 <trazi+0x144>
cmpq   $0x0,-0xf0(%rbp)
jne    1294 <trazi+0x144>
cmpq   $0x0,-0xf8(%rbp)
jne    1294 <trazi+0x144>
cmpl   $0x2d,-0xc4(%rbp)
jg     12a4 <trazi+0x154>
mov    -0xd0(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    12ac <trazi+0x15c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trazi>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %rdi,%rsi
lea    0x10(%rsp),%r15
mov    %r15,%rdi
call   1040 <strcpy@plt>
mov    %r15,%rdi
call   1030 <strlwr@plt>
movb   $0x0,0xe(%rsp)
movw   $0x2928,0xc(%rsp)
lea    0xc(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <strtok@plt>
mov    %rax,%r14
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r12,%rsi
call   1050 <strtok@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
lea    0xe4d(%rip),%rsi
mov    %r15,%rdi
call   1070 <strstr@plt>
mov    %rax,%r13
lea    0xe3f(%rip),%rsi
mov    %r15,%rdi
call   1070 <strstr@plt>
mov    %rax,%rbp
lea    0xe33(%rip),%rsi
mov    %r15,%rdi
call   1070 <strstr@plt>
or     %r13,%rbp
cmp    $0x2e,%r12d
cmovl  %r14,%rbx
or     %rax,%rbp
cmovne %r14,%rbx
mov    %rbx,%rax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.trazi.delimit = [3 x i8] c"()\00"
@.str = [4 x i8] c"crn\00"
@.str.1 = [6 x i8] c"bogat\00"
@.str.2 = [6 x i8] c"visok\00"
define i8* @trazi(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [161 x i8]
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [3 x i8]
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i8* %0, i8** %3
%12 = getelementptr inbounds [161 x i8], [161 x i8]* %4, i64 0, i64 0
%13 = load i8*, i8** %3
%14 = call i32 @strcpy(i8* %12, i8* %13)
%15 = getelementptr inbounds [161 x i8], [161 x i8]* %4, i64 0, i64 0
%16 = call i32 @strlwr(i8* %15)
store i8* null, i8** %6
store i8* null, i8** %7
%17 = bitcast [3 x i8]* %8 to i8*
%18 = getelementptr inbounds [161 x i8], [161 x i8]* %4, i64 0, i64 0
%19 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%20 = call i8* @strtok(i8* %18, i8* %19)
store i8* %20, i8** %6
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %8, i64 0, i64 0
%22 = call i8* @strtok(i8* null, i8* %21)
store i8* %22, i8** %7
%23 = load i8*, i8** %7
%24 = call i32 @atoi(i8* %23)
store i32 %24, i32* %5
store i8* null, i8** %9
store i8* null, i8** %10
store i8* null, i8** %11
%25 = getelementptr inbounds [161 x i8], [161 x i8]* %4, i64 0, i64 0
%26 = call i8* @strstr(i8* %25, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i8* %26, i8** %9
%27 = getelementptr inbounds [161 x i8], [161 x i8]* %4, i64 0, i64 0
%28 = call i8* @strstr(i8* %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %28, i8** %10
%29 = getelementptr inbounds [161 x i8], [161 x i8]* %4, i64 0, i64 0
%30 = call i8* @strstr(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i8* %30, i8** %11
%31 = load i8*, i8** %9
%32 = icmp ne i8* %31, null
br i1 %32, label %42, label %33
33: ; preds = %1
%34 = load i8*, i8** %10
%35 = icmp ne i8* %34, null
br i1 %35, label %42, label %36
36: ; preds = %33
%37 = load i8*, i8** %11
%38 = icmp ne i8* %37, null
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = load i32, i32* %5
%41 = icmp sle i32 %40, 45
br i1 %41, label %42, label %44
42: ; preds = %39, %36, %33, %1
%43 = load i8*, i8** %6
store i8* %43, i8** %2
br label %45
44: ; preds = %39
store i8* null, i8** %2
br label %45
45: ; preds = %44, %42
%46 = load i8*, i8** %2
ret i8* %46
}

LLVM IR (-O2):
@__const.trazi.delimit = [3 x i8] c"()\00"
@.str = [4 x i8] c"crn\00"
@.str.1 = [6 x i8] c"bogat\00"
@.str.2 = [6 x i8] c"visok\00"
define i8* @trazi(i8* %0) {
%2 = alloca [161 x i8]
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [161 x i8], [161 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @strlwr(i8* %4)
%7 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%8 = call i8* @strtok(i8* %4, i8* %7)
%9 = call i8* @strtok(i8* null, i8* %7)
%10 = call i32 @atoi(i8* %9)
%11 = call i8* @strstr(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%12 = call i8* @strstr(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = call i8* @strstr(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp ne i8* %11, null
%15 = icmp ne i8* %12, null
%16 = select i1 %14, i1 true, i1 %15
%17 = icmp ne i8* %13, null
%18 = select i1 %16, i1 true, i1 %17
%19 = icmp slt i32 %10, 46
%20 = select i1 %18, i1 true, i1 %19
%21 = select i1 %20, i8* %8, i8* null
ret i8* %21
}