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


x86 assembly (clang, -O0):
<fput4b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%eax
je     11bc <fput4b+0xac>
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    0x2e7d(%rip),%rcx
cmp    (%rcx),%eax
je     11b7 <fput4b+0xa7>
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    0x2e53(%rip),%rcx
cmp    (%rcx),%eax
je     11b2 <fput4b+0xa2>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
jmp    11b7 <fput4b+0xa7>
jmp    11bc <fput4b+0xac>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fput4b>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
mov    %edi,%eax
shr    $0x18,%eax
mov    %eax,%edi
call   1030 <fputc@plt>
mov    0x2ebb(%rip),%r15
cmp    (%r15),%eax
je     1157 <fput4b+0x47>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmp    (%r15),%eax
je     1157 <fput4b+0x47>
movzbl %bh,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
cmp    (%r15),%eax
jne    115d <fput4b+0x4d>
pop    %rbx
pop    %r14
pop    %r15
ret
movzbl %bl,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <fputc@plt>

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @fput4b(i32 %0, i32* nocapture %1) {
%3 = lshr i32 %0, 24
%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, 16
%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, 8
%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 = and i32 %0, 255
%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
}