void main() {
  struct person {
    char name[20];
    int count;
  } leader[3] = {"Li", 0, "Zhang", 0, "Fun", 0};
  int i, j;
  char leader_name[20];
  for (i = 0; i < 5; i++) {
    scanf("%s", leader_name);
    for (j = 0; j < 3; j++) {
      if (strcmp(leader_name, leader[j].name) == 0)
        leader[j].count++;
    }
  }
  printf("\n");
  for (i = 0; i < 3; i++) {
    printf("%5s:%d\n", leader[i].name, leader[i].count);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
lea    -0x50(%rbp),%rdi
lea    0xead(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x5,-0x54(%rbp)
jge    11f0 <main+0xb0>
lea    -0x70(%rbp),%rsi
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
movl   $0x0,-0x58(%rbp)
cmpl   $0x3,-0x58(%rbp)
jge    11dd <main+0x9d>
lea    -0x70(%rbp),%rdi
movslq -0x58(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ca <main+0x8a>
movslq -0x58(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0x14(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x14(%rax)
jmp    11cf <main+0x8f>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1187 <main+0x47>
jmp    11e2 <main+0xa2>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1164 <main+0x24>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x3,-0x54(%rbp)
jge    124c <main+0x10c>
movslq -0x54(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x18,%rax,%rax
add    %rax,%rsi
movslq -0x54(%rbp),%rcx
lea    -0x50(%rbp),%rax
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    0x14(%rax),%edx
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1205 <main+0xc5>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    0xeeb(%rip),%rax
mov    %rax,0x60(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe7b(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x38(%rsp),%r14
lea    0xeb2(%rip),%rdi
xor    %r12d,%r12d
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
mov    $0x0,%ebp
test   %eax,%eax
jne    11c9 <main+0x89>
movl   $0x1,0x34(%rsp)
mov    $0x1,%ebp
lea    0x50(%rsp),%r15
mov    %rsp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    11eb <main+0xab>
movl   $0x1,0x4c(%rsp)
mov    $0x1,%r12d
mov    %rsp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
xor    %r13d,%r13d
test   %eax,%eax
jne    120b <main+0xcb>
movl   $0x1,0x64(%rsp)
mov    $0x1,%r13d
lea    0xe36(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1237 <main+0xf7>
add    $0x1,%ebp
mov    %ebp,0x34(%rsp)
mov    %rsp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    124f <main+0x10f>
add    $0x1,%r12d
mov    %r12d,0x4c(%rsp)
mov    %rsp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1267 <main+0x127>
add    $0x1,%r13d
mov    %r13d,0x64(%rsp)
lea    0xdda(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1293 <main+0x153>
add    $0x1,%ebp
mov    %ebp,0x34(%rsp)
mov    %rsp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    12ab <main+0x16b>
add    $0x1,%r12d
mov    %r12d,0x4c(%rsp)
mov    %rsp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    12c3 <main+0x183>
add    $0x1,%r13d
mov    %r13d,0x64(%rsp)
lea    0xd7e(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    12ef <main+0x1af>
add    $0x1,%ebp
mov    %ebp,0x34(%rsp)
mov    %rsp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1307 <main+0x1c7>
add    $0x1,%r12d
mov    %r12d,0x4c(%rsp)
mov    %rsp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    131f <main+0x1df>
add    $0x1,%r13d
mov    %r13d,0x64(%rsp)
lea    0xd22(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    134b <main+0x20b>
add    $0x1,%ebp
mov    %ebp,0x34(%rsp)
mov    %rsp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    1363 <main+0x223>
add    $0x1,%r12d
mov    %r12d,0x4c(%rsp)
mov    %rsp,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %eax,%eax
jne    137b <main+0x23b>
add    $0x1,%r13d
mov    %r13d,0x64(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcbf(%rip),%rbx
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4c(%rsp),%edx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x64(%rsp),%edx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.person = type { [20 x i8], i32 }
@__const.main.leader = [3 x %struct.person] [%struct.person { [20 x i8] c"Li\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 0 }, %struct.person { [20 x i8] c"Zhang\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 0 }, %struct.person { [20 x i8] c"Fun\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 0 }]
@.str = [3 x i8] c"%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [8 x i8] c"%5s:%d\0A\00"
define void @main() {
%1 = alloca [3 x %struct.person]
%2 = alloca i32
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = bitcast [3 x %struct.person]* %1 to i8*
store i32 0, i32* %2
br label %6
6: ; preds = %36, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %39
9: ; preds = %6
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
store i32 0, i32* %3
br label %12
12: ; preds = %32, %9
%13 = load i32, i32* %3
%14 = icmp slt i32 %13, 3
br i1 %14, label %15, label %35
15: ; preds = %12
%16 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 %18
%20 = getelementptr inbounds %struct.person, %struct.person* %19, i32 0, i32 0
%21 = getelementptr inbounds [20 x i8], [20 x i8]* %20, i64 0, i64 0
%22 = call i32 @strcmp(i8* %16, i8* %21)
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %31
24: ; preds = %15
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 %26
%28 = getelementptr inbounds %struct.person, %struct.person* %27, i32 0, i32 1
%29 = load i32, i32* %28
%30 = add nsw i32 %29, 1
store i32 %30, i32* %28
br label %31
31: ; preds = %24, %15
br label %32
32: ; preds = %31
%33 = load i32, i32* %3
%34 = add nsw i32 %33, 1
store i32 %34, i32* %3
br label %12
35: ; preds = %12
br label %36
36: ; preds = %35
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %6
39: ; preds = %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %2
br label %41
41: ; preds = %56, %39
%42 = load i32, i32* %2
%43 = icmp slt i32 %42, 3
br i1 %43, label %44, label %59
44: ; preds = %41
%45 = load i32, i32* %2
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 %46
%48 = getelementptr inbounds %struct.person, %struct.person* %47, i32 0, i32 0
%49 = getelementptr inbounds [20 x i8], [20 x i8]* %48, i64 0, i64 0
%50 = load i32, i32* %2
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 %51
%53 = getelementptr inbounds %struct.person, %struct.person* %52, i32 0, i32 1
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %49, i32 %54)
br label %56
56: ; preds = %44
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %41
59: ; preds = %41
ret void
}

LLVM IR (-O2):
%struct.person = type { [20 x i8], i32 }
@__const.main.leader = [3 x %struct.person] [%struct.person { [20 x i8] c"Li\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 0 }, %struct.person { [20 x i8] c"Zhang\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 0 }, %struct.person { [20 x i8] c"Fun\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00", i32 0 }]
@.str = [3 x i8] c"%s\00"
@.str.2 = [8 x i8] c"%5s:%d\0A\00"
define void @main() {
%1 = alloca [3 x %struct.person]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 0, i32 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 0, i32 1
%6 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 1, i32 0, i64 0
%7 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 1, i32 1
%8 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 2, i32 0, i64 0
%9 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 2, i32 1
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%11 = call i32 @strcmp(i8* %4, i8* %3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %0
store i32 1, i32* %5
br label %14
14: ; preds = %0, %13
%15 = phi i32 [ 0, %0 ], [ 1, %13 ]
%16 = call i32 @strcmp(i8* %4, i8* %6)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %14
store i32 1, i32* %7
br label %19
19: ; preds = %18, %14
%20 = phi i32 [ 1, %18 ], [ 0, %14 ]
%21 = call i32 @strcmp(i8* %4, i8* %8)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %19
store i32 1, i32* %9
br label %24
24: ; preds = %23, %19
%25 = phi i32 [ 1, %23 ], [ 0, %19 ]
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%27 = call i32 @strcmp(i8* %4, i8* %3)
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = add nuw nsw i32 %15, 1
store i32 %30, i32* %5
br label %31
31: ; preds = %29, %24
%32 = phi i32 [ %15, %24 ], [ %30, %29 ]
%33 = call i32 @strcmp(i8* %4, i8* %6)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %31
%36 = add nuw nsw i32 %20, 1
store i32 %36, i32* %7
br label %37
37: ; preds = %35, %31
%38 = phi i32 [ %36, %35 ], [ %20, %31 ]
%39 = call i32 @strcmp(i8* %4, i8* %8)
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %37
%42 = add nuw nsw i32 %25, 1
store i32 %42, i32* %9
br label %43
43: ; preds = %41, %37
%44 = phi i32 [ %42, %41 ], [ %25, %37 ]
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%46 = call i32 @strcmp(i8* %4, i8* %3)
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %43
%49 = add nsw i32 %32, 1
store i32 %49, i32* %5
br label %50
50: ; preds = %48, %43
%51 = phi i32 [ %32, %43 ], [ %49, %48 ]
%52 = call i32 @strcmp(i8* %4, i8* %6)
%53 = icmp eq i32 %52, 0
br i1 %53, label %54, label %56
54: ; preds = %50
%55 = add nsw i32 %38, 1
store i32 %55, i32* %7
br label %56
56: ; preds = %54, %50
%57 = phi i32 [ %55, %54 ], [ %38, %50 ]
%58 = call i32 @strcmp(i8* %4, i8* %8)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %62
60: ; preds = %56
%61 = add nsw i32 %44, 1
store i32 %61, i32* %9
br label %62
62: ; preds = %60, %56
%63 = phi i32 [ %61, %60 ], [ %44, %56 ]
%64 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%65 = call i32 @strcmp(i8* %4, i8* %3)
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %69
67: ; preds = %62
%68 = add nsw i32 %51, 1
store i32 %68, i32* %5
br label %69
69: ; preds = %67, %62
%70 = phi i32 [ %51, %62 ], [ %68, %67 ]
%71 = call i32 @strcmp(i8* %4, i8* %6)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %69
%74 = add nsw i32 %57, 1
store i32 %74, i32* %7
br label %75
75: ; preds = %73, %69
%76 = phi i32 [ %74, %73 ], [ %57, %69 ]
%77 = call i32 @strcmp(i8* %4, i8* %8)
%78 = icmp eq i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = add nsw i32 %63, 1
store i32 %80, i32* %9
br label %81
81: ; preds = %79, %75
%82 = phi i32 [ %80, %79 ], [ %63, %75 ]
%83 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%84 = call i32 @strcmp(i8* %4, i8* %3)
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %81
%87 = add nsw i32 %70, 1
store i32 %87, i32* %5
br label %88
88: ; preds = %86, %81
%89 = phi i32 [ %70, %81 ], [ %87, %86 ]
%90 = call i32 @strcmp(i8* %4, i8* %6)
%91 = icmp eq i32 %90, 0
br i1 %91, label %92, label %94
92: ; preds = %88
%93 = add nsw i32 %76, 1
store i32 %93, i32* %7
br label %94
94: ; preds = %92, %88
%95 = call i32 @strcmp(i8* %4, i8* %8)
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %99
97: ; preds = %94
%98 = add nsw i32 %82, 1
store i32 %98, i32* %9
br label %99
99: ; preds = %97, %94
%100 = call i32 @putchar(i32 10)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %3, i32 %89)
%102 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 1, i32 1
%103 = load i32, i32* %102
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %6, i32 %103)
%105 = getelementptr inbounds [3 x %struct.person], [3 x %struct.person]* %1, i64 0, i64 2, i32 1
%106 = load i32, i32* %105
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %8, i32 %106)
ret void
}