#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 */
char rchar(char *);
char *rstr(char *guess, char *map) {
  int i;
  for (i = 0; i < 16; i++)
    guess[i] = rchar(map);
  return guess;
}


x86 assembly (clang, -O0):
<rstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    1155 <rstr+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <rchar@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <rstr+0x17>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rstr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <rchar@plt>
mov    %al,(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x1(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x2(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x3(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x4(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x5(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x6(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x7(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x8(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0x9(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0xa(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0xb(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0xc(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0xd(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0xe(%rbx)
mov    %r14,%rdi
call   1030 <rchar@plt>
mov    %al,0xf(%rbx)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @rstr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %6
6: ; preds = %16, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 16
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = load i8*, i8** %4
%11 = call signext i8 @rchar(i8* %10)
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
store i8 %11, i8* %15
br label %16
16: ; preds = %9
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %6
19: ; preds = %6
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @rstr(i8* returned writeonly %0, i8* %1) {
%3 = tail call signext i8 @rchar(i8* %1)
store i8 %3, i8* %0
%4 = tail call signext i8 @rchar(i8* %1)
%5 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %4, i8* %5
%6 = tail call signext i8 @rchar(i8* %1)
%7 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %6, i8* %7
%8 = tail call signext i8 @rchar(i8* %1)
%9 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %8, i8* %9
%10 = tail call signext i8 @rchar(i8* %1)
%11 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %10, i8* %11
%12 = tail call signext i8 @rchar(i8* %1)
%13 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %12, i8* %13
%14 = tail call signext i8 @rchar(i8* %1)
%15 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %14, i8* %15
%16 = tail call signext i8 @rchar(i8* %1)
%17 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %16, i8* %17
%18 = tail call signext i8 @rchar(i8* %1)
%19 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %18, i8* %19
%20 = tail call signext i8 @rchar(i8* %1)
%21 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %20, i8* %21
%22 = tail call signext i8 @rchar(i8* %1)
%23 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %22, i8* %23
%24 = tail call signext i8 @rchar(i8* %1)
%25 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %24, i8* %25
%26 = tail call signext i8 @rchar(i8* %1)
%27 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %26, i8* %27
%28 = tail call signext i8 @rchar(i8* %1)
%29 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %28, i8* %29
%30 = tail call signext i8 @rchar(i8* %1)
%31 = getelementptr inbounds i8, i8* %0, i64 14
store i8 %30, i8* %31
%32 = tail call signext i8 @rchar(i8* %1)
%33 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %32, i8* %33
ret i8* %0
}