#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*/ assert(int);
char *aws_sigv4_create_signature(char *, char *, char *, char *, char *);
int /*<<< orphan*/ free(char *);
scalar_t__ strcmp(char *, char *);
void test_aws_sigv4_create_signature() {
  char *sig;
  sig = aws_sigv4_create_signature(
      "wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY", "20110909", "us-east-1",
      "iam",
      "AWS4-HMAC-SHA256\n20110909T233600Z\n20110909/us-east-1/iam/"
      "aws4_"
      "request\n3511de7e95d28ecd39e9513b642aee07e54f4941150d8df8bf94b328ef7e55e"
      "2");
  assert(
      strcmp(
          sig,
          "ced6826de92d2bdeed8f846f0bf508e8559e98e4b0199114b84c54174deb456c") ==
      0);
  free(sig);
}


x86 assembly (clang, -O0):
<test_aws_sigv4_create_signature>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xed3(%rip),%rsi
lea    0xed5(%rip),%rdx
lea    0xed8(%rip),%rcx
lea    0xed5(%rip),%r8
call   1040 <aws_sigv4_create_signature@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xf48(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_aws_sigv4_create_signature>:
push   %rbx
lea    0xeb8(%rip),%rdi
lea    0xeda(%rip),%rsi
lea    0xedc(%rip),%rdx
lea    0xedf(%rip),%rcx
lea    0xedc(%rip),%r8
call   1040 <aws_sigv4_create_signature@plt>
mov    %rax,%rbx
lea    0xf54(%rip),%rsi
mov    %rax,%rdi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY\00"
@.str.1 = [9 x i8] c"20110909\00"
@.str.2 = [10 x i8] c"us-east-1\00"
@.str.3 = [4 x i8] c"iam\00"
@.str.4 = [135 x i8] c"AWS4-HMAC-SHA256\0A20110909T233600Z\0A20110909/us-east-1/iam/aws4_request\0A3511de7e95d28ecd39e9513b642aee07e54f4941150d8df8bf94b328ef7e55e2\00"
@.str.5 = [65 x i8] c"ced6826de92d2bdeed8f846f0bf508e8559e98e4b0199114b84c54174deb456c\00"
define void @test_aws_sigv4_create_signature() {
%1 = alloca i8*
%2 = call i8* @aws_sigv4_create_signature(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.4, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i8*, i8** %1
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY\00"
@.str.1 = [9 x i8] c"20110909\00"
@.str.2 = [10 x i8] c"us-east-1\00"
@.str.3 = [4 x i8] c"iam\00"
@.str.4 = [135 x i8] c"AWS4-HMAC-SHA256\0A20110909T233600Z\0A20110909/us-east-1/iam/aws4_request\0A3511de7e95d28ecd39e9513b642aee07e54f4941150d8df8bf94b328ef7e55e2\00"
@.str.5 = [65 x i8] c"ced6826de92d2bdeed8f846f0bf508e8559e98e4b0199114b84c54174deb456c\00"
define void @test_aws_sigv4_create_signature() {
%1 = tail call i8* @aws_sigv4_create_signature(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.4, i64 0, i64 0))
%2 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @free(i8* %1)
ret void
}