#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 */
typedef int /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ p_err(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sscanf(char *, char *, char *, char *, int *);
int utf8_str_N(char *);
int main() {
  FILE *fp;
  if ((fp = fopen("tsin.src", "r")) == NULL)
    p_err("cannot open");
  while (!feof(fp)) {
    char aa[128];
    char bb[128];
    int usecount;
    char line[256];
    fgets(line, sizeof(line), fp);
    sscanf(line, "%s %s %d", aa, bb, &usecount);
    if (utf8_str_N(aa) == 1)
      printf("%s", line);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
lea    0xe79(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11af <main+0x3f>
lea    0xe61(%rip),%rdi
call   1040 <p_err@plt>
jmp    11b4 <main+0x44>
mov    -0x10(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11d2 <main+0x62>
jmp    123c <main+0xcc>
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
lea    -0x220(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    -0x110(%rbp),%rcx
lea    0xe14(%rip),%rsi
lea    -0x114(%rbp),%r8
call   1080 <sscanf@plt>
lea    -0x90(%rbp),%rdi
call   1030 <utf8_str_N@plt>
cmp    $0x1,%eax
jne    1237 <main+0xc7>
lea    -0x220(%rbp),%rsi
lea    0xdee(%rip),%rdi
call   1050 <printf@plt>
jmp    11b4 <main+0x44>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x218,%rsp
lea    0xe78(%rip),%rdi
lea    0xe7a(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    11a8 <main+0x38>
lea    0xe68(%rip),%rdi
call   1040 <p_err@plt>
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
je     11c8 <main+0x58>
xor    %eax,%eax
add    $0x218,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x110(%rsp),%r14
lea    0xe40(%rip),%r15
lea    0x90(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbp
jmp    11fc <main+0x8c>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    11b4 <main+0x44>
mov    %r14,%rdi
mov    $0x100,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1080 <sscanf@plt>
mov    %r12,%rdi
call   1030 <utf8_str_N@plt>
cmp    $0x1,%eax
jne    11f0 <main+0x80>
lea    0xdec(%rip),%rdi
mov    %r14,%rsi
call   1050 <printf@plt>
jmp    11f0 <main+0x80>

LLVM IR (-O0):
@.str = [9 x i8] c"tsin.src\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"cannot open\00"
@.str.3 = [9 x i8] c"%s %s %d\00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [128 x i8]
%4 = alloca [128 x i8]
%5 = alloca i32
%6 = alloca [256 x i8]
store i32 0, i32* %1
%7 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %2
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @p_err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %11
11: ; preds = %9, %0
br label %12
12: ; preds = %31, %11
%13 = load i32*, i32** %2
%14 = call i32 @feof(i32* %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %32
17: ; preds = %12
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%19 = load i32*, i32** %2
%20 = call i32 @fgets(i8* %18, i32 256, i32* %19)
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%23 = getelementptr inbounds [128 x i8], [128 x i8]* %4, i64 0, i64 0
%24 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %22, i8* %23, i32* %5)
%25 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%26 = call i32 @utf8_str_N(i8* %25)
%27 = icmp eq i32 %26, 1
br i1 %27, label %28, label %31
28: ; preds = %17
%29 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%30 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %28, %17
br label %12
32: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"tsin.src\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [12 x i8] c"cannot open\00"
@.str.3 = [9 x i8] c"%s %s %d\00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [128 x i8]
%2 = alloca [128 x i8]
%3 = alloca i32
%4 = alloca [256 x i8]
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 @p_err(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @feof(i32* %5)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%15 = bitcast i32* %3 to i8*
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
br label %17
17: ; preds = %12, %24
%18 = call i32 @fgets(i8* %16, i32 256, i32* %5)
%19 = call i32 @sscanf(i8* %16, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* %13, i8* %14, i32* %3)
%20 = call i32 @utf8_str_N(i8* %13)
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
br label %24
24: ; preds = %22, %17
%25 = call i32 @feof(i32* %5)
%26 = icmp eq i32 %25, 0
br i1 %26, label %17, label %27
27: ; preds = %24, %9
ret i32 0
}