#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*/ sprintf(char *, char *, int, int, char *, char *);
char *ConsultarStatusOperacional(int sessao, char *codigo_ativacao) {
  static char resp[512];
  sprintf(resp, "%d|%05d|%s||%s", sessao, 10000, "Resposta com sucesso",
          "000000000|"
          "DHCP|"
          "000.000.000.000|"
          "00:00:00:00:00:00|"
          "255.255.255.000|"
          "000.000.000.000|"
          "000.000.000.000|"
          "000.000.000.000|"
          "CONECTADO|"
          "ALTO|"
          "1 GBYTE|"
          "0 BYTES|"
          "20150701000000|"
          "00.00.00|"
          "00.00|"
          "000000000000000001|"
          "000000000000000001|"
          "20150401000000|"
          "20150401000000|"
          "20150101|"
          "20501231|"
          "0");
  return resp;
}


x86 assembly (clang, -O0):
<ConsultarStatusOperacional>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f17(%rip),%rdi
lea    0xed0(%rip),%rsi
mov    $0x2710,%ecx
lea    0xed3(%rip),%r8
lea    0xee1(%rip),%r9
call   1030 <sprintf@plt>
lea    0x2ef1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConsultarStatusOperacional>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
lea    0xee7(%rip),%r8
lea    0xef5(%rip),%r9
mov    %rbx,%rdi
mov    $0x2710,%ecx
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ConsultarStatusOperacional.resp = internal global [512 x i8] zeroinitializer
@.str = [15 x i8] c"%d|%05d|%s||%s\00"
@.str.1 = [21 x i8] c"Resposta com sucesso\00"
@.str.2 = [262 x i8] c"000000000|DHCP|000.000.000.000|00:00:00:00:00:00|255.255.255.000|000.000.000.000|000.000.000.000|000.000.000.000|CONECTADO|ALTO|1 GBYTE|0 BYTES|20150701000000|00.00.00|00.00|000000000000000001|000000000000000001|20150401000000|20150401000000|20150101|20501231|0\00"
define i8* @ConsultarStatusOperacional(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @sprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @ConsultarStatusOperacional.resp, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %5, i32 10000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.2, i64 0, i64 0))
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @ConsultarStatusOperacional.resp, i64 0, i64 0)
}

LLVM IR (-O2):
@ConsultarStatusOperacional.resp = internal global [512 x i8] zeroinitializer
@.str = [15 x i8] c"%d|%05d|%s||%s\00"
@.str.1 = [21 x i8] c"Resposta com sucesso\00"
@.str.2 = [262 x i8] c"000000000|DHCP|000.000.000.000|00:00:00:00:00:00|255.255.255.000|000.000.000.000|000.000.000.000|000.000.000.000|CONECTADO|ALTO|1 GBYTE|0 BYTES|20150701000000|00.00.00|00.00|000000000000000001|000000000000000001|20150401000000|20150401000000|20150101|20501231|0\00"
define i8* @ConsultarStatusOperacional(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([512 x i8], [512 x i8]* @ConsultarStatusOperacional.resp, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %0, i32 10000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([262 x i8], [262 x i8]* @.str.2, i64 0, i64 0))
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @ConsultarStatusOperacional.resp, i64 0, i64 0)
}