#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 */
typedef int /*<<< orphan*/ ha2;

/* Variables and functions */
int /*<<< orphan*/ ns_md5(char *, char const *, size_t, char const *,
                          size_t const, char const *, size_t, char const *,
                          ...);
void mkmd5resp(const char *method, size_t method_len, const char *uri,
               size_t uri_len, const char *ha1, size_t ha1_len,
               const char *nonce, size_t nonce_len, const char *nc,
               size_t nc_len, const char *cnonce, size_t cnonce_len,
               const char *qop, size_t qop_len, char *resp) {
  static const char colon[] = ":";
  static const size_t one = 1;
  char ha2[33];
  ns_md5(ha2, method, method_len, colon, one, uri, uri_len, NULL);
  ns_md5(resp, ha1, ha1_len, colon, one, nonce, nonce_len, colon, one, nc,
         nc_len, colon, one, cnonce, cnonce_len, colon, one, qop, qop_len,
         colon, one, ha2, sizeof(ha2) - 1, NULL);
}


x86 assembly (clang, -O0):
<mkmd5resp>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xf8,%rsp
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x30(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %rdx,-0x40(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9,-0x58(%rbp)
lea    -0x80(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x40(%rbp),%r9
mov    -0x48(%rbp),%rax
lea    0xe85(%rip),%rcx
mov    $0x1,%r8d
xor    %r10d,%r10d
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <ns_md5@plt>
mov    0x50(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    0x20(%rbp),%r13
mov    0x28(%rbp),%r12
mov    0x30(%rbp),%r15
mov    0x38(%rbp),%r14
mov    0x40(%rbp),%rbx
mov    0x48(%rbp),%r11
lea    -0x80(%rbp),%rcx
mov    %rcx,-0x88(%rbp)
lea    0xe2a(%rip),%r10
mov    $0x1,%r8d
xor    %ecx,%ecx
mov    %r10,%rcx
mov    %rax,(%rsp)
mov    -0x88(%rbp),%rax
mov    %r10,0x8(%rsp)
movq   $0x1,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    %r12,0x20(%rsp)
mov    %r10,0x28(%rsp)
movq   $0x1,0x30(%rsp)
mov    %r15,0x38(%rsp)
mov    %r14,0x40(%rsp)
mov    %r10,0x48(%rsp)
movq   $0x1,0x50(%rsp)
mov    %rbx,0x58(%rsp)
mov    %r11,0x60(%rsp)
mov    %r10,0x68(%rsp)
movq   $0x1,0x70(%rsp)
mov    %rax,0x78(%rsp)
movq   $0x20,0x80(%rsp)
movq   $0x0,0x88(%rsp)
mov    $0x0,%al
call   1030 <ns_md5@plt>
add    $0xf8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkmd5resp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xb8,%rsp
mov    %r9,%r14
mov    %r8,%r13
mov    %rdx,%r9
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x130(%rsp),%r12
mov    0xf8(%rsp),%r15
mov    %rcx,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xeac(%rip),%rbx
lea    0x90(%rsp),%rbp
mov    $0x1,%r8d
mov    %rbp,%rdi
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <ns_md5@plt>
mov    %rbp,0x78(%rsp)
mov    %rbx,0x68(%rsp)
movaps 0x120(%rsp),%xmm0
movups %xmm0,0x58(%rsp)
mov    %rbx,0x48(%rsp)
movaps 0x110(%rsp),%xmm0
movups %xmm0,0x38(%rsp)
mov    %rbx,0x28(%rsp)
movaps 0x100(%rsp),%xmm0
movups %xmm0,0x18(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r15,(%rsp)
movq   $0x0,0x88(%rsp)
movq   $0x20,0x80(%rsp)
movq   $0x1,0x70(%rsp)
movq   $0x1,0x50(%rsp)
movq   $0x1,0x30(%rsp)
movq   $0x1,0x10(%rsp)
mov    $0x1,%r8d
mov    %r12,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    0xf0(%rsp),%r9
xor    %eax,%eax
call   1030 <ns_md5@plt>
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@mkmd5resp.colon = internal constant [2 x i8] c":\00"
@mkmd5resp.one = internal constant i64 1
define void @mkmd5resp(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i8* %6, i64 %7, i8* %8, i64 %9, i8* %10, i64 %11, i8* %12, i64 %13, i8* %14) {
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i8*
%19 = alloca i64
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i8*
%23 = alloca i64
%24 = alloca i8*
%25 = alloca i64
%26 = alloca i8*
%27 = alloca i64
%28 = alloca i8*
%29 = alloca i64
%30 = alloca i8*
%31 = alloca [33 x i8]
store i8* %0, i8** %16
store i64 %1, i64* %17
store i8* %2, i8** %18
store i64 %3, i64* %19
store i8* %4, i8** %20
store i64 %5, i64* %21
store i8* %6, i8** %22
store i64 %7, i64* %23
store i8* %8, i8** %24
store i64 %9, i64* %25
store i8* %10, i8** %26
store i64 %11, i64* %27
store i8* %12, i8** %28
store i64 %13, i64* %29
store i8* %14, i8** %30
%32 = getelementptr inbounds [33 x i8], [33 x i8]* %31, i64 0, i64 0
%33 = load i8*, i8** %16
%34 = load i64, i64* %17
%35 = load i8*, i8** %18
%36 = load i64, i64* %19
%37 = call i32 (i8*, i8*, i64, i8*, i64, i8*, i64, i8*, ...) @ns_md5(i8* %32, i8* %33, i64 %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %35, i64 %36, i8* null)
%38 = load i8*, i8** %30
%39 = load i8*, i8** %20
%40 = load i64, i64* %21
%41 = load i8*, i8** %22
%42 = load i64, i64* %23
%43 = load i8*, i8** %24
%44 = load i64, i64* %25
%45 = load i8*, i8** %26
%46 = load i64, i64* %27
%47 = load i8*, i8** %28
%48 = load i64, i64* %29
%49 = getelementptr inbounds [33 x i8], [33 x i8]* %31, i64 0, i64 0
%50 = call i32 (i8*, i8*, i64, i8*, i64, i8*, i64, i8*, ...) @ns_md5(i8* %38, i8* %39, i64 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %41, i64 %42, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %43, i64 %44, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %45, i64 %46, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %47, i64 %48, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %49, i64 32, i8* null)
ret void
}

LLVM IR (-O2):
@mkmd5resp.colon = internal constant [2 x i8] c":\00"
define void @mkmd5resp(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5, i8* %6, i64 %7, i8* %8, i64 %9, i8* %10, i64 %11, i8* %12, i64 %13, i8* %14) {
%16 = alloca [33 x i8]
%17 = getelementptr inbounds [33 x i8], [33 x i8]* %16, i64 0, i64 0
%18 = call i32 (i8*, i8*, i64, i8*, i64, i8*, i64, i8*, ...) @ns_md5(i8* %17, i8* %0, i64 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %2, i64 %3, i8* null)
%19 = call i32 (i8*, i8*, i64, i8*, i64, i8*, i64, i8*, ...) @ns_md5(i8* %14, i8* %4, i64 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %6, i64 %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %8, i64 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %10, i64 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %12, i64 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @mkmd5resp.colon, i64 0, i64 0), i64 1, i8* %17, i64 32, i8* null)
ret void
}