#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 /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void GifLoop(FILE *fout, unsigned int repeats) {
  fputc(0x21, fout);
  fputc(0xFF, fout);
  fputc(0x0B, fout);
  fputs("NETSCAPE2.0", fout);
  fputc(0x03, fout);
  fputc(0x01, fout);
  {
    fputc(repeats & 0xff, fout);
    fputc(repeats >> 8, fout);
  };
  fputc(0x00, fout);
}


x86 assembly (clang, -O0):
<GifLoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x21,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xff,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0xb,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rsi
lea    0xe9c(%rip),%rdi
call   1030 <fputs@plt>
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1040 <fputc@plt>
mov    -0xc(%rbp),%edi
and    $0xff,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0xc(%rbp),%edi
shr    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1040 <fputc@plt>
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1040 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GifLoop>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x21,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0xff,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0xb,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
lea    0xeaa(%rip),%rdi
mov    $0xb,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1040 <fwrite@plt>
mov    $0x3,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
movzbl %bpl,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
shr    $0x8,%ebp
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
xor    %edi,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"NETSCAPE2.0\00"
define void @GifLoop(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = call i32 @fputc(i32 33, i32* %5)
%7 = load i32*, i32** %3
%8 = call i32 @fputc(i32 255, i32* %7)
%9 = load i32*, i32** %3
%10 = call i32 @fputc(i32 11, i32* %9)
%11 = load i32*, i32** %3
%12 = call i32 @fputs(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = load i32*, i32** %3
%14 = call i32 @fputc(i32 3, i32* %13)
%15 = load i32*, i32** %3
%16 = call i32 @fputc(i32 1, i32* %15)
%17 = load i32, i32* %4
%18 = and i32 %17, 255
%19 = load i32*, i32** %3
%20 = call i32 @fputc(i32 %18, i32* %19)
%21 = load i32, i32* %4
%22 = lshr i32 %21, 8
%23 = load i32*, i32** %3
%24 = call i32 @fputc(i32 %22, i32* %23)
%25 = load i32*, i32** %3
%26 = call i32 @fputc(i32 0, i32* %25)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"NETSCAPE2.0\00"
define void @GifLoop(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fputc(i32 33, i32* %0)
%4 = tail call i32 @fputc(i32 255, i32* %0)
%5 = tail call i32 @fputc(i32 11, i32* %0)
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i64 11, i64 1, i32* %0)
%7 = tail call i32 @fputc(i32 3, i32* %0)
%8 = tail call i32 @fputc(i32 1, i32* %0)
%9 = and i32 %1, 255
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = lshr i32 %1, 8
%12 = tail call i32 @fputc(i32 %11, i32* %0)
%13 = tail call i32 @fputc(i32 0, i32* %0)
ret void
}