#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 */
char *extract_xml(char *, char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void GetTransportInfo(char *res) {
  char state[256];
  char status[256];
  char speed[256];
  char *p;
  fprintf(stderr, "#\tstate\tstatus\tspeed\n");
  p = extract_xml(state, res, "CurrentTransportState");
  p = extract_xml(status, p, "CurrentTransportStatus");
  p = extract_xml(speed, p, "CurrentSpeed");
  fprintf(stderr, "TInfo:\t%s\t%s\t%s\n", state, status, speed);
}


x86 assembly (clang, -O0):
<GetTransportInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x320,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
lea    0xec1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
lea    0xebe(%rip),%rdx
call   1030 <extract_xml@plt>
mov    %rax,-0x318(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x318(%rbp),%rsi
lea    0xeb3(%rip),%rdx
call   1030 <extract_xml@plt>
mov    %rax,-0x318(%rbp)
lea    -0x310(%rbp),%rdi
mov    -0x318(%rbp),%rsi
lea    0xea9(%rip),%rdx
call   1030 <extract_xml@plt>
mov    %rax,-0x318(%rbp)
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
lea    -0x110(%rbp),%rdx
lea    -0x210(%rbp),%rcx
lea    -0x310(%rbp),%r8
lea    0xe85(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x320,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetTransportInfo>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x308,%rsp
mov    %rdi,%rbx
mov    0x2ea8(%rip),%r12
mov    (%r12),%edi
lea    0xebd(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec5(%rip),%rdx
lea    0x200(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <extract_xml@plt>
lea    0xec1(%rip),%rdx
lea    0x100(%rsp),%r15
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <extract_xml@plt>
lea    0xebe(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <extract_xml@plt>
mov    (%r12),%edi
lea    0xeb2(%rip),%rsi
mov    %r14,%rdx
mov    %r15,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x308,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"#\09state\09status\09speed\0A\00"
@.str.1 = [22 x i8] c"CurrentTransportState\00"
@.str.2 = [23 x i8] c"CurrentTransportStatus\00"
@.str.3 = [13 x i8] c"CurrentSpeed\00"
@.str.4 = [17 x i8] c"TInfo:\09%s\09%s\09%s\0A\00"
define void @GetTransportInfo(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = alloca [256 x i8]
%6 = alloca i8*
store i8* %0, i8** %2
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = load i8*, i8** %2
%11 = call i8* @extract_xml(i8* %9, i8* %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i8* %11, i8** %6
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = load i8*, i8** %6
%14 = call i8* @extract_xml(i8* %12, i8* %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
store i8* %14, i8** %6
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%16 = load i8*, i8** %6
%17 = call i8* @extract_xml(i8* %15, i8* %16, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i8* %17, i8** %6
%18 = load i32, i32* @stderr
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%21 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %19, i8* %20, i8* %21)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"#\09state\09status\09speed\0A\00"
@.str.1 = [22 x i8] c"CurrentTransportState\00"
@.str.2 = [23 x i8] c"CurrentTransportStatus\00"
@.str.3 = [13 x i8] c"CurrentSpeed\00"
@.str.4 = [17 x i8] c"TInfo:\09%s\09%s\09%s\0A\00"
define void @GetTransportInfo(i8* %0) {
%2 = alloca [256 x i8]
%3 = alloca [256 x i8]
%4 = alloca [256 x i8]
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i8* @extract_xml(i8* %5, i8* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%11 = call i8* @extract_xml(i8* %6, i8* %10, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%12 = call i8* @extract_xml(i8* %7, i8* %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %5, i8* %6, i8* %7)
ret void
}