Bpputrast(fn, bf, sx, sy, r) char *fn;
float bf[316 * 316];
int sx, sy, r;
{
  int fd, i, j;
  unsigned char c;
  if ((fd = creat(fn, 0600)) > 0) {
    ;
    for (i = 0; i < sy; i++) {
      for (j = 0; j < sx; j++) {
        c = (unsigned char)bf[r * i + j];
        if (write(fd, &c, sizeof(c)) != 1) {
          error(7);
        }
      }
    }
  } else {
    error(9);
  }
  close(fd);
}


x86 assembly (clang, -O0):
<Bpputrast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x180,%esi
mov    $0x0,%al
call   1060 <creat@plt>
mov    %eax,-0x28(%rbp)
cmp    $0x0,%eax
jle    120c <Bpputrast+0xcc>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1207 <Bpputrast+0xc7>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11f4 <Bpputrast+0xb4>
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    -0x2c(%rbp),%edx
imul   %edx,%ecx
mov    -0x30(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
cvttss2si (%rax,%rcx,4),%eax
mov    %al,-0x31(%rbp)
mov    -0x28(%rbp),%edi
lea    -0x31(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0x1,%eax
je     11e1 <Bpputrast+0xa1>
mov    $0x7,%edi
mov    $0x0,%al
call   1050 <error@plt>
jmp    11e6 <Bpputrast+0xa6>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1190 <Bpputrast+0x50>
jmp    11f9 <Bpputrast+0xb9>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    117d <Bpputrast+0x3d>
jmp    1218 <Bpputrast+0xd8>
mov    $0x9,%edi
mov    $0x0,%al
call   1050 <error@plt>
mov    -0x28(%rbp),%edi
mov    $0x0,%al
call   1040 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bpputrast>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r12d
mov    %ecx,%r15d
mov    %edx,0x4(%rsp)
mov    %rsi,%rbp
mov    $0x180,%esi
xor    %eax,%eax
call   1060 <creat@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    11f8 <Bpputrast+0xb8>
test   %r15d,%r15d
jle    1204 <Bpputrast+0xc4>
movslq %r12d,%rax
mov    %r15d,%ecx
mov    %rcx,0x8(%rsp)
mov    0x4(%rsp),%r14d
shl    $0x2,%rax
mov    %rax,0x10(%rsp)
lea    0x3(%rsp),%r15
xor    %r13d,%r13d
jmp    11b0 <Bpputrast+0x70>
nopl   (%rax)
add    $0x1,%r13
add    0x10(%rsp),%rbp
cmp    0x8(%rsp),%r13
je     1204 <Bpputrast+0xc4>
cmpl   $0x0,0x4(%rsp)
jle    11a0 <Bpputrast+0x60>
xor    %r12d,%r12d
jmp    11c9 <Bpputrast+0x89>
nopl   0x0(%rax)
add    $0x1,%r12
cmp    %r12,%r14
je     11a0 <Bpputrast+0x60>
cvttss2si 0x0(%rbp,%r12,4),%eax
mov    %al,0x3(%rsp)
mov    $0x1,%edx
mov    %ebx,%edi
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0x1,%eax
je     11c0 <Bpputrast+0x80>
mov    $0x7,%edi
xor    %eax,%eax
call   1050 <error@plt>
jmp    11c0 <Bpputrast+0x80>
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <error@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1040 <close@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Bpputrast(i8* %0, float* %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca float*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8
store i8* %0, i8** %7
store float* %1, float** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%16 = load i8*, i8** %7
%17 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %16, i32 384)
store i32 %17, i32* %12
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %54
19: ; preds = %5
store i32 0, i32* %13
br label %20
20: ; preds = %50, %19
%21 = load i32, i32* %13
%22 = load i32, i32* %10
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %53
24: ; preds = %20
store i32 0, i32* %14
br label %25
25: ; preds = %46, %24
%26 = load i32, i32* %14
%27 = load i32, i32* %9
%28 = icmp slt i32 %26, %27
br i1 %28, label %29, label %49
29: ; preds = %25
%30 = load float*, float** %8
%31 = load i32, i32* %11
%32 = load i32, i32* %13
%33 = mul nsw i32 %31, %32
%34 = load i32, i32* %14
%35 = add nsw i32 %33, %34
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %30, i64 %36
%38 = load float, float* %37
%39 = fptoui float %38 to i8
store i8 %39, i8* %15
%40 = load i32, i32* %12
%41 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %40, i8* %15, i64 1)
%42 = icmp ne i32 %41, 1
br i1 %42, label %43, label %45
43: ; preds = %29
%44 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 7)
br label %45
45: ; preds = %43, %29
br label %46
46: ; preds = %45
%47 = load i32, i32* %14
%48 = add nsw i32 %47, 1
store i32 %48, i32* %14
br label %25
49: ; preds = %25
br label %50
50: ; preds = %49
%51 = load i32, i32* %13
%52 = add nsw i32 %51, 1
store i32 %52, i32* %13
br label %20
53: ; preds = %20
br label %56
54: ; preds = %5
%55 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 9)
br label %56
56: ; preds = %54, %53
%57 = load i32, i32* %12
%58 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %57)
%59 = load i32, i32* %6
ret i32 %59
}

LLVM IR (-O2):
define i32 @Bpputrast(i8* %0, float* nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %0, i32 384)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %36
9: ; preds = %5
%10 = icmp sgt i32 %3, 0
br i1 %10, label %11, label %38
11: ; preds = %9
%12 = icmp sgt i32 %2, 0
%13 = sext i32 %4 to i64
%14 = zext i32 %3 to i64
%15 = zext i32 %2 to i64
br label %16
16: ; preds = %11, %33
%17 = phi i64 [ 0, %11 ], [ %34, %33 ]
br i1 %12, label %18, label %33
18: ; preds = %16
%19 = mul nsw i64 %17, %13
br label %20
20: ; preds = %18, %30
%21 = phi i64 [ 0, %18 ], [ %31, %30 ]
%22 = add nsw i64 %21, %19
%23 = getelementptr inbounds float, float* %1, i64 %22
%24 = load float, float* %23
%25 = fptoui float %24 to i8
store i8 %25, i8* %6
%26 = call i32 (i32, i8*, i64, ...) bitcast (i32 (...)* @write to i32 (i32, i8*, i64, ...)*)(i32 %7, i8* %6, i64 1)
%27 = icmp eq i32 %26, 1
br i1 %27, label %30, label %28
28: ; preds = %20
%29 = call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 7)
br label %30
30: ; preds = %20, %28
%31 = add nuw nsw i64 %21, 1
%32 = icmp eq i64 %31, %15
br i1 %32, label %33, label %20
33: ; preds = %30, %16
%34 = add nuw nsw i64 %17, 1
%35 = icmp eq i64 %34, %14
br i1 %35, label %38, label %16
36: ; preds = %5
%37 = tail call i32 (i32, ...) bitcast (i32 (...)* @error to i32 (i32, ...)*)(i32 9)
br label %38
38: ; preds = %33, %9, %36
%39 = call i32 (i32, ...) bitcast (i32 (...)* @close to i32 (i32, ...)*)(i32 %7)
ret i32 undef
}