#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*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, int *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  FILE *bustext;
  int number;
  char pinakas[54];
  bustext = fopen("C:\\E1ask4\\bus.txt", "r");
  if (bustext == NULL) {
    printf("Problem");
    exit(1);
  }
  fscanf(bustext, "%s  %d", pinakas, &number);
  printf("Periexomena pinaka\n");
  printf("%s\n %d\n", pinakas, number);
  fclose(bustext);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xea1(%rip),%rdi
lea    0xeac(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1192 <main+0x42>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%rdi
lea    -0x50(%rbp),%rdx
lea    0xe7b(%rip),%rsi
lea    -0xc(%rbp),%rcx
call   1050 <fscanf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
lea    0xe92(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     11d1 <main+0x71>
mov    %rax,%rbx
lea    0xe93(%rip),%rsi
lea    0x10(%rsp),%r14
lea    0xc(%rsp),%rcx
mov    %rax,%rdi
mov    %r14,%rdx
call   1060 <fscanf@plt>
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%edx
lea    0xe6e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"C:\\E1ask4\\bus.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [8 x i8] c"Problem\00"
@.str.3 = [7 x i8] c"%s %d\00"
@.str.4 = [20 x i8] c"Periexomena pinaka\0A\00"
@.str.5 = [8 x i8] c"%s\0A %d\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca [54 x i8]
%4 = call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %4, i32** %1
%5 = load i32*, i32** %1
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = load i32*, i32** %1
%12 = getelementptr inbounds [54 x i8], [54 x i8]* %3, i64 0, i64 0
%13 = call i32 @fscanf(i32* %11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %12, i32* %2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%15 = getelementptr inbounds [54 x i8], [54 x i8]* %3, i64 0, i64 0
%16 = load i32, i32* %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %15, i32 %16)
%18 = load i32*, i32** %1
%19 = call i32 @fclose(i32* %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"C:\\E1ask4\\bus.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [8 x i8] c"Problem\00"
@.str.3 = [7 x i8] c"%s %d\00"
@.str.5 = [8 x i8] c"%s\0A %d\0A\00"
@str = [19 x i8] c"Periexomena pinaka\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [54 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [54 x i8], [54 x i8]* %2, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([18 x i8], [18 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 %10
7: ; preds = %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @exit(i32 1)
unreachable
10: ; preds = %0
%11 = call i32 @fscanf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %4, i32* %1)
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%13 = load i32, i32* %1
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %4, i32 %13)
%15 = call i32 @fclose(i32* %5)
ret i32 0
}