#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*/ u_char;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int main() {
  FILE *f;
  int i;
  f = fopen("address_file", "w");
  for (i = 0; i < 4; i++) {
    fputc((u_char)255, f);
    fputc((u_char)255, f);
    fputc((u_char)255, f);
    fputc((u_char)255, f);
  }
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11ad <main+0x7d>
mov    -0x10(%rbp),%rsi
mov    $0xff,%edi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rsi
mov    $0xff,%edi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rsi
mov    $0xff,%edi
call   1040 <fputc@plt>
mov    -0x10(%rbp),%rsi
mov    $0xff,%edi
call   1040 <fputc@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x2d>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xece(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    $0xff,%edi
mov    %rax,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1040 <fputc@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"address_file\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 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** %2
store i32 0, i32* %3
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = call i32 @fputc(i32 255, i32* %9)
%11 = load i32*, i32** %2
%12 = call i32 @fputc(i32 255, i32* %11)
%13 = load i32*, i32** %2
%14 = call i32 @fputc(i32 255, i32* %13)
%15 = load i32*, i32** %2
%16 = call i32 @fputc(i32 255, i32* %15)
br label %17
17: ; preds = %8
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = load i32*, i32** %2
%22 = call i32 @fclose(i32* %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"address_file\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fputc(i32 255, i32* %1)
%3 = tail call i32 @fputc(i32 255, i32* %1)
%4 = tail call i32 @fputc(i32 255, i32* %1)
%5 = tail call i32 @fputc(i32 255, i32* %1)
%6 = tail call i32 @fputc(i32 255, i32* %1)
%7 = tail call i32 @fputc(i32 255, i32* %1)
%8 = tail call i32 @fputc(i32 255, i32* %1)
%9 = tail call i32 @fputc(i32 255, i32* %1)
%10 = tail call i32 @fputc(i32 255, i32* %1)
%11 = tail call i32 @fputc(i32 255, i32* %1)
%12 = tail call i32 @fputc(i32 255, i32* %1)
%13 = tail call i32 @fputc(i32 255, i32* %1)
%14 = tail call i32 @fputc(i32 255, i32* %1)
%15 = tail call i32 @fputc(i32 255, i32* %1)
%16 = tail call i32 @fputc(i32 255, i32* %1)
%17 = tail call i32 @fputc(i32 255, i32* %1)
%18 = tail call i32 @fclose(i32* %1)
ret i32 0
}