#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 */

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ fwrite(int *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  if (argc > 1) {
    fprintf(stderr, "ascii2int < entrada > salida\n");
    return 1;
  }
  fprintf(stderr, "ascii2int: running\n");
  for (;;) {
    int x;
    scanf("%d", &x);
    if (feof(stdin))
      break;
    fwrite(&x, sizeof(int), 1, stdout);
  }
  fprintf(stderr, "ascii2int: done\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1181 <main+0x41>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1200 <main+0xc0>
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xe95(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <scanf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%rax
je     11c3 <main+0x83>
jmp    11e4 <main+0xa4>
mov    0x2e06(%rip),%rax
mov    (%rax),%ecx
lea    -0x14(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
jmp    1196 <main+0x56>
mov    0x2ded(%rip),%rax
mov    (%rax),%edi
lea    0xe41(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %edi,%eax
mov    0x2e82(%rip),%r15
mov    (%r15),%edi
cmp    $0x2,%eax
jl     1174 <main+0x34>
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
jmp    1200 <main+0xc0>
lea    0xea3(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xeab(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x2e50(%rip),%r12
mov    (%r12),%edi
call   1040 <feof@plt>
test   %rax,%rax
jne    11ef <main+0xaf>
mov    0x2e23(%rip),%r13
lea    0xc(%rsp),%rbx
lea    0xe79(%rip),%r14
nopl   0x0(%rax)
mov    0x0(%r13),%ecx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1060 <fwrite@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    (%r12),%edi
call   1040 <feof@plt>
test   %rax,%rax
je     11c0 <main+0x80>
mov    (%r15),%edi
lea    0xe3c(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [30 x i8] c"ascii2int < entrada > salida\0A\00"
@.str.1 = [20 x i8] c"ascii2int: running\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@stdin = global i32 0
@stdout = global i32 0
@.str.3 = [17 x i8] c"ascii2int: done\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sgt i32 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %27
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %15
15: ; preds = %21, %12
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%17 = load i32, i32* @stdin
%18 = call i64 @feof(i32 %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %15
br label %24
21: ; preds = %15
%22 = load i32, i32* @stdout
%23 = call i32 @fwrite(i32* %6, i32 4, i32 1, i32 %22)
br label %15
24: ; preds = %20
%25 = load i32, i32* @stderr
%26 = call i32 @fprintf(i32 %25, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %27
27: ; preds = %24, %9
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [30 x i8] c"ascii2int < entrada > salida\0A\00"
@.str.1 = [20 x i8] c"ascii2int: running\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@stdin = global i32 0
@stdout = global i32 0
@.str.3 = [17 x i8] c"ascii2int: done\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = icmp sgt i32 %0, 1
%5 = load i32, i32* @stderr
br i1 %4, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
br label %25
8: ; preds = %2
%9 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%10 = bitcast i32* %3 to i8*
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = load i32, i32* @stdin
%13 = call i64 @feof(i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %8, %15
%16 = load i32, i32* @stdout
%17 = call i32 @fwrite(i32* %3, i32 4, i32 1, i32 %16)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%19 = load i32, i32* @stdin
%20 = call i64 @feof(i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %15, label %22
22: ; preds = %15, %8
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %22, %6
%26 = phi i32 [ 1, %6 ], [ 0, %22 ]
ret i32 %26
}