#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;
struct ts_eit {
  int dummy;
};

/* Variables and functions */
struct ts_eit *ts_eit_alloc();
struct ts_eit *ts_eit_init(struct ts_eit *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
struct ts_eit *ts_eit_alloc_init(uint16_t service_id,
                                 uint16_t transport_stream_id,
                                 uint16_t org_network_id, uint8_t table_id,
                                 uint8_t sec_number, uint8_t last_sec_number) {
  struct ts_eit *eit = ts_eit_alloc();
  if (!eit)
    return NULL;
  return ts_eit_init(eit, service_id, transport_stream_id, org_network_id,
                     table_id, sec_number, last_sec_number);
}


x86 assembly (clang, -O0):
<ts_eit_alloc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    $0x0,%al
call   1030 <ts_eit_alloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    115f <ts_eit_alloc_init+0x3f>
movq   $0x0,-0x8(%rbp)
jmp    1183 <ts_eit_alloc_init+0x63>
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
mov    -0x20(%rbp),%eax
mov    %eax,(%rsp)
call   1040 <ts_eit_init@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_eit_alloc_init>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r13d
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <ts_eit_alloc@plt>
test   %rax,%rax
je     1162 <ts_eit_alloc_init+0x42>
mov    %r13d,(%rsp)
mov    %rax,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1040 <ts_eit_init@plt>
jmp    1164 <ts_eit_alloc_init+0x44>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ts_eit = type { i32 }
define %struct.ts_eit* @ts_eit_alloc_init(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.ts_eit*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca %struct.ts_eit*
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
%15 = call %struct.ts_eit* (...) @ts_eit_alloc()
store %struct.ts_eit* %15, %struct.ts_eit** %14
%16 = load %struct.ts_eit*, %struct.ts_eit** %14
%17 = icmp ne %struct.ts_eit* %16, null
br i1 %17, label %19, label %18
18: ; preds = %6
store %struct.ts_eit* null, %struct.ts_eit** %7
br label %28
19: ; preds = %6
%20 = load %struct.ts_eit*, %struct.ts_eit** %14
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = load i32, i32* %11
%25 = load i32, i32* %12
%26 = load i32, i32* %13
%27 = call %struct.ts_eit* @ts_eit_init(%struct.ts_eit* %20, i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26)
store %struct.ts_eit* %27, %struct.ts_eit** %7
br label %28
28: ; preds = %19, %18
%29 = load %struct.ts_eit*, %struct.ts_eit** %7
ret %struct.ts_eit* %29
}

LLVM IR (-O2):
%struct.ts_eit = type { i32 }
define %struct.ts_eit* @ts_eit_alloc_init(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call %struct.ts_eit* (...) @ts_eit_alloc()
%8 = icmp eq %struct.ts_eit* %7, null
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call %struct.ts_eit* @ts_eit_init(%struct.ts_eit* %7, i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
br label %11
11: ; preds = %6, %9
%12 = phi %struct.ts_eit* [ %10, %9 ], [ null, %6 ]
ret %struct.ts_eit* %12
}