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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ bl_do_dc_option(struct tgl_state *, int, int, char *, int,
                                   char *, int);
int fetch_int();
char *fetch_str(int);
int prefetch_strlen();
void fetch_dc_option(struct tgl_state *TLS) {
  assert(fetch_int() == 0x2ec2a43c);
  int id = fetch_int();
  int l1 = prefetch_strlen();
  char *name = fetch_str(l1);
  int l2 = prefetch_strlen();
  char *ip = fetch_str(l2);
  int port = fetch_int();
  bl_do_dc_option(TLS, id, l1, name, l2, ip, port);
}


x86 assembly (clang, -O0):
<fetch_dc_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1050 <fetch_int@plt>
cmp    $0x2ec2a43c,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x0,%al
call   1050 <fetch_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
call   1040 <fetch_str@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <prefetch_strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <fetch_str@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <fetch_int@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    -0x2c(%rbp),%eax
mov    %eax,(%rsp)
call   1070 <bl_do_dc_option@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fetch_dc_option>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %eax,%eax
call   1050 <fetch_int@plt>
xor    %edi,%edi
cmp    $0x2ec2a43c,%eax
sete   %dil
call   1060 <assert@plt>
xor    %eax,%eax
call   1050 <fetch_int@plt>
mov    %eax,%r15d
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1040 <fetch_str@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1030 <prefetch_strlen@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1040 <fetch_str@plt>
mov    %rax,%r13
xor    %eax,%eax
call   1050 <fetch_int@plt>
mov    %eax,(%rsp)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %r12,%rcx
mov    %ebp,%r8d
mov    %r13,%r9
call   1070 <bl_do_dc_option@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tgl_state = type { i32 }
define void @fetch_dc_option(%struct.tgl_state* %0) {
%2 = alloca %struct.tgl_state*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store %struct.tgl_state* %0, %struct.tgl_state** %2
%9 = call i32 (...) @fetch_int()
%10 = icmp eq i32 %9, 784507964
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 (...) @fetch_int()
store i32 %13, i32* %3
%14 = call i32 (...) @prefetch_strlen()
store i32 %14, i32* %4
%15 = load i32, i32* %4
%16 = call i8* @fetch_str(i32 %15)
store i8* %16, i8** %5
%17 = call i32 (...) @prefetch_strlen()
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i8* @fetch_str(i32 %18)
store i8* %19, i8** %7
%20 = call i32 (...) @fetch_int()
store i32 %20, i32* %8
%21 = load %struct.tgl_state*, %struct.tgl_state** %2
%22 = load i32, i32* %3
%23 = load i32, i32* %4
%24 = load i8*, i8** %5
%25 = load i32, i32* %6
%26 = load i8*, i8** %7
%27 = load i32, i32* %8
%28 = call i32 @bl_do_dc_option(%struct.tgl_state* %21, i32 %22, i32 %23, i8* %24, i32 %25, i8* %26, i32 %27)
ret void
}

LLVM IR (-O2):
%struct.tgl_state = type { i32 }
define void @fetch_dc_option(%struct.tgl_state* %0) {
%2 = tail call i32 (...) @fetch_int()
%3 = icmp eq i32 %2, 784507964
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 (...) @fetch_int()
%7 = tail call i32 (...) @prefetch_strlen()
%8 = tail call i8* @fetch_str(i32 %7)
%9 = tail call i32 (...) @prefetch_strlen()
%10 = tail call i8* @fetch_str(i32 %9)
%11 = tail call i32 (...) @fetch_int()
%12 = tail call i32 @bl_do_dc_option(%struct.tgl_state* %0, i32 %6, i32 %7, i8* %8, i32 %9, i8* %10, i32 %11)
ret void
}