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

/* Variables and functions */
scalar_t__ EOF;
struct tm *malloc(int);
scalar_t__ scanf(char *, int *, int *, int *);
int main(int argc, const char *argv[]) {
  struct tm *t;
  int y, m, d, sd, sy;
  while (scanf("%4d/%2d/%2d", &y, &m, &d) != EOF) {
    t = malloc(sizeof(struct tm));
  }
  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)
lea    0xec3(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1040 <scanf@plt>
mov    0x2e93(%rip),%rcx
cmp    (%rcx),%rax
je     1171 <main+0x51>
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
jmp    1136 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x2e99(%rip),%r13
cmp    0x0(%r13),%rax
je     1191 <main+0x71>
lea    0xea4(%rip),%r14
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1170 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%4d/%2d/%2d\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.tm*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %12
12: ; preds = %16, %2
%13 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %7, i32* %8, i32* %9)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call %struct.tm* @malloc(i32 4)
store %struct.tm* %17, %struct.tm** %6
br label %12
18: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [12 x i8] c"%4d/%2d/%2d\00"
@EOF = global i64 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %17, label %12
12: ; preds = %2, %12
%13 = call %struct.tm* @malloc(i32 4)
%14 = call i64 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%15 = load i64, i64* @EOF
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %12
17: ; preds = %12, %2
ret i32 0
}