#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 */
int EOF;
int fgetc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  int c = EOF;
  c &= (1 << 24) - 1;
  printf("%d\n", c);
  c = fgetc(stdin);
  c &= (1 << 24) - 1;
  printf("%d\n", c);
  c = fgetc(stdin);
  c &= (1 << 24) - 1;
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
call   1040 <fgetc@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xe61(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%rax
mov    $0xffffff,%esi
and    (%rax),%esi
lea    0xec7(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rbx
mov    (%rbx),%edi
call   1040 <fgetc@plt>
and    $0xffffff,%eax
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%rbx),%edi
call   1040 <fgetc@plt>
and    $0xffffff,%eax
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* @EOF
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = and i32 %3, 16777215
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdin
%8 = call i32 @fgetc(i32 %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = and i32 %9, 16777215
store i32 %10, i32* %1
%11 = load i32, i32* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @stdin
%14 = call i32 @fgetc(i32 %13)
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = and i32 %15, 16777215
store i32 %16, i32* %1
%17 = load i32, i32* %1
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
ret i32 0
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = and i32 %1, 16777215
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = load i32, i32* @stdin
%5 = tail call i32 @fgetc(i32 %4)
%6 = and i32 %5, 16777215
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stdin
%9 = tail call i32 @fgetc(i32 %8)
%10 = and i32 %9, 16777215
%11 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}