int get_string(src, des, off) const char *src;
char *des;
int off;
{
  int i;
  for (i = 0; i < (int)(20 - sizeof(int) - 1); i++)
    des[i] = src[(off + i) % (20 - sizeof(int) - 1)];
  des[20 - sizeof(int) - 1] = '\0';
  return (0);
}


x86 assembly (clang, -O0):
<get_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0xf,-0x18(%rbp)
jge    115a <get_string+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
cltq
mov    $0xf,%ecx
xor    %edx,%edx
div    %rcx
mov    -0x20(%rbp),%rax
mov    (%rax,%rdx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1116 <get_string+0x16>
mov    -0x10(%rbp),%rax
movb   $0x0,0xf(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_string>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movslq %edx,%rcx
movabs $0x8888888888888889,%rbx
88 88 88
mov    %rcx,%rax
mul    %rbx
mov    %rdx,%r8
lea    0x1(%rcx),%rax
mul    %rbx
mov    %rdx,%r15
lea    0x2(%rcx),%rax
mul    %rbx
mov    %rdx,%r12
lea    0x3(%rcx),%rax
mul    %rbx
mov    %rdx,%r13
lea    0x4(%rcx),%rax
mul    %rbx
mov    %rdx,%rbp
lea    0x5(%rcx),%rax
mul    %rbx
mov    %rdx,-0x50(%rsp)
lea    0x6(%rcx),%rax
mul    %rbx
mov    %rdx,-0x8(%rsp)
lea    0x7(%rcx),%rax
mul    %rbx
mov    %rdx,-0x10(%rsp)
lea    0x8(%rcx),%rax
mul    %rbx
mov    %rdx,-0x18(%rsp)
lea    0x9(%rcx),%rax
mul    %rbx
mov    %rdx,-0x20(%rsp)
lea    0xa(%rcx),%rax
mul    %rbx
mov    %rdx,%r14
lea    0xb(%rcx),%rax
mul    %rbx
mov    %rdx,%r9
lea    0xc(%rcx),%rax
mul    %rbx
mov    %rdx,%r10
lea    0xd(%rcx),%rax
mul    %rbx
mov    %rdx,%r11
lea    0xe(%rcx),%rax
mul    %rbx
shr    $0x3,%r8
lea    (%r8,%r8,4),%rax
lea    (%rax,%rax,2),%rax
mov    %rax,-0x28(%rsp)
shr    $0x3,%r15
lea    (%r15,%r15,4),%rax
lea    (%rax,%rax,2),%rax
neg    %rax
add    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x30(%rsp)
shr    $0x3,%r12
lea    (%r12,%r12,4),%rax
lea    (%rax,%rax,2),%rax
neg    %rax
add    %rcx,%rax
add    $0x2,%rax
mov    %rax,-0x38(%rsp)
shr    $0x3,%r13
lea    0x0(,%r13,4),%rax
add    %r13,%rax
lea    (%rax,%rax,2),%rax
neg    %rax
add    %rcx,%rax
add    $0x3,%rax
mov    %rax,-0x40(%rsp)
shr    $0x3,%rbp
lea    0x0(,%rbp,4),%rax
add    %rbp,%rax
lea    (%rax,%rax,2),%rax
neg    %rax
add    %rcx,%rax
add    $0x4,%rax
mov    %rax,-0x48(%rsp)
mov    -0x50(%rsp),%rax
shr    $0x3,%rax
lea    (%rax,%rax,4),%r13
lea    0x0(,%r13,2),%rbx
add    %r13,%rbx
neg    %rbx
lea    (%rcx,%rbx,1),%rax
add    $0x5,%rax
mov    %rax,-0x50(%rsp)
mov    -0x8(%rsp),%rax
shr    $0x3,%rax
lea    (%rax,%rax,4),%rax
lea    (%rax,%rax,2),%rax
neg    %rax
lea    (%rcx,%rax,1),%r13
add    $0x6,%r13
mov    -0x10(%rsp),%rax
shr    $0x3,%rax
lea    (%rax,%rax,4),%rbp
lea    0x0(%rbp,%rbp,2),%rbp
neg    %rbp
lea    (%rcx,%rbp,1),%r12
add    $0x7,%r12
mov    -0x18(%rsp),%rax
shr    $0x3,%rax
lea    (%rax,%rax,4),%rbx
lea    (%rbx,%rbx,2),%rbx
neg    %rbx
lea    (%rcx,%rbx,1),%r15
add    $0x8,%r15
mov    -0x20(%rsp),%rax
shr    $0x3,%rax
lea    (%rax,%rax,4),%rax
lea    (%rax,%rax,2),%rax
neg    %rax
lea    (%rcx,%rax,1),%r8
add    $0x9,%r8
shr    $0x3,%r14
lea    (%r14,%r14,4),%rbp
lea    0x0(%rbp,%rbp,2),%rbp
neg    %rbp
lea    (%rcx,%rbp,1),%r14
add    $0xa,%r14
shr    $0x3,%r9
lea    (%r9,%r9,4),%rbx
lea    (%rbx,%rbx,2),%rbx
neg    %rbx
add    %rcx,%rbx
add    $0xb,%rbx
shr    $0x3,%r10
lea    (%r10,%r10,4),%rax
lea    (%rax,%rax,2),%rax
neg    %rax
add    %rcx,%rax
add    $0xc,%rax
shr    $0x3,%r11
lea    (%r11,%r11,4),%rbp
lea    0x0(%rbp,%rbp,2),%rbp
neg    %rbp
add    %rcx,%rbp
add    $0xd,%rbp
shr    $0x3,%rdx
lea    (%rdx,%rdx,4),%rdx
lea    (%rdx,%rdx,2),%rdx
neg    %rdx
add    %rcx,%rdx
add    $0xe,%rdx
sub    -0x28(%rsp),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,(%rsi)
mov    -0x30(%rsp),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x1(%rsi)
mov    -0x38(%rsp),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x2(%rsi)
mov    -0x40(%rsp),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x3(%rsi)
mov    -0x48(%rsp),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x4(%rsi)
mov    -0x50(%rsp),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x5(%rsi)
mov    (%rdi,%r13,1),%cl
mov    %cl,0x6(%rsi)
mov    (%rdi,%r12,1),%cl
mov    %cl,0x7(%rsi)
mov    (%rdi,%r15,1),%cl
mov    %cl,0x8(%rsi)
mov    (%rdi,%r8,1),%cl
mov    %cl,0x9(%rsi)
mov    (%rdi,%r14,1),%cl
mov    %cl,0xa(%rsi)
mov    (%rdi,%rbx,1),%cl
mov    %cl,0xb(%rsi)
mov    (%rdi,%rax,1),%al
mov    %al,0xc(%rsi)
mov    (%rdi,%rbp,1),%al
mov    %al,0xd(%rsi)
mov    (%rdi,%rdx,1),%al
mov    %al,0xe(%rsi)
movb   $0x0,0xf(%rsi)
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_string(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 15
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = sext i32 %15 to i64
%17 = urem i64 %16, 15
%18 = getelementptr inbounds i8, i8* %12, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %11
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
%28 = load i8*, i8** %5
%29 = getelementptr inbounds i8, i8* %28, i64 15
store i8 0, i8* %29
ret i32 0
}

LLVM IR (-O2):
define i32 @get_string(i8* nocapture %0, i8* nocapture writeonly %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = urem i64 %4, 15
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
store i8 %7, i8* %1
%8 = add nsw i64 %4, 1
%9 = urem i64 %8, 15
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %11, i8* %12
%13 = add nsw i64 %4, 2
%14 = urem i64 %13, 15
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %16, i8* %17
%18 = add nsw i64 %4, 3
%19 = urem i64 %18, 15
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %21, i8* %22
%23 = add nsw i64 %4, 4
%24 = urem i64 %23, 15
%25 = getelementptr inbounds i8, i8* %0, i64 %24
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %26, i8* %27
%28 = add nsw i64 %4, 5
%29 = urem i64 %28, 15
%30 = getelementptr inbounds i8, i8* %0, i64 %29
%31 = load i8, i8* %30
%32 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %31, i8* %32
%33 = add nsw i64 %4, 6
%34 = urem i64 %33, 15
%35 = getelementptr inbounds i8, i8* %0, i64 %34
%36 = load i8, i8* %35
%37 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %36, i8* %37
%38 = add nsw i64 %4, 7
%39 = urem i64 %38, 15
%40 = getelementptr inbounds i8, i8* %0, i64 %39
%41 = load i8, i8* %40
%42 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %41, i8* %42
%43 = add nsw i64 %4, 8
%44 = urem i64 %43, 15
%45 = getelementptr inbounds i8, i8* %0, i64 %44
%46 = load i8, i8* %45
%47 = getelementptr inbounds i8, i8* %1, i64 8
store i8 %46, i8* %47
%48 = add nsw i64 %4, 9
%49 = urem i64 %48, 15
%50 = getelementptr inbounds i8, i8* %0, i64 %49
%51 = load i8, i8* %50
%52 = getelementptr inbounds i8, i8* %1, i64 9
store i8 %51, i8* %52
%53 = add nsw i64 %4, 10
%54 = urem i64 %53, 15
%55 = getelementptr inbounds i8, i8* %0, i64 %54
%56 = load i8, i8* %55
%57 = getelementptr inbounds i8, i8* %1, i64 10
store i8 %56, i8* %57
%58 = add nsw i64 %4, 11
%59 = urem i64 %58, 15
%60 = getelementptr inbounds i8, i8* %0, i64 %59
%61 = load i8, i8* %60
%62 = getelementptr inbounds i8, i8* %1, i64 11
store i8 %61, i8* %62
%63 = add nsw i64 %4, 12
%64 = urem i64 %63, 15
%65 = getelementptr inbounds i8, i8* %0, i64 %64
%66 = load i8, i8* %65
%67 = getelementptr inbounds i8, i8* %1, i64 12
store i8 %66, i8* %67
%68 = add nsw i64 %4, 13
%69 = urem i64 %68, 15
%70 = getelementptr inbounds i8, i8* %0, i64 %69
%71 = load i8, i8* %70
%72 = getelementptr inbounds i8, i8* %1, i64 13
store i8 %71, i8* %72
%73 = add nsw i64 %4, 14
%74 = urem i64 %73, 15
%75 = getelementptr inbounds i8, i8* %0, i64 %74
%76 = load i8, i8* %75
%77 = getelementptr inbounds i8, i8* %1, i64 14
store i8 %76, i8* %77
%78 = getelementptr inbounds i8, i8* %1, i64 15
store i8 0, i8* %78
ret i32 0
}