#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*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ strcat(char *, char *);
FILE *OpenFile(char *nombre) {
  FILE *aA;
  char archivo[200] = "DATOS/";
  strcat(archivo, nombre);
  aA = fopen(archivo, "w");
  fputs("# x y tipo tamano\n", aA);
  return aA;
}


x86 assembly (clang, -O0):
<OpenFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1040 <memset@plt>
movb   $0x44,-0xe0(%rbp)
movb   $0x41,-0xdf(%rbp)
movb   $0x54,-0xde(%rbp)
movb   $0x4f,-0xdd(%rbp)
movb   $0x53,-0xdc(%rbp)
movb   $0x2f,-0xdb(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1060 <strcat@plt>
lea    -0xe0(%rbp),%rdi
lea    0xe56(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe44(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x10(%rbp),%rax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OpenFile>:
push   %rbx
sub    $0xd0,%rsp
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0xc0(%rsp)
movl   $0x4f544144,(%rsp)
movw   $0x2f53,0x4(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xe4f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <fopen@plt>
mov    %rax,%rbx
lea    0xe3f(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [19 x i8] c"# x y tipo tamano\0A\00"
define i32* @OpenFile(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [200 x i8]
store i8* %0, i8** %2
%5 = bitcast [200 x i8]* %4 to i8*
%6 = bitcast i8* %5 to [200 x i8]*
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 0
store i8 68, i8* %7
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 1
store i8 65, i8* %8
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 2
store i8 84, i8* %9
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 3
store i8 79, i8* %10
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 4
store i8 83, i8* %11
%12 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i32 0, i32 5
store i8 47, i8* %12
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%14 = load i8*, i8** %2
%15 = call i32 @strcat(i8* %13, i8* %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %17, i32** %3
%18 = load i32*, i32** %3
%19 = call i32 @fputs(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = load i32*, i32** %3
ret i32* %20
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [19 x i8] c"# x y tipo tamano\0A\00"
define noalias i32* @OpenFile(i8* %0) {
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
store i8 68, i8* %3
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 1
store i8 65, i8* %4
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 2
store i8 84, i8* %5
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 3
store i8 79, i8* %6
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 4
store i8 83, i8* %7
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 5
store i8 47, i8* %8
%9 = call i32 @strcat(i8* %3, i8* %0)
%10 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i64 18, i64 1, i32* %10)
ret i32* %10
}