#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 */
char EOF;
char leer(int /*<<< orphan*/ *, int *);
void leer_numero(FILE *fp, int *seek, char numero[4]) {
  int i = 0;
  while (i < 4 && (numero[i++] = leer(fp, seek)) != EOF)
    ;
}


x86 assembly (clang, -O0):
<leer_numero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x4,-0x1c(%rbp)
mov    %al,-0x1d(%rbp)
jge    1171 <leer_numero+0x61>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <leer@plt>
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%edx
mov    %edx,%esi
add    $0x1,%esi
mov    %esi,-0x1c(%rbp)
movslq %edx,%rdx
mov    %al,(%rcx,%rdx,1)
movsbl %al,%eax
mov    0x2e82(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    1181 <leer_numero+0x71>
jmp    1186 <leer_numero+0x76>
jmp    112b <leer_numero+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leer_numero>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
mov    0x2ebd(%rip),%r13
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <leer@plt>
mov    %al,(%r14,%rbx,1)
cmp    0x0(%r13),%al
je     1152 <leer_numero+0x42>
lea    0x1(%rbx),%rax
cmp    $0x3,%rbx
mov    %rax,%rbx
jb     1130 <leer_numero+0x20>
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
define void @leer_numero(i32* %0, i32* %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i8* %2, i8** %6
store i32 0, i32* %7
br label %8
8: ; preds = %26, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %24
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load i32*, i32** %5
%14 = call signext i8 @leer(i32* %12, i32* %13)
%15 = load i8*, i8** %6
%16 = load i32, i32* %7
%17 = add nsw i32 %16, 1
store i32 %17, i32* %7
%18 = sext i32 %16 to i64
%19 = getelementptr inbounds i8, i8* %15, i64 %18
store i8 %14, i8* %19
%20 = sext i8 %14 to i32
%21 = load i8, i8* @EOF
%22 = sext i8 %21 to i32
%23 = icmp ne i32 %20, %22
br label %24
24: ; preds = %11, %8
%25 = phi i1 [ false, %8 ], [ %23, %11 ]
br i1 %25, label %26, label %27
26: ; preds = %24
br label %8
27: ; preds = %24
ret void
}

LLVM IR (-O2):
@EOF = global i8 0
define void @leer_numero(i32* %0, i32* %1, i8* nocapture writeonly %2) {
br label %4
4: ; preds = %3, %4
%5 = phi i64 [ 0, %3 ], [ %7, %4 ]
%6 = tail call signext i8 @leer(i32* %0, i32* %1)
%7 = add nuw nsw i64 %5, 1
%8 = getelementptr inbounds i8, i8* %2, i64 %5
store i8 %6, i8* %8
%9 = load i8, i8* @EOF
%10 = icmp ne i8 %6, %9
%11 = icmp ult i64 %5, 3
%12 = select i1 %10, i1 %11, i1 false
br i1 %12, label %4, label %13
13: ; preds = %4
ret void
}