#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*/ STDOUT_FILENO;
int /*<<< orphan*/ SYS_write;
long long atoll(char *);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int /*<<< orphan*/, char *,
                           int /*<<< orphan*/);
int findAndPrint(char *l, int ID) {
  char *line = l;
  int flag = 0;
  char temp[10];
  int i = 0;
  int j = 0;
  char user[20];
  while (flag < 3) {
    if (*line == ':')
      flag++;
    if (flag == 2 && *line != ':')
      temp[i++] = *line;
    else if (flag == 0 && *line != ':')
      user[j++] = *line;
    line++;
  }
  user[j] = 0;
  temp[i] = 0;
  long long chuid = atoll(temp);
  if (chuid == ID) {
    syscall(SYS_write, STDOUT_FILENO, user, strlen(user));
    syscall(SYS_write, STDOUT_FILENO, "\t\0", strlen("\t\0"));
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<findAndPrint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x24(%rbp)
jge    11fc <findAndPrint+0xcc>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
jne    117f <findAndPrint+0x4f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jne    11b5 <findAndPrint+0x85>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     11b5 <findAndPrint+0x85>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x34(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x34(%rbp)
cltq
mov    %cl,-0x2e(%rbp,%rax,1)
jmp    11eb <findAndPrint+0xbb>
cmpl   $0x0,-0x24(%rbp)
jne    11e6 <findAndPrint+0xb6>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x3a,%eax
je     11e6 <findAndPrint+0xb6>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x38(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x38(%rbp)
cltq
mov    %cl,-0x50(%rbp,%rax,1)
jmp    11eb <findAndPrint+0xbb>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    115c <findAndPrint+0x2c>
movslq -0x38(%rbp),%rax
movb   $0x0,-0x50(%rbp,%rax,1)
movslq -0x34(%rbp),%rax
movb   $0x0,-0x2e(%rbp,%rax,1)
lea    -0x2e(%rbp),%rdi
call   1040 <atoll@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jne    12aa <findAndPrint+0x17a>
mov    0x2dad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x6c(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x68(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x70(%rbp),%edi
mov    -0x6c(%rbp),%esi
mov    -0x68(%rbp),%rdx
mov    %eax,%ecx
call   1050 <syscall@plt>
mov    0x2d73(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x60(%rbp)
mov    0x2d77(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x5c(%rbp)
lea    0xd7b(%rip),%rdi
call   1030 <strlen@plt>
mov    -0x60(%rbp),%edi
mov    -0x5c(%rbp),%esi
mov    %eax,%ecx
lea    0xd67(%rip),%rdx
call   1050 <syscall@plt>
movl   $0x1,-0x4(%rbp)
jmp    12b1 <findAndPrint+0x181>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findAndPrint>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
mov    %esi,%ebp
xor    %ecx,%ecx
xor    %eax,%eax
xor    %edx,%edx
jmp    115b <findAndPrint+0x2b>
cs nopw 0x0(%rax,%rax,1)
mov    %bl,(%rsi)
add    $0x1,%rdi
cmp    $0x3,%edx
jae    11a4 <findAndPrint+0x74>
mov    %edx,%esi
movzbl (%rdi),%ebx
xor    %edx,%edx
cmp    $0x3a,%bl
sete   %dl
add    %esi,%edx
je     1190 <findAndPrint+0x60>
cmp    $0x2,%edx
jne    1152 <findAndPrint+0x22>
cmp    $0x3a,%bl
je     1152 <findAndPrint+0x22>
movslq %eax,%rsi
add    $0x1,%eax
add    %rsp,%rsi
add    $0x6,%rsi
jmp    1150 <findAndPrint+0x20>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x3a,%bl
je     1152 <findAndPrint+0x22>
movslq %ecx,%rsi
add    $0x1,%ecx
add    %rsp,%rsi
add    $0x10,%rsi
jmp    1150 <findAndPrint+0x20>
movslq %ecx,%rcx
movb   $0x0,0x10(%rsp,%rcx,1)
cltq
movb   $0x0,0x6(%rsp,%rax,1)
lea    0x6(%rsp),%rdi
call   1040 <atoll@plt>
mov    %rax,%rcx
movslq %ebp,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
jne    1223 <findAndPrint+0xf3>
mov    0x2e0f(%rip),%r15
mov    (%r15),%ebx
mov    0x2e15(%rip),%r12
mov    (%r12),%ebp
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1050 <syscall@plt>
mov    (%r15),%ebx
mov    (%r12),%ebp
lea    0xdf8(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1050 <syscall@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SYS_write = global i32 0
@STDOUT_FILENO = global i32 0
@.str = [3 x i8] c"\09\00\00"
define i32 @findAndPrint(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca [10 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca [20 x i8]
%12 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
%13 = load i8*, i8** %4
store i8* %13, i8** %6
store i32 0, i32* %7
store i32 0, i32* %9
store i32 0, i32* %10
br label %14
14: ; preds = %56, %2
%15 = load i32, i32* %7
%16 = icmp slt i32 %15, 3
br i1 %16, label %17, label %59
17: ; preds = %14
%18 = load i8*, i8** %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 58
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %25
25: ; preds = %22, %17
%26 = load i32, i32* %7
%27 = icmp eq i32 %26, 2
br i1 %27, label %28, label %40
28: ; preds = %25
%29 = load i8*, i8** %6
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp ne i32 %31, 58
br i1 %32, label %33, label %40
33: ; preds = %28
%34 = load i8*, i8** %6
%35 = load i8, i8* %34
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
%38 = sext i32 %36 to i64
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 %38
store i8 %35, i8* %39
br label %56
40: ; preds = %28, %25
%41 = load i32, i32* %7
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %55
43: ; preds = %40
%44 = load i8*, i8** %6
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = icmp ne i32 %46, 58
br i1 %47, label %48, label %55
48: ; preds = %43
%49 = load i8*, i8** %6
%50 = load i8, i8* %49
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
%53 = sext i32 %51 to i64
%54 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 %53
store i8 %50, i8* %54
br label %55
55: ; preds = %48, %43, %40
br label %56
56: ; preds = %55, %33
%57 = load i8*, i8** %6
%58 = getelementptr inbounds i8, i8* %57, i32 1
store i8* %58, i8** %6
br label %14
59: ; preds = %14
%60 = load i32, i32* %10
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 %61
store i8 0, i8* %62
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 %64
store i8 0, i8* %65
%66 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%67 = call i64 @atoll(i8* %66)
store i64 %67, i64* %12
%68 = load i64, i64* %12
%69 = load i32, i32* %5
%70 = sext i32 %69 to i64
%71 = icmp eq i64 %68, %70
br i1 %71, label %72, label %83
72: ; preds = %59
%73 = load i32, i32* @SYS_write
%74 = load i32, i32* @STDOUT_FILENO
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 0
%76 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 0
%77 = call i32 @strlen(i8* %76)
%78 = call i32 @syscall(i32 %73, i32 %74, i8* %75, i32 %77)
%79 = load i32, i32* @SYS_write
%80 = load i32, i32* @STDOUT_FILENO
%81 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%82 = call i32 @syscall(i32 %79, i32 %80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %81)
store i32 1, i32* %3
br label %84
83: ; preds = %59
store i32 0, i32* %3
br label %84
84: ; preds = %83, %72
%85 = load i32, i32* %3
ret i32 %85
}

LLVM IR (-O2):
@SYS_write = global i32 0
@STDOUT_FILENO = global i32 0
@.str = [3 x i8] c"\09\00\00"
define i32 @findAndPrint(i8* nocapture %0, i32 %1) {
%3 = alloca [10 x i8]
%4 = alloca [20 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
br label %7
7: ; preds = %2, %30
%8 = phi i32 [ 0, %2 ], [ %32, %30 ]
%9 = phi i32 [ 0, %2 ], [ %31, %30 ]
%10 = phi i32 [ 0, %2 ], [ %15, %30 ]
%11 = phi i8* [ %0, %2 ], [ %33, %30 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 58
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %10, %14
switch i32 %15, label %30 [
i32 2, label %16
i32 0, label %21
]
16: ; preds = %7
br i1 %13, label %30, label %17
17: ; preds = %16
%18 = add nsw i32 %9, 1
%19 = sext i32 %9 to i64
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %19
br label %26
21: ; preds = %7
br i1 %13, label %30, label %22
22: ; preds = %21
%23 = add nsw i32 %8, 1
%24 = sext i32 %8 to i64
%25 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 %24
br label %26
26: ; preds = %17, %22
%27 = phi i8* [ %25, %22 ], [ %20, %17 ]
%28 = phi i32 [ %9, %22 ], [ %18, %17 ]
%29 = phi i32 [ %23, %22 ], [ %8, %17 ]
store i8 %12, i8* %27
br label %30
30: ; preds = %26, %16, %7, %21
%31 = phi i32 [ %9, %21 ], [ %9, %7 ], [ %9, %16 ], [ %28, %26 ]
%32 = phi i32 [ %8, %21 ], [ %8, %7 ], [ %8, %16 ], [ %29, %26 ]
%33 = getelementptr inbounds i8, i8* %11, i64 1
%34 = icmp ult i32 %15, 3
br i1 %34, label %7, label %35
35: ; preds = %30
%36 = sext i32 %32 to i64
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 %36
store i8 0, i8* %37
%38 = sext i32 %31 to i64
%39 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %38
store i8 0, i8* %39
%40 = call i64 @atoll(i8* %5)
%41 = sext i32 %1 to i64
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %52
43: ; preds = %35
%44 = load i32, i32* @SYS_write
%45 = load i32, i32* @STDOUT_FILENO
%46 = call i32 @strlen(i8* %6)
%47 = call i32 @syscall(i32 %44, i32 %45, i8* %6, i32 %46)
%48 = load i32, i32* @SYS_write
%49 = load i32, i32* @STDOUT_FILENO
%50 = call i32 @strlen(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%51 = call i32 @syscall(i32 %48, i32 %49, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %35, %43
%53 = phi i32 [ 1, %43 ], [ 0, %35 ]
ret i32 %53
}