#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 */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ logprintf(int /*<<< orphan*/, char *);
int sqlite_delete_address(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ strtol(char *, int /*<<< orphan*/ *, int);
int mode_delete(sqlite3 *db, int argc, char *argv[]) {
  if (argc < 2) {
    logprintf(0, "Missing argument\n\n");
    return -1;
  }
  return sqlite_delete_address(db, strtol(argv[1], NULL, 10));
}


x86 assembly (clang, -O0):
<mode_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1167 <mode_delete+0x37>
xor    %edi,%edi
lea    0xeaa(%rip),%rsi
call   1050 <logprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <mode_delete+0x63>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1040 <sqlite_delete_address@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mode_delete>:
push   %rbx
cmp    $0x1,%esi
jg     114b <mode_delete+0x1b>
lea    0xec3(%rip),%rsi
xor    %edi,%edi
call   1050 <logprintf@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret
mov    %rdi,%rbx
mov    0x8(%rdx),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <sqlite_delete_address@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"Missing argument\0A\0A\00"
define i32 @mode_delete(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8**
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 @logprintf(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %4
br label %19
12: ; preds = %3
%13 = load i32*, i32** %5
%14 = load i8**, i8*** %7
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @strtol(i8* %16, i32* null, i32 10)
%18 = call i32 @sqlite_delete_address(i32* %13, i32 %17)
store i32 %18, i32* %4
br label %19
19: ; preds = %12, %10
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [19 x i8] c"Missing argument\0A\0A\00"
define i32 @mode_delete(i32* %0, i32 %1, i8** nocapture %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @logprintf(i32 0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %12
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %2, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @strtol(i8* nocapture %9, i32* null, i32 10)
%11 = tail call i32 @sqlite_delete_address(i32* %0, i32 %10)
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ -1, %5 ], [ %11, %7 ]
ret i32 %13
}