#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*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, int, int);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *, int *, int *);
main() {
  FILE *fp;
  char hinmei[30];
  int tanka, suryo;
  fp = fopen("uriage.txt", "w");
  if (fp == NULL) {
    printf("ファイルがオープンできません。\n");
    exit(1);
  }
  while (scanf("%s%d%d", hinmei, &tanka, &suryo) != EOF) {
    fprintf(fp, "%s %d %d\n", hinmei, tanka, suryo);
  }
  fclose(fp);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11a7 <main+0x47>
lea    0xe75(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
jmp    11ac <main+0x4c>
lea    -0x30(%rbp),%rsi
lea    0xe85(%rip),%rdi
lea    -0x34(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   1060 <scanf@plt>
mov    0x2e1d(%rip),%rcx
cmp    (%rcx),%rax
je     11f4 <main+0x94>
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
lea    0xe59(%rip),%rsi
call   1050 <fprintf@plt>
jmp    11ac <main+0x4c>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe8b(%rip),%rdi
lea    0xe8f(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     121a <main+0xba>
mov    %rax,%r15
lea    0xe79(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1060 <scanf@plt>
mov    0x2e39(%rip),%r14
cmp    (%r14),%rax
je     1201 <main+0xa1>
lea    0x10(%rsp),%rbx
lea    0xe4d(%rip),%r12
lea    0xc(%rsp),%r13
lea    0x8(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %r15,%rdi
lea    0xe31(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
call   1060 <scanf@plt>
cmp    (%r14),%rax
jne    11d0 <main+0x70>
mov    %r15,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdfd(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"uriage.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [47 x i8] c"\E3\83\95\E3\82\A1\E3\82\A4\E3\83\AB\E3\81\8C\E3\82\AA\E3\83\BC\E3\83\97\E3\83\B3\E3\81\A7\E3\81\8D\E3\81\BE\E3\81\9B\E3\82\93\E3\80\82\0A\00"
@.str.3 = [7 x i8] c"%s%d%d\00"
@EOF = global i64 0
@.str.4 = [10 x i8] c"%s %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [30 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %2
%7 = load i32*, i32** %2
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %0
br label %13
13: ; preds = %18, %12
%14 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%15 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %14, i32* %4, i32* %5)
%16 = load i64, i64* @EOF
%17 = icmp ne i64 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = load i32*, i32** %2
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %20, i32 %21, i32 %22)
br label %13
24: ; preds = %13
%25 = load i32*, i32** %2
%26 = call i32 @fclose(i32* %25)
%27 = load i32, i32* %1
ret i32 %27
}

LLVM IR (-O2):
@.str = [11 x i8] c"uriage.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.3 = [7 x i8] c"%s%d%d\00"
@EOF = global i64 0
@.str.4 = [10 x i8] c"%s %d %d\0A\00"
@str = [46 x i8] c"\E3\83\95\E3\82\A1\E3\82\A4\E3\83\AB\E3\81\8C\E3\82\AA\E3\83\BC\E3\83\97\E3\83\B3\E3\81\A7\E3\81\8D\E3\81\BE\E3\81\9B\E3\82\93\E3\80\82\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %13, label %9
9: ; preds = %0
%10 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %4, i32* %2, i32* %3)
%11 = load i64, i64* @EOF
%12 = icmp eq i64 %10, %11
br i1 %12, label %23, label %16
13: ; preds = %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %9, %16
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %4, i32 %17, i32 %18)
%20 = call i64 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %4, i32* %2, i32* %3)
%21 = load i64, i64* @EOF
%22 = icmp eq i64 %20, %21
br i1 %22, label %23, label %16
23: ; preds = %16, %9
%24 = call i32 @fclose(i32* %7)
ret i32 0
}