#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 EOF;
int fputc(int, int /*<<< orphan*/ *);
int fput4l(int value, FILE *stream) {
  int result;
  result = fputc(value & 0xff, stream);
  if (result != EOF) {
    result = fputc((value >> 8) & 0xff, stream);
    if (result != EOF) {
      result = fputc((value >> 16) & 0xff, stream);
      if (result != EOF) {
        result = fputc((value >> 24) & 0xff, stream);
      }
    }
  }
  return result;
}


x86 assembly (clang, -O0):
<fput4l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2eaa(%rip),%rcx
cmp    (%rcx),%eax
je     11bc <fput4l+0xac>
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e80(%rip),%rcx
cmp    (%rcx),%eax
je     11b7 <fput4l+0xa7>
mov    -0x4(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e56(%rip),%rcx
cmp    (%rcx),%eax
je     11b2 <fput4l+0xa2>
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
jmp    11b7 <fput4l+0xa7>
jmp    11bc <fput4l+0xac>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput4l>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
movzbl %bl,%edi
call   1030 <fputc@plt>
mov    0x2ebf(%rip),%r15
cmp    (%r15),%eax
je     1153 <fput4l+0x43>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmp    (%r15),%eax
je     1153 <fput4l+0x43>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmp    (%r15),%eax
jne    1159 <fput4l+0x49>
pop    %rbx
pop    %r14
pop    %r15
ret
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@EOF = global i32 0
define i32 @fput4l(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = load i32, i32* %3
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = call i32 @fputc(i32 %7, i32* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %39
13: ; preds = %2
%14 = load i32, i32* %3
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %4
%18 = call i32 @fputc(i32 %16, i32* %17)
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = load i32, i32* @EOF
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %38
22: ; preds = %13
%23 = load i32, i32* %3
%24 = ashr i32 %23, 16
%25 = and i32 %24, 255
%26 = load i32*, i32** %4
%27 = call i32 @fputc(i32 %25, i32* %26)
store i32 %27, i32* %5
%28 = load i32, i32* %5
%29 = load i32, i32* @EOF
%30 = icmp ne i32 %28, %29
br i1 %30, label %31, label %37
31: ; preds = %22
%32 = load i32, i32* %3
%33 = ashr i32 %32, 24
%34 = and i32 %33, 255
%35 = load i32*, i32** %4
%36 = call i32 @fputc(i32 %34, i32* %35)
store i32 %36, i32* %5
br label %37
37: ; preds = %31, %22
br label %38
38: ; preds = %37, %13
br label %39
39: ; preds = %38, %2
%40 = load i32, i32* %5
ret i32 %40
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fput4l(i32 %0, i32* nocapture %1) {
%3 = and i32 %0, 255
%4 = tail call i32 @fputc(i32 %3, i32* %1)
%5 = load i32, i32* @EOF
%6 = icmp eq i32 %4, %5
br i1 %6, label %22, label %7
7: ; preds = %2
%8 = lshr i32 %0, 8
%9 = and i32 %8, 255
%10 = tail call i32 @fputc(i32 %9, i32* %1)
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %22, label %13
13: ; preds = %7
%14 = lshr i32 %0, 16
%15 = and i32 %14, 255
%16 = tail call i32 @fputc(i32 %15, i32* %1)
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %22, label %19
19: ; preds = %13
%20 = lshr i32 %0, 24
%21 = tail call i32 @fputc(i32 %20, i32* %1)
br label %22
22: ; preds = %7, %19, %13, %2
%23 = phi i32 [ %21, %19 ], [ %16, %13 ], [ %10, %7 ], [ %4, %2 ]
ret i32 %23
}