#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*/ uint64_t;
struct list_elem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cdf_print(struct list_elem *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
struct list_elem *list_insert(struct list_elem *, int);
int scanf(char *, int *, int *, int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  int dummy, index, r;
  uint64_t f;
  struct list_elem *h;
  int res;
  h = NULL;
  while (!feof(stdin)) {
    res = scanf("%d %d %Lu\t%d\n", &dummy, &index, &f, &r);
    if (res == 4) {
      h = list_insert(h, r);
    }
  }
  cdf_print(h);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1181 <main+0x41>
jmp    11bf <main+0x7f>
lea    0xe78(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x1c(%rbp),%r8
call   1060 <scanf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jne    11ba <main+0x7a>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <list_insert@plt>
mov    %rax,-0x28(%rbp)
jmp    115e <main+0x1e>
mov    -0x28(%rbp),%rdi
call   1030 <cdf_print@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     117b <main+0x3b>
mov    %rbx,%rdi
call   1030 <cdf_print@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe7e(%rip),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%r13
lea    0x8(%rsp),%rbp
jmp    11b2 <main+0x72>
nopl   0x0(%rax,%rax,1)
mov    0x2e41(%rip),%rax
mov    (%rax),%edi
call   1040 <feof@plt>
test   %eax,%eax
jne    1162 <main+0x22>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1060 <scanf@plt>
cmp    $0x4,%eax
jne    11a0 <main+0x60>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1050 <list_insert@plt>
mov    %rax,%rbx
jmp    11a0 <main+0x60>

LLVM IR (-O0):
%struct.list_elem = type { i32 }
@stdin = global i32 0
@.str = [14 x i8] c"%d %d %Lu\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.list_elem*
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.list_elem* null, %struct.list_elem** %10
br label %12
12: ; preds = %25, %2
%13 = load i32, i32* @stdin
%14 = call i32 @feof(i32 %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %26
17: ; preds = %12
%18 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %6, i32* %7, i32* %9, i32* %8)
store i32 %18, i32* %11
%19 = load i32, i32* %11
%20 = icmp eq i32 %19, 4
br i1 %20, label %21, label %25
21: ; preds = %17
%22 = load %struct.list_elem*, %struct.list_elem** %10
%23 = load i32, i32* %8
%24 = call %struct.list_elem* @list_insert(%struct.list_elem* %22, i32 %23)
store %struct.list_elem* %24, %struct.list_elem** %10
br label %25
25: ; preds = %21, %17
br label %12
26: ; preds = %12
%27 = load %struct.list_elem*, %struct.list_elem** %10
%28 = call i32 @cdf_print(%struct.list_elem* %27)
ret i32 0
}

LLVM IR (-O2):
%struct.list_elem = type { i32 }
@stdin = global i32 0
@.str = [14 x i8] c"%d %d %Lu\09%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = load i32, i32* @stdin
%12 = call i32 @feof(i32 %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %26
14: ; preds = %2, %21
%15 = phi %struct.list_elem* [ %22, %21 ], [ null, %2 ]
%16 = call i32 @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %6, i32* %5)
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %5
%20 = call %struct.list_elem* @list_insert(%struct.list_elem* %15, i32 %19)
br label %21
21: ; preds = %18, %14
%22 = phi %struct.list_elem* [ %20, %18 ], [ %15, %14 ]
%23 = load i32, i32* @stdin
%24 = call i32 @feof(i32 %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %14, label %26
26: ; preds = %21, %2
%27 = phi %struct.list_elem* [ null, %2 ], [ %22, %21 ]
%28 = call i32 @cdf_print(%struct.list_elem* %27)
ret i32 0
}