#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*/ add_exported_option(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ exit(int);
char *strchr(char *, char);
int /*<<< orphan*/ uwsgi_concat2(char *, char *);
int /*<<< orphan*/ uwsgi_log(char *);
void uwsgi_opt_set_placeholder(char *opt, char *value, void *none) {
  char *p = strchr(value, '=');
  if (!p) {
    uwsgi_log("invalid placeholder/--set value\n");
    exit(1);
  }
  p[0] = 0;
  add_exported_option(uwsgi_concat2(value, (char *)""), p + 1, 1);
  p[0] = '=';
}


x86 assembly (clang, -O0):
<uwsgi_opt_set_placeholder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1197 <uwsgi_opt_set_placeholder+0x47>
lea    0xe78(%rip),%rdi
call   1050 <uwsgi_log@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xe77(%rip),%rsi
call   1060 <uwsgi_concat2@plt>
mov    %eax,%edi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    $0x1,%edx
call   1040 <add_exported_option@plt>
mov    -0x20(%rbp),%rax
movb   $0x3d,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uwsgi_opt_set_placeholder>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rsi,%rdi
mov    $0x3d,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     119c <uwsgi_opt_set_placeholder+0x4c>
mov    %rax,%rbx
movb   $0x0,(%rax)
lea    0xeaa(%rip),%rsi
mov    %r14,%rdi
call   1060 <uwsgi_concat2@plt>
mov    %rbx,%rsi
add    $0x1,%rsi
mov    %eax,%edi
mov    $0x1,%edx
call   1040 <add_exported_option@plt>
movb   $0x3d,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
lea    0xe5d(%rip),%rdi
call   1050 <uwsgi_log@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"invalid placeholder/--set value\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @uwsgi_opt_set_placeholder(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** %5
%9 = call i8* @strchr(i8* %8, i8 signext 61)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %15, label %12
12: ; preds = %3
%13 = call i32 @uwsgi_log(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %3
%16 = load i8*, i8** %7
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 0, i8* %17
%18 = load i8*, i8** %5
%19 = call i32 @uwsgi_concat2(i8* %18, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%20 = load i8*, i8** %7
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = call i32 @add_exported_option(i32 %19, i8* %21, i32 1)
%23 = load i8*, i8** %7
%24 = getelementptr inbounds i8, i8* %23, i64 0
store i8 61, i8* %24
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"invalid placeholder/--set value\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @uwsgi_opt_set_placeholder(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %1, i8 signext 61)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @uwsgi_log(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
store i8 0, i8* %4
%10 = tail call i32 @uwsgi_concat2(i8* %1, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = tail call i32 @add_exported_option(i32 %10, i8* %11, i32 1)
store i8 61, i8* %4
ret void
}