#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*/ arg;

/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ roadmap_bar_decode_arg(char *, int, char const *, int);
int /*<<< orphan*/ roadmap_log(int, char *, int, char *, char const *);
void roadmap_bar_decode_integer(int *value, int argc, const char **argv,
                                int *argl) {
  char arg[255];
  argc -= 1;
  if (argc != 1) {
    roadmap_log(4,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/refs/"
                "heads/master/roadmap_bar.c",
                203, "roadmap bar: illegal integer value - %s", argv[0]);
    return;
  }
  roadmap_bar_decode_arg(arg, sizeof(arg), argv[1], argl[1]);
  *value = atoi(arg);
}


x86 assembly (clang, -O0):
<roadmap_bar_decode_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1186 <roadmap_bar_decode_integer+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%r8
mov    $0x4,%edi
lea    0xe90(%rip),%rsi
mov    $0xcb,%edx
lea    0xf15(%rip),%rcx
call   1030 <roadmap_log@plt>
jmp    11ba <roadmap_bar_decode_integer+0x8a>
lea    -0x120(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
mov    $0xff,%esi
call   1040 <roadmap_bar_decode_arg@plt>
lea    -0x120(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roadmap_bar_decode_integer>:
push   %r14
push   %rbx
sub    $0x108,%rsp
cmp    $0x2,%esi
jne    116e <roadmap_bar_decode_integer+0x3e>
mov    %rdi,%rbx
mov    0x8(%rdx),%rdx
mov    0x4(%rcx),%ecx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xff,%esi
call   1040 <roadmap_bar_decode_arg@plt>
mov    %r14,%rdi
call   1050 <atoi@plt>
mov    %eax,(%rbx)
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret
mov    (%rdx),%r8
lea    0xe88(%rip),%rsi
lea    0xf12(%rip),%rcx
mov    $0x4,%edi
mov    $0xcb,%edx
add    $0x108,%rsp
pop    %rbx
pop    %r14
jmp    1030 <roadmap_log@plt>

LLVM IR (-O0):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/refs/heads/master/roadmap_bar.c\00"
@.str.1 = [40 x i8] c"roadmap bar: illegal integer value - %s\00"
define void @roadmap_bar_decode_integer(i32* %0, i32 %1, i8** %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32*
%9 = alloca [255 x i8]
store i32* %0, i32** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = icmp ne i32 %12, 1
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i8**, i8*** %7
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @roadmap_log(i32 4, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 203, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %31
19: ; preds = %4
%20 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%21 = load i8**, i8*** %7
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = load i32*, i32** %8
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load i32, i32* %25
%27 = call i32 @roadmap_bar_decode_arg(i8* %20, i32 255, i8* %23, i32 %26)
%28 = getelementptr inbounds [255 x i8], [255 x i8]* %9, i64 0, i64 0
%29 = call i32 @atoi(i8* %28)
%30 = load i32*, i32** %5
store i32 %29, i32* %30
br label %31
31: ; preds = %19, %14
ret void
}

LLVM IR (-O2):
@.str = [145 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/maximuska/Freemap-waze/refs/heads/master/roadmap_bar.c\00"
@.str.1 = [40 x i8] c"roadmap bar: illegal integer value - %s\00"
define void @roadmap_bar_decode_integer(i32* nocapture writeonly %0, i32 %1, i8** nocapture %2, i32* nocapture %3) {
%5 = alloca [255 x i8]
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i64 0, i64 0
%7 = icmp eq i32 %1, 2
br i1 %7, label %11, label %8
8: ; preds = %4
%9 = load i8*, i8** %2
%10 = tail call i32 @roadmap_log(i32 4, i8* getelementptr inbounds ([145 x i8], [145 x i8]* @.str, i64 0, i64 0), i32 203, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8* %9)
br label %18
11: ; preds = %4
%12 = getelementptr inbounds i8*, i8** %2, i64 1
%13 = load i8*, i8** %12
%14 = getelementptr inbounds i32, i32* %3, i64 1
%15 = load i32, i32* %14
%16 = call i32 @roadmap_bar_decode_arg(i8* %6, i32 255, i8* %13, i32 %15)
%17 = call i32 @atoi(i8* %6)
store i32 %17, i32* %0
br label %18
18: ; preds = %11, %8
ret void
}