#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printhead(int /*<<< orphan*/ *);
int /*<<< orphan*/ printtail(int /*<<< orphan*/ *);
void make_tabletex(void) {
  FILE *fout;
  fout = fopen("table_smooth.tex", "a+");
  if (fout != NULL) {
    printhead(fout);
    fprintf(fout, "\\section* {Таблицы:}  \n");
    fprintf(fout, "\\input{gc.tex}  \n");
    fprintf(fout, "\\input{gl2.tex} \n");
    fprintf(fout, "\\input{v1c.tex}  \n");
    fprintf(fout, "\\input{v1l2.tex} \n");
    fprintf(fout, "\\input{v2c.tex}  \n");
    fprintf(fout, "\\input{v2l2.tex} \n");
    fprintf(fout, "\\input{time.tex} \n");
    printtail(fout);
    fclose(fout);
  } else {
    printf("Can't open texfile\n");
  }
}


x86 assembly (clang, -O0):
<make_tabletex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe91(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     122a <make_tabletex+0xca>
mov    -0x8(%rbp),%rdi
call   1030 <printhead@plt>
mov    -0x8(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe85(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe8f(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <printtail@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1236 <make_tabletex+0xd6>
lea    0xe85(%rip),%rdi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_tabletex>:
push   %rbx
lea    0xe98(%rip),%rdi
lea    0xea2(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1261 <make_tabletex+0x101>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <printhead@plt>
lea    0xe85(%rip),%rdi
mov    $0x1e,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe8b(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe84(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe7d(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe77(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe71(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe6b(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe65(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
mov    %rbx,%rdi
call   1060 <printtail@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <fclose@plt>
lea    0xe4e(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"table_smooth.tex\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [31 x i8] c"\\section* {\D0\A2\D0\B0\D0\B1\D0\BB\D0\B8\D1\86\D1\8B:} \0A\00"
@.str.3 = [18 x i8] c"\\input{gc.tex} \0A\00"
@.str.4 = [18 x i8] c"\\input{gl2.tex} \0A\00"
@.str.5 = [19 x i8] c"\\input{v1c.tex} \0A\00"
@.str.6 = [19 x i8] c"\\input{v1l2.tex} \0A\00"
@.str.7 = [19 x i8] c"\\input{v2c.tex} \0A\00"
@.str.8 = [19 x i8] c"\\input{v2l2.tex} \0A\00"
@.str.9 = [19 x i8] c"\\input{time.tex} \0A\00"
@.str.10 = [20 x i8] c"Can't open texfile\0A\00"
define void @make_tabletex() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %5, label %28
5: ; preds = %0
%6 = load i32*, i32** %1
%7 = call i32 @printhead(i32* %6)
%8 = load i32*, i32** %1
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32*, i32** %1
%11 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%12 = load i32*, i32** %1
%13 = call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%14 = load i32*, i32** %1
%15 = call i32 @fprintf(i32* %14, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%16 = load i32*, i32** %1
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32*, i32** %1
%19 = call i32 @fprintf(i32* %18, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32*, i32** %1
%21 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0))
%22 = load i32*, i32** %1
%23 = call i32 @fprintf(i32* %22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
%24 = load i32*, i32** %1
%25 = call i32 @printtail(i32* %24)
%26 = load i32*, i32** %1
%27 = call i32 @fclose(i32* %26)
br label %30
28: ; preds = %0
%29 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
br label %30
30: ; preds = %28, %5
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"table_smooth.tex\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [31 x i8] c"\\section* {\D0\A2\D0\B0\D0\B1\D0\BB\D0\B8\D1\86\D1\8B:} \0A\00"
@.str.3 = [18 x i8] c"\\input{gc.tex} \0A\00"
@.str.4 = [18 x i8] c"\\input{gl2.tex} \0A\00"
@.str.5 = [19 x i8] c"\\input{v1c.tex} \0A\00"
@.str.6 = [19 x i8] c"\\input{v1l2.tex} \0A\00"
@.str.7 = [19 x i8] c"\\input{v2c.tex} \0A\00"
@.str.8 = [19 x i8] c"\\input{v2l2.tex} \0A\00"
@.str.9 = [19 x i8] c"\\input{time.tex} \0A\00"
@str = [19 x i8] c"Can't open texfile\00"
define void @make_tabletex() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %15, label %3
3: ; preds = %0
%4 = tail call i32 @printhead(i32* %1)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i64 30, i64 1, i32* %1)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i64 17, i64 1, i32* %1)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i64 17, i64 1, i32* %1)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i64 18, i64 1, i32* %1)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i64 18, i64 1, i32* %1)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 18, i64 1, i32* %1)
%11 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i64 18, i64 1, i32* %1)
%12 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0), i64 18, i64 1, i32* %1)
%13 = tail call i32 @printtail(i32* %1)
%14 = tail call i32 @fclose(i32* %1)
br label %17
15: ; preds = %0
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %17
17: ; preds = %15, %3
ret void
}