void write_le_int32(struct _IO_FILE$link44 *dfile, signed int num) {
  fputc(num & 255, dfile);
  fputc(num >> 8 & 255, dfile);
  fputc(num >> 16 & 255, dfile);
  fputc(num >> 24 & 255, dfile);
}


x86 assembly (clang, -O0):
<write_le_int32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_le_int32>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
movzbl %bl,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
movzbl %bh,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <fputc@plt>
shr    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fputc@plt>

LLVM IR (-O0):
%"struct._IO_FILE$link44" = type opaque
define void @write_le_int32(%"struct._IO_FILE$link44"* %0, i32 %1) {
%3 = alloca %"struct._IO_FILE$link44"*
%4 = alloca i32
store %"struct._IO_FILE$link44"* %0, %"struct._IO_FILE$link44"** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 255
%7 = load %"struct._IO_FILE$link44"*, %"struct._IO_FILE$link44"** %3
%8 = call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %6, %"struct._IO_FILE$link44"* %7)
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 255
%12 = load %"struct._IO_FILE$link44"*, %"struct._IO_FILE$link44"** %3
%13 = call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %11, %"struct._IO_FILE$link44"* %12)
%14 = load i32, i32* %4
%15 = ashr i32 %14, 16
%16 = and i32 %15, 255
%17 = load %"struct._IO_FILE$link44"*, %"struct._IO_FILE$link44"** %3
%18 = call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %16, %"struct._IO_FILE$link44"* %17)
%19 = load i32, i32* %4
%20 = ashr i32 %19, 24
%21 = and i32 %20, 255
%22 = load %"struct._IO_FILE$link44"*, %"struct._IO_FILE$link44"** %3
%23 = call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %21, %"struct._IO_FILE$link44"* %22)
ret void
}

LLVM IR (-O2):
%"struct._IO_FILE$link44" = type opaque
define void @write_le_int32(%"struct._IO_FILE$link44"* %0, i32 %1) {
%3 = and i32 %1, 255
%4 = tail call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %3, %"struct._IO_FILE$link44"* %0)
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = tail call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %6, %"struct._IO_FILE$link44"* %0)
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = tail call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %9, %"struct._IO_FILE$link44"* %0)
%11 = lshr i32 %1, 24
%12 = tail call i32 (i32, %"struct._IO_FILE$link44"*, ...) bitcast (i32 (...)* @fputc to i32 (i32, %"struct._IO_FILE$link44"*, ...)*)(i32 %11, %"struct._IO_FILE$link44"* %0)
ret void
}