void rangeAndSuitOfCard(const int indexOfCard, char *rank, char *suit) {
  char suitSymb[4] = {'c', 'd', 'h', 's'};
  switch ((indexOfCard - 1) % 13 + 1) {
  case 13:
    *rank = 'a';
    break;
  case 12:
    *rank = 'k';
    break;
  case 11:
    *rank = 'q';
    break;
  case 10:
    *rank = 'j';
    break;
  case 9:
    *rank = 't';
    break;
  default:
    *rank = '0' + indexOfCard % 13 + 1;
    break;
  }
  *suit = suitSymb[(indexOfCard - 1) / 13];
}


x86 assembly (clang, -O0):
<rangeAndSuitOfCard>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x73686463,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
movslq %eax,%rcx
imul   $0x4ec4ec4f,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rdx
add    %ecx,%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%esi
mov    %esi,%edx
lea    (%rcx,%rdx,4),%ecx
sub    %ecx,%eax
add    $0xfffffff8,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x4,%eax
ja     11a1 <rangeAndSuitOfCard+0xa1>
mov    -0x28(%rbp),%rax
lea    0xea4(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
movb   $0x61,(%rax)
jmp    11bc <rangeAndSuitOfCard+0xbc>
mov    -0x10(%rbp),%rax
movb   $0x6b,(%rax)
jmp    11bc <rangeAndSuitOfCard+0xbc>
mov    -0x10(%rbp),%rax
movb   $0x71,(%rax)
jmp    11bc <rangeAndSuitOfCard+0xbc>
mov    -0x10(%rbp),%rax
movb   $0x6a,(%rax)
jmp    11bc <rangeAndSuitOfCard+0xbc>
mov    -0x10(%rbp),%rax
movb   $0x74,(%rax)
jmp    11bc <rangeAndSuitOfCard+0xbc>
mov    -0x4(%rbp),%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x30,%eax
add    $0x1,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
cltq
mov    -0x1c(%rbp,%rax,1),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rangeAndSuitOfCard>:
lea    -0x1(%rdi),%eax
movslq %eax,%rcx
imul   $0x4ec4ec4f,%rcx,%r8
mov    %r8,%rax
shr    $0x3f,%rax
sar    $0x22,%r8
add    %eax,%r8d
lea    (%r8,%r8,2),%eax
lea    (%r8,%rax,4),%eax
sub    %eax,%ecx
add    $0xfffffff8,%ecx
cmp    $0x5,%ecx
jae    113f <rangeAndSuitOfCard+0x3f>
shl    $0x3,%ecx
movabs $0x616b716a74,%rdi
shr    %cl,%rdi
jmp    1162 <rangeAndSuitOfCard+0x62>
movslq %edi,%rax
imul   $0x4ec4ec4f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
sub    %eax,%edi
add    $0x31,%dil
mov    %dil,(%rsi)
movslq %r8d,%rax
lea    0xe91(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rdx)
ret

LLVM IR (-O0):
@__const.rangeAndSuitOfCard.suitSymb = [4 x i8] c"cdhs"
define void @rangeAndSuitOfCard(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [4 x i8]
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [4 x i8]* %7 to i8*
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 1
%11 = srem i32 %10, 13
%12 = add nsw i32 %11, 1
switch i32 %12, label %23 [
i32 13, label %13
i32 12, label %15
i32 11, label %17
i32 10, label %19
i32 9, label %21
]
13: ; preds = %3
%14 = load i8*, i8** %5
store i8 97, i8* %14
br label %30
15: ; preds = %3
%16 = load i8*, i8** %5
store i8 107, i8* %16
br label %30
17: ; preds = %3
%18 = load i8*, i8** %5
store i8 113, i8* %18
br label %30
19: ; preds = %3
%20 = load i8*, i8** %5
store i8 106, i8* %20
br label %30
21: ; preds = %3
%22 = load i8*, i8** %5
store i8 116, i8* %22
br label %30
23: ; preds = %3
%24 = load i32, i32* %4
%25 = srem i32 %24, 13
%26 = add nsw i32 48, %25
%27 = add nsw i32 %26, 1
%28 = trunc i32 %27 to i8
%29 = load i8*, i8** %5
store i8 %28, i8* %29
br label %30
30: ; preds = %23, %21, %19, %17, %15, %13
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 1
%33 = sdiv i32 %32, 13
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = load i8*, i8** %6
store i8 %36, i8* %37
ret void
}

LLVM IR (-O2):
@__const.rangeAndSuitOfCard.suitSymb = [4 x i8] c"cdhs"
define void @rangeAndSuitOfCard(i32 %0, i8* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = add nsw i32 %0, -1
%5 = srem i32 %4, 13
%6 = sdiv i32 %4, 13
%7 = add nsw i32 %5, -8
%8 = icmp ult i32 %7, 5
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = srem i32 %0, 13
%11 = trunc i32 %10 to i8
%12 = add nsw i8 %11, 49
br label %18
13: ; preds = %3
%14 = zext i32 %7 to i40
%15 = shl nuw nsw i40 %14, 3
%16 = lshr i40 418414422644, %15
%17 = trunc i40 %16 to i8
br label %18
18: ; preds = %13, %9
%19 = phi i8 [ %12, %9 ], [ %17, %13 ]
store i8 %19, i8* %1
%20 = sext i32 %6 to i64
%21 = getelementptr inbounds [4 x i8], [4 x i8]* @__const.rangeAndSuitOfCard.suitSymb, i64 0, i64 %20
%22 = load i8, i8* %21
store i8 %22, i8* %2
ret void
}