#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 */
struct s_dh_state {
  int dummy;
};

/* Variables and functions */
int dhLoadParams(struct s_dh_state *, unsigned char *, int const);
int strlen(char *);
int dhLoadDefaultParams(struct s_dh_state *dhstate) {
  char *defaultdh =
      "-----BEGIN DH "
      "PARAMETERS-----\nMIIBCAKCAQEA06t5J/"
      "XwK39BbRJ5TyktEk+9VL3jHXlUgbnm6BEcdPAB+"
      "6h48gNN\nZEAt0eFLK8hUWeO3BBqy6cLNfDWFRvoigVfZejnRaVXONWcviJJ1EGnYHI5m0Pw"
      "/\nqax1J/ceWEld2Fod74segxbLku1QS3h8x77RBjFcy4Fcq3pysjRPVaOrbEhQ/"
      "NHX\nUo4jyN72bFgn1QYKVXoS513rtXalzw+"
      "gQFjB8zeL96b78mX2uG4VxDHQg519dXac\nsDMrJWqETGtTz3kprpETE9Vgh3dMHViMdwWe0"
      "+g8oX2EdNmMRrqm0VsWQBhMld6b\nCXzWzPkElg5L22pMUCPfYxo10HKoUHmSYwIBAg==\n-"
      "----END DH PARAMETERS-----\n";
  unsigned char *dhpem = (unsigned char *)defaultdh;
  const int dhpem_size = strlen(defaultdh);
  return dhLoadParams(dhstate, dhpem, dhpem_size);
}


x86 assembly (clang, -O0):
<dhLoadDefaultParams>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <dhLoadParams@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dhLoadDefaultParams>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%r14
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <dhLoadParams@plt>

LLVM IR (-O0):
%struct.s_dh_state = type { i32 }
@.str = [425 x i8] c"-----BEGIN DH PARAMETERS-----\0AMIIBCAKCAQEA06t5J/XwK39BbRJ5TyktEk+9VL3jHXlUgbnm6BEcdPAB+6h48gNN\0AZEAt0eFLK8hUWeO3BBqy6cLNfDWFRvoigVfZejnRaVXONWcviJJ1EGnYHI5m0Pw/\0Aqax1J/ceWEld2Fod74segxbLku1QS3h8x77RBjFcy4Fcq3pysjRPVaOrbEhQ/NHX\0AUo4jyN72bFgn1QYKVXoS513rtXalzw+gQFjB8zeL96b78mX2uG4VxDHQg519dXac\0AsDMrJWqETGtTz3kprpETE9Vgh3dMHViMdwWe0+g8oX2EdNmMRrqm0VsWQBhMld6b\0ACXzWzPkElg5L22pMUCPfYxo10HKoUHmSYwIBAg==\0A-----END DH PARAMETERS-----\0A\00"
define i32 @dhLoadDefaultParams(%struct.s_dh_state* %0) {
%2 = alloca %struct.s_dh_state*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store %struct.s_dh_state* %0, %struct.s_dh_state** %2
store i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0), i8** %3
%6 = load i8*, i8** %3
store i8* %6, i8** %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %5
%9 = load %struct.s_dh_state*, %struct.s_dh_state** %2
%10 = load i8*, i8** %4
%11 = load i32, i32* %5
%12 = call i32 @dhLoadParams(%struct.s_dh_state* %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.s_dh_state = type { i32 }
@.str = [425 x i8] c"-----BEGIN DH PARAMETERS-----\0AMIIBCAKCAQEA06t5J/XwK39BbRJ5TyktEk+9VL3jHXlUgbnm6BEcdPAB+6h48gNN\0AZEAt0eFLK8hUWeO3BBqy6cLNfDWFRvoigVfZejnRaVXONWcviJJ1EGnYHI5m0Pw/\0Aqax1J/ceWEld2Fod74segxbLku1QS3h8x77RBjFcy4Fcq3pysjRPVaOrbEhQ/NHX\0AUo4jyN72bFgn1QYKVXoS513rtXalzw+gQFjB8zeL96b78mX2uG4VxDHQg519dXac\0AsDMrJWqETGtTz3kprpETE9Vgh3dMHViMdwWe0+g8oX2EdNmMRrqm0VsWQBhMld6b\0ACXzWzPkElg5L22pMUCPfYxo10HKoUHmSYwIBAg==\0A-----END DH PARAMETERS-----\0A\00"
define i32 @dhLoadDefaultParams(%struct.s_dh_state* %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @dhLoadParams(%struct.s_dh_state* %0, i8* getelementptr inbounds ([425 x i8], [425 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %3
}