#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*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getline(int, char *);
int open(char *, int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(void) {
  int fd = 0;
  char str[256];
  char wr[256] = "YURI\nOS";
  fd = open("b.txt", 0x08 | 0x01);
  write(fd, wr, 256);
  getline(fd, str);
  puts(str);
  getline(fd, str);
  puts(str);
  getline(fd, str);
  puts(str);
  close(fd);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
lea    0xe69(%rip),%rsi
mov    $0x100,%edx
call   1060 <memcpy@plt>
lea    0xf58(%rip),%rdi
mov    $0x9,%esi
call   1070 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x210(%rbp),%rsi
mov    $0x100,%edx
call   1040 <write@plt>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1080 <getline@plt>
lea    -0x110(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1080 <getline@plt>
lea    -0x110(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%edi
lea    -0x110(%rbp),%rsi
call   1080 <getline@plt>
lea    -0x110(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
lea    0xe7f(%rip),%rsi
mov    %rsp,%r14
mov    $0x100,%edx
mov    %r14,%rdi
call   1060 <memcpy@plt>
lea    0xf68(%rip),%rdi
mov    $0x9,%esi
call   1070 <open@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %r14,%rsi
mov    $0x100,%edx
call   1040 <write@plt>
lea    0x100(%rsp),%r14
mov    %ebx,%edi
mov    %r14,%rsi
call   1080 <getline@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1080 <getline@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1080 <getline@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <close@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@__const.main.wr = [256 x i8] c"YURI\0AOS\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"b.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%5 = bitcast [256 x i8]* %4 to i8*
%6 = call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 9)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%9 = call i32 @write(i32 %7, i8* %8, i32 256)
%10 = load i32, i32* %2
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%12 = call i32 @getline(i32 %10, i8* %11)
%13 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
%15 = load i32, i32* %2
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%17 = call i32 @getline(i32 %15, i8* %16)
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%19 = call i32 @puts(i8* %18)
%20 = load i32, i32* %2
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%22 = call i32 @getline(i32 %20, i8* %21)
%23 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%24 = call i32 @puts(i8* %23)
%25 = load i32, i32* %2
%26 = call i32 @close(i32 %25)
%27 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.wr = [256 x i8] c"YURI\0AOS\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [6 x i8] c"b.txt\00"
define i32 @main() {
%1 = alloca [256 x i8]
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @open(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 9)
%6 = call i32 @write(i32 %5, i8* %4, i32 256)
%7 = call i32 @getline(i32 %5, i8* %3)
%8 = call i32 @puts(i8* %3)
%9 = call i32 @getline(i32 %5, i8* %3)
%10 = call i32 @puts(i8* %3)
%11 = call i32 @getline(i32 %5, i8* %3)
%12 = call i32 @puts(i8* %3)
%13 = call i32 @close(i32 %5)
%14 = call i32 @exit(i32 0)
unreachable
}