#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, char const *, char const *,
                           char const *);
int /*<<< orphan*/ stderr;
char *at_config_ids(char *buf, int seq, const char *sessionId,
                    const char *userId, const char *appId) {
  if (buf != NULL)
    sprintf(buf, "AT*CONFIG_IDS=%d,\"%s\",\"%s\",\"%s\"\r", seq, sessionId,
            userId, appId);
  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",
            98);
  return buf;
}


x86 assembly (clang, -O0):
<at_config_ids>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116a <at_config_ids+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0xea0(%rip),%rsi
call   1040 <sprintf@plt>
jmp    118b <at_config_ids+0x6b>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
lea    0xebf(%rip),%rdx
mov    $0x62,%ecx
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_config_ids>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
je     1145 <at_config_ids+0x25>
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %esi,%edx
lea    0xec5(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
jmp    1166 <at_config_ids+0x46>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    $0x62,%ecx
call   1030 <fprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"AT*CONFIG_IDS=%d,\22%s\22,\22%s\22,\22%s\22\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_config_ids(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %6
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %20
13: ; preds = %5
%14 = load i8*, i8** %6
%15 = load i32, i32* %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = load i8*, i8** %10
%19 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %15, i8* %16, i8* %17, i8* %18)
br label %23
20: ; preds = %5
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, 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 98)
br label %23
23: ; preds = %20, %13
%24 = load i8*, i8** %6
ret i8* %24
}

LLVM IR (-O2):
@.str = [33 x i8] c"AT*CONFIG_IDS=%d,\22%s\22,\22%s\22,\22%s\22\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_config_ids(i8* returned writeonly %0, i32 %1, i8* %2, i8* %3, i8* %4) {
%6 = icmp eq i8* %0, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 @sprintf(i8* %0, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3, i8* %4)
br label %12
9: ; preds = %5
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, 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 98)
br label %12
12: ; preds = %9, %7
ret i8* %0
}