#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 */
int /*<<< orphan*/ extract_lfn(char *, char *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char buf[((10 + 12 + 4) / 2) * 2];
  char name[100];
  FILE *f = fopen("lfn", "r");
  if (!f)
    printf("cnt open fiel\n");
  fread(buf, 32, 1, f);
  extract_lfn(buf, name);
  puts(name);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe94(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x98(%rbp)
cmpq   $0x0,-0x98(%rbp)
jne    1196 <main+0x46>
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    -0x98(%rbp),%rcx
mov    $0x20,%esi
mov    $0x1,%edx
call   1040 <fread@plt>
lea    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1070 <extract_lfn@plt>
lea    -0x90(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x88,%rsp
lea    0xeaf(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1171 <main+0x31>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x20,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
lea    0x20(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <extract_lfn@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"lfn\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [15 x i8] c"cnt open fiel\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca [100 x i8]
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %4
%6 = load i32*, i32** %4
%7 = icmp ne i32* %6, null
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%12 = load i32*, i32** %4
%13 = call i32 @fread(i8* %11, i32 32, i32 1, i32* %12)
%14 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 0
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%16 = call i32 @extract_lfn(i8* %14, i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%18 = call i32 @puts(i8* %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [4 x i8] c"lfn\00"
@.str.1 = [2 x i8] c"r\00"
@str = [14 x i8] c"cnt open fiel\00"
define i32 @main() {
%1 = alloca [26 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [26 x i8], [26 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([4 x i8], [4 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 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %0
%10 = call i32 @fread(i8* %3, i32 32, i32 1, i32* %5)
%11 = call i32 @extract_lfn(i8* %3, i8* %4)
%12 = call i32 @puts(i8* %4)
ret i32 0
}