#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 */
int /*<<< orphan*/ drawStr(char *, int, int, int);
int /*<<< orphan*/ gotoxy(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void drawDate(struct tm *timeinfo) {
  char buf[6];
  gotoxy(36, 2);
  printf("Today's date");
  gotoxy(36, 5);
  strftime(buf, 6, "%a%d", timeinfo);
  drawStr(buf, 6, 36, 5);
}


x86 assembly (clang, -O0):
<drawDate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x24,%edi
mov    $0x2,%esi
call   1060 <gotoxy@plt>
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x24,%edi
mov    $0x5,%esi
call   1060 <gotoxy@plt>
lea    -0xe(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x6,%esi
lea    0xe83(%rip),%rdx
call   1050 <strftime@plt>
lea    -0xe(%rbp),%rdi
mov    $0x6,%esi
mov    $0x24,%edx
mov    $0x5,%ecx
call   1040 <drawStr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawDate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x24,%edi
mov    $0x2,%esi
call   1060 <gotoxy@plt>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x24,%edi
mov    $0x5,%esi
call   1060 <gotoxy@plt>
lea    0xe95(%rip),%rdx
lea    0x2(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    %r14,%rcx
call   1050 <strftime@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x24,%edx
mov    $0x5,%ecx
call   1040 <drawStr@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [13 x i8] c"Today's date\00"
@.str.1 = [5 x i8] c"%a%d\00"
define void @drawDate(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca [6 x i8]
store %struct.tm* %0, %struct.tm** %2
%4 = call i32 @gotoxy(i32 36, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @gotoxy(i32 36, i32 5)
%7 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%8 = load %struct.tm*, %struct.tm** %2
%9 = call i32 @strftime(i8* %7, i32 6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %8)
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %3, i64 0, i64 0
%11 = call i32 @drawStr(i8* %10, i32 6, i32 36, i32 5)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [13 x i8] c"Today's date\00"
@.str.1 = [5 x i8] c"%a%d\00"
define void @drawDate(%struct.tm* %0) {
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @gotoxy(i32 36, i32 2)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @gotoxy(i32 36, i32 5)
%7 = call i32 @strftime(i8* %3, i32 6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %0)
%8 = call i32 @drawStr(i8* %3, i32 6, i32 36, i32 5)
ret void
}