#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 rand();
void fnGenerateRequestAuthenticator(unsigned char *auth) {
  int x, randnumb;
  for (x = 0; x < 16; x++) {
    randnumb = rand() % 128 + 127;
    auth[x] = randnumb;
  }
  return;
}


x86 assembly (clang, -O0):
<fnGenerateRequestAuthenticator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    1160 <fnGenerateRequestAuthenticator+0x50>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x80,%ecx
cltd
idiv   %ecx
add    $0x7f,%edx
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <fnGenerateRequestAuthenticator+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnGenerateRequestAuthenticator>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x1(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x2(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x3(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x4(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x5(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x6(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x7(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x8(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0x9(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0xa(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0xb(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0xc(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0xd(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0xe(%rbx)
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x7f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0x80,%ecx
sub    %ecx,%eax
add    $0x7f,%al
mov    %al,0xf(%rbx)
pop    %rbx
ret

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

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