#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 *,
                           char *);
char *ConsultarStatusOperacional(int sessao, char *codigo_ativacao) {
  static char resp[512];
  int eeeee = 10000;
  char *mensagem = "Resposta com sucesso";
  char *cod = "";
  char *mensagem_sefaz = "";
  sprintf(resp, "%d|%05d|%s|%s|%s|%s", sessao, eeeee, mensagem, cod,
          mensagem_sefaz,
          "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|"
          "35000000000000000000590000000000000000000001|"
          "35000000000000000000590000000000000000000001|"
          "35000000000000000000590000000000000000000001|"
          "20150401000000|"
          "20150401000000|"
          "20150101|"
          "20501231|"
          "0");
  return resp;
}


x86 assembly (clang, -O0):
<ConsultarStatusOperacional>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2710,-0x14(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0x1057(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0x104c(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%r10
lea    0x2ee0(%rip),%rdi
lea    0xeae(%rip),%rsi
lea    0xebb(%rip),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <sprintf@plt>
lea    0x2ebd(%rip),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConsultarStatusOperacional>:
push   %rbx
mov    %edi,%edx
lea    0xf0f(%rip),%rax
lea    0x106e(%rip),%r9
lea    0x2f18(%rip),%rbx
lea    0xee6(%rip),%rsi
lea    0xeca(%rip),%r8
mov    %rbx,%rdi
mov    $0x2710,%ecx
push   %rax
push   %r9
call   1030 <sprintf@plt>
add    $0x10,%rsp
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ConsultarStatusOperacional.resp = internal global [512 x i8] zeroinitializer
@.str = [21 x i8] c"Resposta com sucesso\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [20 x i8] c"%d|%05d|%s|%s|%s|%s\00"
@.str.3 = [359 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|35000000000000000000590000000000000000000001|35000000000000000000590000000000000000000001|35000000000000000000590000000000000000000001|20150401000000|20150401000000|20150101|20501231|0\00"
define i8* @ConsultarStatusOperacional(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 10000, i32* %5
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = load i8*, i8** %8
%14 = call i32 @sprintf(i8* getelementptr inbounds ([512 x i8], [512 x i8]* @ConsultarStatusOperacional.resp, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10, i8* %11, i8* %12, i8* %13, i8* getelementptr inbounds ([359 x i8], [359 x i8]* @.str.3, 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 = [21 x i8] c"Resposta com sucesso\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [20 x i8] c"%d|%05d|%s|%s|%s|%s\00"
@.str.3 = [359 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|35000000000000000000590000000000000000000001|35000000000000000000590000000000000000000001|35000000000000000000590000000000000000000001|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 ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %0, i32 10000, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([359 x i8], [359 x i8]* @.str.3, i64 0, i64 0))
ret i8* getelementptr inbounds ([512 x i8], [512 x i8]* @ConsultarStatusOperacional.resp, i64 0, i64 0)
}