#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 *, char *);
char *strings_rand(char *, int);
void example_rand() {
  char s[20];
  printf("random string with length 20: %s\n", strings_rand(s, 20));
  printf("random string with length 20: %s\n", strings_rand(s, 20));
  printf("random string with length 20: %s\n", strings_rand(s, 20));
}


x86 assembly (clang, -O0):
<example_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
call   1040 <strings_rand@plt>
mov    %rax,%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
call   1040 <strings_rand@plt>
mov    %rax,%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
mov    $0x14,%esi
call   1040 <strings_rand@plt>
mov    %rax,%rsi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<example_rand>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x14,%esi
call   1040 <strings_rand@plt>
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x14,%esi
call   1040 <strings_rand@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    $0x14,%esi
call   1040 <strings_rand@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [34 x i8] c"random string with length 20: %s\0A\00"
define void @example_rand() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @strings_rand(i8* %2, i32 20)
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%6 = call i8* @strings_rand(i8* %5, i32 20)
%7 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%9 = call i8* @strings_rand(i8* %8, i32 20)
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"random string with length 20: %s\0A\00"
define void @example_rand() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i8* @strings_rand(i8* %2, i32 20)
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i8* @strings_rand(i8* %2, i32 20)
%6 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i8* @strings_rand(i8* %2, i32 20)
%8 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}