#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*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ plugin_config_set_desc_internal(char *, char const *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int /*<<< orphan*/ string_tolower(char *);
int strlen(char const *);
void plugin_config_set_desc(const char *plugin_name, const char *option_name,
                            const char *description) {
  int length;
  char *option_full_name;
  length = strlen(plugin_name) + 1 + strlen(option_name) + 1;
  option_full_name = malloc(length);
  if (option_full_name) {
    snprintf(option_full_name, length, "%s.%s", plugin_name, option_name);
    string_tolower(option_full_name);
    plugin_config_set_desc_internal(option_full_name, description);
    free(option_full_name);
  }
}


x86 assembly (clang, -O0):
<plugin_config_set_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     11ea <plugin_config_set_desc+0x8a>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe3a(%rip),%rdx
call   1050 <snprintf@plt>
mov    -0x28(%rbp),%rdi
call   1060 <string_tolower@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1080 <plugin_config_set_desc_internal@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_config_set_desc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%ebp
add    $0x2,%ebp
mov    %ebp,%edi
call   1070 <malloc@plt>
test   %rax,%rax
je     11cf <plugin_config_set_desc+0x6f>
mov    %rax,%rbx
lea    0xe64(%rip),%rdx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r12,%rcx
mov    %r15,%r8
call   1050 <snprintf@plt>
mov    %rbx,%rdi
call   1060 <string_tolower@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1080 <plugin_config_set_desc_internal@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s.%s\00"
define void @plugin_config_set_desc(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 1
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i8* @malloc(i32 %16)
store i8* %17, i8** %8
%18 = load i8*, i8** %8
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %33
20: ; preds = %3
%21 = load i8*, i8** %8
%22 = load i32, i32* %7
%23 = load i8*, i8** %4
%24 = load i8*, i8** %5
%25 = call i32 @snprintf(i8* %21, i32 %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %23, i8* %24)
%26 = load i8*, i8** %8
%27 = call i32 @string_tolower(i8* %26)
%28 = load i8*, i8** %8
%29 = load i8*, i8** %6
%30 = call i32 @plugin_config_set_desc_internal(i8* %28, i8* %29)
%31 = load i8*, i8** %8
%32 = call i32 @free(i8* %31)
br label %33
33: ; preds = %20, %3
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s.%s\00"
define void @plugin_config_set_desc(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = add i32 %4, 2
%7 = add i32 %6, %5
%8 = tail call i8* @malloc(i32 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = tail call i32 @snprintf(i8* %8, i32 %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%12 = tail call i32 @string_tolower(i8* %8)
%13 = tail call i32 @plugin_config_set_desc_internal(i8* %8, i8* %2)
%14 = tail call i32 @free(i8* %8)
br label %15
15: ; preds = %10, %3
ret void
}