#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 *, ...);
int /*<<< orphan*/ scanf(char *, unsigned short *, unsigned short *, ...);
main() {
  unsigned short godina, mesec, dan, sat, minut;
  unsigned long vreme;
  printf("Dan, mesec, godina? ");
  scanf("%hd%hd%hd", &dan, &mesec, &godina);
  printf("Sat, minut? ");
  scanf("%hd%hd", &sat, &minut);
  vreme = (unsigned long)godina << 20 | (unsigned long)mesec << 16 | dan << 11 |
          sat << 6 | minut;
  printf("Pakovano: %lu (%lx)\n", vreme, vreme);
  godina = vreme >> 20;
  mesec = vreme >> 16 & 0x0f;
  dan = vreme >> 11 & 0x1f;
  sat = vreme >> 6 & 0x1f;
  minut = vreme & 0x3f;
  printf("Raspakovano: %hd.%hd.%hd %hd:%hd\n", dan, mesec, godina, sat, minut);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x6(%rbp),%rsi
lea    -0x4(%rbp),%rdx
lea    -0x2(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xec8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xa(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
movzwl -0x2(%rbp),%eax
shl    $0x14,%rax
movzwl -0x4(%rbp),%ecx
shl    $0x10,%rcx
or     %rcx,%rax
movzwl -0x6(%rbp),%ecx
shl    $0xb,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
movzwl -0x8(%rbp),%ecx
shl    $0x6,%ecx
movslq %ecx,%rcx
or     %rcx,%rax
movzwl -0xa(%rbp),%ecx
or     %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
shr    $0x14,%rax
mov    %ax,-0x2(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x10,%rax
and    $0xf,%rax
mov    %ax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
shr    $0xb,%rax
and    $0x1f,%rax
mov    %ax,-0x6(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x6,%rax
and    $0x1f,%rax
mov    %ax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
and    $0x3f,%rax
mov    %ax,-0xa(%rbp)
movzwl -0x6(%rbp),%esi
movzwl -0x4(%rbp),%edx
movzwl -0x2(%rbp),%ecx
movzwl -0x8(%rbp),%r8d
movzwl -0xa(%rbp),%r9d
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    0xa(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0xe(%rsp),%rcx
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x6(%rsp),%rdx
xor    %eax,%eax
call   1040 <scanf@plt>
movzwl 0xe(%rsp),%eax
shl    $0x14,%rax
movzwl 0xc(%rsp),%ecx
shl    $0x10,%rcx
or     %rax,%rcx
movzwl 0xa(%rsp),%eax
shl    $0xb,%rax
movzwl 0x8(%rsp),%ebx
shl    $0x6,%rbx
or     %rax,%rbx
or     %rcx,%rbx
movzwl 0x6(%rsp),%r14d
mov    %r14,%r15
or     %rbx,%r15
lea    0xe72(%rip),%rdi
mov    %r15,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rax
shr    $0x14,%rax
mov    %ax,0xe(%rsp)
shr    $0x10,%ebx
and    $0xf,%ebx
mov    %bx,0xc(%rsp)
movzwl %r15w,%esi
shr    $0xb,%esi
mov    %si,0xa(%rsp)
shr    $0x6,%r15d
and    $0x1f,%r15d
mov    %r15w,0x8(%rsp)
and    $0x3f,%r14d
mov    %r14w,0x6(%rsp)
movzwl %ax,%ecx
lea    0xe35(%rip),%rdi
mov    %ebx,%edx
mov    %r15d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Dan, mesec, godina? \00"
@.str.1 = [10 x i8] c"%hd%hd%hd\00"
@.str.2 = [13 x i8] c"Sat, minut? \00"
@.str.3 = [7 x i8] c"%hd%hd\00"
@.str.4 = [21 x i8] c"Pakovano: %lu (%lx)\0A\00"
@.str.5 = [34 x i8] c"Raspakovano: %hd.%hd.%hd %hd:%hd\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = alloca i64
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, i16*, i16*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i16* %3, i16* %2, i16* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, i16*, i16*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i16* %4, i16* %5)
%11 = load i16, i16* %1
%12 = zext i16 %11 to i64
%13 = shl i64 %12, 20
%14 = load i16, i16* %2
%15 = zext i16 %14 to i64
%16 = shl i64 %15, 16
%17 = or i64 %13, %16
%18 = load i16, i16* %3
%19 = zext i16 %18 to i32
%20 = shl i32 %19, 11
%21 = sext i32 %20 to i64
%22 = or i64 %17, %21
%23 = load i16, i16* %4
%24 = zext i16 %23 to i32
%25 = shl i32 %24, 6
%26 = sext i32 %25 to i64
%27 = or i64 %22, %26
%28 = load i16, i16* %5
%29 = zext i16 %28 to i64
%30 = or i64 %27, %29
store i64 %30, i64* %6
%31 = load i64, i64* %6
%32 = load i64, i64* %6
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %31, i64 %32)
%34 = load i64, i64* %6
%35 = lshr i64 %34, 20
%36 = trunc i64 %35 to i16
store i16 %36, i16* %1
%37 = load i64, i64* %6
%38 = lshr i64 %37, 16
%39 = and i64 %38, 15
%40 = trunc i64 %39 to i16
store i16 %40, i16* %2
%41 = load i64, i64* %6
%42 = lshr i64 %41, 11
%43 = and i64 %42, 31
%44 = trunc i64 %43 to i16
store i16 %44, i16* %3
%45 = load i64, i64* %6
%46 = lshr i64 %45, 6
%47 = and i64 %46, 31
%48 = trunc i64 %47 to i16
store i16 %48, i16* %4
%49 = load i64, i64* %6
%50 = and i64 %49, 63
%51 = trunc i64 %50 to i16
store i16 %51, i16* %5
%52 = load i16, i16* %3
%53 = zext i16 %52 to i32
%54 = load i16, i16* %2
%55 = zext i16 %54 to i32
%56 = load i16, i16* %1
%57 = zext i16 %56 to i32
%58 = load i16, i16* %4
%59 = zext i16 %58 to i32
%60 = load i16, i16* %5
%61 = zext i16 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %53, i32 %55, i32 %57, i32 %59, i32 %61)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Dan, mesec, godina? \00"
@.str.1 = [10 x i8] c"%hd%hd%hd\00"
@.str.2 = [13 x i8] c"Sat, minut? \00"
@.str.3 = [7 x i8] c"%hd%hd\00"
@.str.4 = [21 x i8] c"Pakovano: %lu (%lx)\0A\00"
@.str.5 = [34 x i8] c"Raspakovano: %hd.%hd.%hd %hd:%hd\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i16
%4 = alloca i16
%5 = alloca i16
%6 = bitcast i16* %1 to i8*
%7 = bitcast i16* %2 to i8*
%8 = bitcast i16* %3 to i8*
%9 = bitcast i16* %4 to i8*
%10 = bitcast i16* %5 to i8*
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, i16*, i16*, ...) @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i16* %3, i16* %2, i16* %1)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, i16*, i16*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i16* %4, i16* %5)
%15 = load i16, i16* %1
%16 = zext i16 %15 to i64
%17 = shl nuw nsw i64 %16, 20
%18 = load i16, i16* %2
%19 = zext i16 %18 to i64
%20 = shl nuw nsw i64 %19, 16
%21 = or i64 %20, %17
%22 = load i16, i16* %3
%23 = zext i16 %22 to i64
%24 = shl nuw nsw i64 %23, 11
%25 = or i64 %21, %24
%26 = load i16, i16* %4
%27 = zext i16 %26 to i64
%28 = shl nuw nsw i64 %27, 6
%29 = or i64 %25, %28
%30 = load i16, i16* %5
%31 = zext i16 %30 to i64
%32 = or i64 %29, %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i64 %32, i64 %32)
%34 = lshr i64 %29, 20
%35 = trunc i64 %34 to i16
store i16 %35, i16* %1
%36 = lshr i64 %29, 16
%37 = trunc i64 %36 to i16
%38 = and i16 %37, 15
store i16 %38, i16* %2
%39 = trunc i64 %32 to i16
%40 = lshr i16 %39, 11
store i16 %40, i16* %3
%41 = lshr i16 %39, 6
%42 = and i16 %41, 31
store i16 %42, i16* %4
%43 = and i16 %30, 63
store i16 %43, i16* %5
%44 = zext i16 %40 to i32
%45 = zext i16 %38 to i32
%46 = trunc i64 %34 to i32
%47 = and i32 %46, 65535
%48 = zext i16 %42 to i32
%49 = zext i16 %43 to i32
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.5, i64 0, i64 0), i32 %44, i32 %45, i32 %47, i32 %48, i32 %49)
ret i32 0
}