#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 serializer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *opts_split(char const **, char);
struct serializer *send_get_serializer(char *);
struct serializer *send_parse_format(const char **arg) {
  char *format = opts_split(arg, '=');
  if (!format) {
    return NULL;
  }
  struct serializer *serializer = send_get_serializer(format);
  free(format);
  if (!serializer) {
    return NULL;
  }
  return serializer;
}


x86 assembly (clang, -O0):
<send_parse_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3d,%esi
call   1050 <opts_split@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1166 <send_parse_format+0x36>
movq   $0x0,-0x8(%rbp)
jmp    119c <send_parse_format+0x6c>
mov    -0x18(%rbp),%rdi
call   1040 <send_get_serializer@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
cmpq   $0x0,-0x20(%rbp)
jne    1194 <send_parse_format+0x64>
movq   $0x0,-0x8(%rbp)
jmp    119c <send_parse_format+0x6c>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_parse_format>:
push   %r14
push   %rbx
push   %rax
mov    $0x3d,%esi
call   1050 <opts_split@plt>
test   %rax,%rax
je     115e <send_parse_format+0x2e>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <send_get_serializer@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
jmp    1160 <send_parse_format+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.serializer = type { i32 }
define %struct.serializer* @send_parse_format(i8** %0) {
%2 = alloca %struct.serializer*
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca %struct.serializer*
store i8** %0, i8*** %3
%6 = load i8**, i8*** %3
%7 = call i8* @opts_split(i8** %6, i8 signext 61)
store i8* %7, i8** %4
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %1
store %struct.serializer* null, %struct.serializer** %2
br label %21
11: ; preds = %1
%12 = load i8*, i8** %4
%13 = call %struct.serializer* @send_get_serializer(i8* %12)
store %struct.serializer* %13, %struct.serializer** %5
%14 = load i8*, i8** %4
%15 = call i32 @free(i8* %14)
%16 = load %struct.serializer*, %struct.serializer** %5
%17 = icmp ne %struct.serializer* %16, null
br i1 %17, label %19, label %18
18: ; preds = %11
store %struct.serializer* null, %struct.serializer** %2
br label %21
19: ; preds = %11
%20 = load %struct.serializer*, %struct.serializer** %5
store %struct.serializer* %20, %struct.serializer** %2
br label %21
21: ; preds = %19, %18, %10
%22 = load %struct.serializer*, %struct.serializer** %2
ret %struct.serializer* %22
}

LLVM IR (-O2):
%struct.serializer = type { i32 }
define %struct.serializer* @send_parse_format(i8** %0) {
%2 = tail call i8* @opts_split(i8** %0, i8 signext 61)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call %struct.serializer* @send_get_serializer(i8* %2)
%6 = tail call i32 @free(i8* %2)
br label %7
7: ; preds = %1, %4
%8 = phi %struct.serializer* [ %5, %4 ], [ null, %1 ]
ret %struct.serializer* %8
}