#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 strtol(char *, char **, int /*<<< orphan*/);
void c_set_int(char *v1, char *v2, void *t) {
  char *endptr;
  int i;
  if (t) {
    i = strtol(v1, &endptr, 0);
    if (*v1 != '\0' && *endptr == '\0') {
      *(int *)t = i;

    } else {
    }
  } else {
  }
}


x86 assembly (clang, -O0):
<c_set_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1179 <c_set_int+0x69>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <c_set_int+0x5f>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116f <c_set_int+0x5f>
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    1174 <c_set_int+0x64>
jmp    1174 <c_set_int+0x64>
jmp    117e <c_set_int+0x6e>
jmp    117e <c_set_int+0x6e>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_set_int>:
push   %r14
push   %rbx
push   %rax
test   %rdx,%rdx
je     113a <c_set_int+0x2a>
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rsp,%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
cmpb   $0x0,(%rbx)
je     113a <c_set_int+0x2a>
mov    (%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    113a <c_set_int+0x2a>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @c_set_int(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %29
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i32 @strtol(i8* %12, i8** %7, i32 0)
store i32 %13, i32* %8
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %27
18: ; preds = %11
%19 = load i8*, i8** %7
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load i32, i32* %8
%25 = load i8*, i8** %6
%26 = bitcast i8* %25 to i32*
store i32 %24, i32* %26
br label %28
27: ; preds = %18, %11
br label %28
28: ; preds = %27, %23
br label %30
29: ; preds = %3
br label %30
30: ; preds = %29, %28
ret void
}

LLVM IR (-O2):
define void @c_set_int(i8* %0, i8* nocapture readnone %1, i8* writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = icmp eq i8* %2, null
br i1 %6, label %17, label %7
7: ; preds = %3
%8 = call i32 @strtol(i8* %0, i8** %4, i32 0)
%9 = load i8, i8* %0
%10 = icmp eq i8 %9, 0
br i1 %10, label %17, label %11
11: ; preds = %7
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = bitcast i8* %2 to i32*
store i32 %8, i32* %16
br label %17
17: ; preds = %3, %15, %11, %7
ret void
}