#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*/ memset(unsigned char *, char, int);
int /*<<< orphan*/ strcpy(char *, char *);
long int c2li(unsigned char temp_3[]) {
  long int i;
  unsigned char a[4];
  memset(a, '\0', 4);
  strcpy((char *)a, (char *)temp_3);
  i = a[0];
  i <<= 8;
  i |= a[1];
  i <<= 8;
  i |= a[2];
  i <<= 8;
  i |= a[3];
  return (i);
}


x86 assembly (clang, -O0):
<c2li>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x14(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
lea    -0x14(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
movzbl -0x14(%rbp),%eax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
movzbl -0x13(%rbp),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
movzbl -0x12(%rbp),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
mov    %rax,-0x10(%rbp)
movzbl -0x11(%rbp),%eax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c2li>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0x4(%rsp),%eax
shl    $0x20,%rax
bswap  %rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @c2li(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca [4 x i8]
store i8* %0, i8** %2
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i8 signext 0, i32 4)
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%8 = load i8*, i8** %2
%9 = call i32 @strcpy(i8* %7, i8* %8)
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = shl i64 %13, 8
store i64 %14, i64* %3
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%16 = load i8, i8* %15
%17 = zext i8 %16 to i64
%18 = load i64, i64* %3
%19 = or i64 %18, %17
store i64 %19, i64* %3
%20 = load i64, i64* %3
%21 = shl i64 %20, 8
store i64 %21, i64* %3
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
%23 = load i8, i8* %22
%24 = zext i8 %23 to i64
%25 = load i64, i64* %3
%26 = or i64 %25, %24
store i64 %26, i64* %3
%27 = load i64, i64* %3
%28 = shl i64 %27, 8
store i64 %28, i64* %3
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
%30 = load i8, i8* %29
%31 = zext i8 %30 to i64
%32 = load i64, i64* %3
%33 = or i64 %32, %31
store i64 %33, i64* %3
%34 = load i64, i64* %3
ret i64 %34
}

LLVM IR (-O2):
define i64 @c2li(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i8 signext 0, i32 4)
%5 = call i32 @strcpy(i8* %3, i8* %0)
%6 = load i8, i8* %3
%7 = zext i8 %6 to i64
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 1
%9 = load i8, i8* %8
%10 = zext i8 %9 to i64
%11 = shl nuw nsw i64 %7, 16
%12 = shl nuw nsw i64 %10, 8
%13 = or i64 %12, %11
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 2
%15 = load i8, i8* %14
%16 = zext i8 %15 to i64
%17 = or i64 %13, %16
%18 = shl nuw nsw i64 %17, 8
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 3
%20 = load i8, i8* %19
%21 = zext i8 %20 to i64
%22 = or i64 %18, %21
ret i64 %22
}