#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*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ stderr;
char *at_comwdg(char *buf) {
  if (buf != NULL)
    sprintf(buf, "AT*COMWDG=1\r");
  else
    fprintf(stderr, "[%s:%d] Error: Buffer is null!",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/super7ramp/Leonard/refs/heads/master/"
            "src/com/at-commands.c",
            107);
  return buf;
}


x86 assembly (clang, -O0):
<at_comwdg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     114c <at_comwdg+0x2c>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1040 <sprintf@plt>
jmp    116d <at_comwdg+0x4d>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
lea    0xec9(%rip),%rdx
mov    $0x6b,%ecx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_comwdg>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1136 <at_comwdg+0x26>
movabs $0xd313d4744574d,%rax
mov    %rax,0x5(%rbx)
movabs $0x44574d4f432a5441,%rax
4d 57 44
mov    %rax,(%rbx)
jmp    1157 <at_comwdg+0x47>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
lea    0xedf(%rip),%rdx
mov    $0x6b,%ecx
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"AT*COMWDG=1\0D\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"[%s:%d] Error: Buffer is null!\00"
@.str.2 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/super7ramp/Leonard/refs/heads/master/src/com/at-commands.c\00"
define i8* @at_comwdg(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0), i32 107)
br label %11
11: ; preds = %8, %5
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"AT*COMWDG=1\0D\00"
@stderr = global i32 0
@.str.1 = [31 x i8] c"[%s:%d] Error: Buffer is null!\00"
@.str.2 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/super7ramp/Leonard/refs/heads/master/src/com/at-commands.c\00"
define i8* @at_comwdg(i8* returned writeonly %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %4, label %3
3: ; preds = %1
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(13) %0, i8* align 1 dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i64 13, i1 false)
br label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.2, i64 0, i64 0), i32 107)
br label %7
7: ; preds = %4, %3
ret i8* %0
}