#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 /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int read_data(int *year, int *day) {
  printf("The year: ");
  if (scanf("%d", year) == 0) {
    printf("The year is not an number aborting");
    return 0;
  }
  printf("The day: ");
  if (scanf("%d", day) == 0) {
    printf("The day is not an number aborting");
    return 0;
  }
  printf("\n");
  return 1;
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x0,%rax
jne    116e <read_data+0x4e>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11bf <read_data+0x9f>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x0,%rax
jne    11ac <read_data+0x8c>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11bf <read_data+0x9f>
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
lea    0xebe(%rip),%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     118b <read_data+0x5b>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xe9e(%rip),%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     1194 <read_data+0x64>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
jmp    11a2 <read_data+0x72>
lea    0xe7c(%rip),%rdi
jmp    119b <read_data+0x6b>
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"The year: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"The year is not an number aborting\00"
@.str.3 = [10 x i8] c"The day: \00"
@.str.4 = [34 x i8] c"The day is not an number aborting\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @read_data(i32* %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%7 = load i32*, i32** %4
%8 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
br label %21
12: ; preds = %2
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%14 = load i32*, i32** %5
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %21
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %3
br label %21
21: ; preds = %19, %17, %10
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
@.str = [11 x i8] c"The year: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [35 x i8] c"The year is not an number aborting\00"
@.str.3 = [10 x i8] c"The day: \00"
@.str.4 = [34 x i8] c"The day is not an number aborting\00"
define i32 @read_data(i32* %0, i32* %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%4 = tail call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %16
8: ; preds = %2
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
br label %16
14: ; preds = %8
%15 = tail call i32 @putchar(i32 10)
br label %16
16: ; preds = %14, %12, %6
%17 = phi i32 [ 0, %6 ], [ 0, %12 ], [ 1, %14 ]
ret i32 %17
}