#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 pico_mqtt_packet {
  int dummy;
};
struct pico_mqtt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ destroy_packet(struct pico_mqtt_packet *);
int send_acknowledge(struct pico_mqtt *, struct pico_mqtt_packet *,
                     int /*<<< orphan*/);
int handle_pingreq(struct pico_mqtt *mqtt, struct pico_mqtt_packet *packet) {
  do {
  } while (0);
  do {
  } while (0);
  if (send_acknowledge(mqtt, packet, 0) == -1)
    return -1;
  destroy_packet(packet);
  return 0;
}


x86 assembly (clang, -O0):
<handle_pingreq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
jmp    1135 <handle_pingreq+0x15>
jmp    113a <handle_pingreq+0x1a>
jmp    113f <handle_pingreq+0x1f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1040 <send_acknowledge@plt>
cmp    $0xffffffff,%eax
jne    1163 <handle_pingreq+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    1173 <handle_pingreq+0x53>
mov    -0x18(%rbp),%rdi
call   1030 <destroy_packet@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_pingreq>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
xor    %ebp,%ebp
xor    %edx,%edx
call   1040 <send_acknowledge@plt>
cmp    $0xffffffff,%eax
je     113e <handle_pingreq+0x1e>
mov    %rbx,%rdi
call   1030 <destroy_packet@plt>
jmp    1143 <handle_pingreq+0x23>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_pingreq(%struct.pico_mqtt* %0, %struct.pico_mqtt_packet* %1) {
%3 = alloca i32
%4 = alloca %struct.pico_mqtt*
%5 = alloca %struct.pico_mqtt_packet*
store %struct.pico_mqtt* %0, %struct.pico_mqtt** %4
store %struct.pico_mqtt_packet* %1, %struct.pico_mqtt_packet** %5
br label %6
6: ; preds = %2
br label %7
7: ; preds = %6
br label %8
8: ; preds = %7
br label %9
9: ; preds = %8
%10 = load %struct.pico_mqtt*, %struct.pico_mqtt** %4
%11 = load %struct.pico_mqtt_packet*, %struct.pico_mqtt_packet** %5
%12 = call i32 @send_acknowledge(%struct.pico_mqtt* %10, %struct.pico_mqtt_packet* %11, i32 0)
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %15
14: ; preds = %9
store i32 -1, i32* %3
br label %18
15: ; preds = %9
%16 = load %struct.pico_mqtt_packet*, %struct.pico_mqtt_packet** %5
%17 = call i32 @destroy_packet(%struct.pico_mqtt_packet* %16)
store i32 0, i32* %3
br label %18
18: ; preds = %15, %14
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
%struct.pico_mqtt = type { i32 }
%struct.pico_mqtt_packet = type { i32 }
define i32 @handle_pingreq(%struct.pico_mqtt* %0, %struct.pico_mqtt_packet* %1) {
%3 = tail call i32 @send_acknowledge(%struct.pico_mqtt* %0, %struct.pico_mqtt_packet* %1, i32 0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @destroy_packet(%struct.pico_mqtt_packet* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}