#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*/ DelField(int);
int GetPacket(unsigned char *, int);
int /*<<< orphan*/ HtLog(char *, int, char *, int, char *);
int SetPacket(unsigned char *, int);
void DelFld62(unsigned char *hexBuff, int BuffLen, int *SendLen) {
  int Ret;
  HtLog("packet.log", 1,
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/longzl1991/online/refs/heads/master/src/"
        "Comm/BF8583.c",
        827, "RRF Del FLD 62\n");
  Ret = SetPacket(&hexBuff[13], BuffLen - 13);
  if (Ret != 0) {
    HtLog("packet.log", 1,
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/longzl1991/online/refs/heads/master/src/"
          "Comm/BF8583.c",
          834, "packet err\n");
    return;
  }
  DelField(62);
  *SendLen = GetPacket(&hexBuff[13], 4096);
  *SendLen = *SendLen + 13;
}


x86 assembly (clang, -O0):
<DelFld62>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xea6(%rip),%rdi
mov    $0x1,%esi
lea    0xea5(%rip),%rdx
mov    $0x33b,%ecx
lea    0xf29(%rip),%r8
call   1030 <HtLog@plt>
mov    -0x8(%rbp),%rdi
add    $0xd,%rdi
mov    -0xc(%rbp),%esi
sub    $0xd,%esi
call   1040 <SetPacket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11c0 <DelFld62+0x80>
lea    0xe62(%rip),%rdi
mov    $0x1,%esi
lea    0xe61(%rip),%rdx
mov    $0x342,%ecx
lea    0xef5(%rip),%r8
call   1030 <HtLog@plt>
jmp    11f3 <DelFld62+0xb3>
mov    $0x3e,%edi
call   1050 <DelField@plt>
mov    -0x8(%rbp),%rdi
add    $0xd,%rdi
mov    $0x1000,%esi
call   1060 <GetPacket@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0xd,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DelFld62>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xead(%rip),%rdi
lea    0xeb1(%rip),%rdx
lea    0xf3a(%rip),%r8
mov    $0x1,%esi
mov    $0x33b,%ecx
call   1030 <HtLog@plt>
add    $0xd,%rbx
add    $0xfffffff3,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <SetPacket@plt>
test   %eax,%eax
je     11ad <DelFld62+0x6d>
lea    0xe74(%rip),%rdi
lea    0xe78(%rip),%rdx
lea    0xf11(%rip),%r8
mov    $0x1,%esi
mov    $0x342,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <HtLog@plt>
mov    $0x3e,%edi
call   1050 <DelField@plt>
mov    %rbx,%rdi
mov    $0x1000,%esi
call   1060 <GetPacket@plt>
add    $0xd,%eax
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"packet.log\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/longzl1991/online/refs/heads/master/src/Comm/BF8583.c\00"
@.str.2 = [16 x i8] c"RRF Del FLD 62\0A\00"
@.str.3 = [12 x i8] c"packet err\0A\00"
define void @DelFld62(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = call i32 @HtLog(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 827, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 13
%11 = load i32, i32* %5
%12 = sub nsw i32 %11, 13
%13 = call i32 @SetPacket(i8* %10, i32 %12)
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %3
%17 = call i32 @HtLog(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 834, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %28
18: ; preds = %3
%19 = call i32 @DelField(i32 62)
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 13
%22 = call i32 @GetPacket(i8* %21, i32 4096)
%23 = load i32*, i32** %6
store i32 %22, i32* %23
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = add nsw i32 %25, 13
%27 = load i32*, i32** %6
store i32 %26, i32* %27
br label %28
28: ; preds = %18, %16
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"packet.log\00"
@.str.1 = [144 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/longzl1991/online/refs/heads/master/src/Comm/BF8583.c\00"
@.str.2 = [16 x i8] c"RRF Del FLD 62\0A\00"
@.str.3 = [12 x i8] c"packet err\0A\00"
define void @DelFld62(i8* %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @HtLog(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 827, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds i8, i8* %0, i64 13
%6 = add nsw i32 %1, -13
%7 = tail call i32 @SetPacket(i8* %5, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %3
%10 = tail call i32 @HtLog(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([144 x i8], [144 x i8]* @.str.1, i64 0, i64 0), i32 834, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %15
11: ; preds = %3
%12 = tail call i32 @DelField(i32 62)
%13 = tail call i32 @GetPacket(i8* %5, i32 4096)
%14 = add nsw i32 %13, 13
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %9
ret void
}