#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*/ putc(int, int /*<<< orphan*/ *);
int trs_create_blank_jv3(char *fname) {
  FILE *f;
  int i;
  f = fopen(fname, "wb");
  if (f == NULL)
    return -1;
  for (i = 0; i < (256 * 34); i++)
    putc(0xff, f);
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<trs_create_blank_jv3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <trs_create_blank_jv3+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a7 <trs_create_blank_jv3+0x77>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2200,-0x1c(%rbp)
jge    1197 <trs_create_blank_jv3+0x67>
mov    -0x18(%rbp),%rsi
mov    $0xff,%edi
call   1040 <putc@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116e <trs_create_blank_jv3+0x3e>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trs_create_blank_jv3>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     116e <trs_create_blank_jv3+0x3e>
mov    %rax,%rbx
mov    $0x2200,%ebp
nopl   0x0(%rax)
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <putc@plt>
add    $0xffffffff,%ebp
jne    1150 <trs_create_blank_jv3+0x20>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1173 <trs_create_blank_jv3+0x43>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"wb\00"
define i32 @trs_create_blank_jv3(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %24
11: ; preds = %1
store i32 0, i32* %5
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %5
%14 = icmp slt i32 %13, 8704
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32*, i32** %4
%17 = call i32 @putc(i32 255, i32* %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %12
21: ; preds = %12
%22 = load i32*, i32** %4
%23 = call i32 @fclose(i32* %22)
store i32 0, i32* %2
br label %24
24: ; preds = %21, %10
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [3 x i8] c"wb\00"
define i32 @trs_create_blank_jv3(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = tail call i32 @putc(i32 255, i32* %2)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, 8704
br i1 %8, label %9, label %4
9: ; preds = %4
%10 = tail call i32 @fclose(i32* %2)
br label %11
11: ; preds = %1, %9
%12 = phi i32 [ 0, %9 ], [ -1, %1 ]
ret i32 %12
}