#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 *doasprintf(char *, char const *, char const *, char const *);
int /*<<< orphan*/ warn(char *);
char *json_fmt_protected_rsa(const char *exp, const char *mod,
                             const char *nce) {
  char *p;
  p = doasprintf("{"
                 "\"alg\": \"RS256\", "
                 "\"jwk\": "
                 "{\"e\": \"%s\", \"kty\": \"RSA\", \"n\": \"%s\"}, "
                 "\"nonce\": \"%s\""
                 "}",
                 exp, mod, nce);
  if (NULL == p)
    warn("asprintf");
  return (p);
}


x86 assembly (clang, -O0):
<json_fmt_protected_rsa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb9(%rip),%rdi
call   1040 <doasprintf@plt>
mov    %rax,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x20(%rbp),%rax
jne    1168 <json_fmt_protected_rsa+0x48>
lea    0xeea(%rip),%rdi
call   1030 <warn@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_fmt_protected_rsa>:
push   %rbx
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xecf(%rip),%rdi
call   1040 <doasprintf@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <json_fmt_protected_rsa+0x2a>
lea    0xf08(%rip),%rdi
call   1030 <warn@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [77 x i8] c"{\22alg\22: \22RS256\22, \22jwk\22: {\22e\22: \22%s\22, \22kty\22: \22RSA\22, \22n\22: \22%s\22}, \22nonce\22: \22%s\22}\00"
@.str.1 = [9 x i8] c"asprintf\00"
define i8* @json_fmt_protected_rsa(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i8* @doasprintf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9, i8* %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = icmp eq i8* null, %12
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %3
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
@.str = [77 x i8] c"{\22alg\22: \22RS256\22, \22jwk\22: {\22e\22: \22%s\22, \22kty\22: \22RSA\22, \22n\22: \22%s\22}, \22nonce\22: \22%s\22}\00"
@.str.1 = [9 x i8] c"asprintf\00"
define i8* @json_fmt_protected_rsa(i8* %0, i8* %1, i8* %2) {
%4 = tail call i8* @doasprintf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @warn(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret i8* %4
}