#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 memcmp(char *, char *, int);
int main(int argc, char **argv) {
  char a1[] = {argc, 2, 3, 4};
  char a2[] = {1, 2 * argc, 3, 4};
  int res = memcmp(a1, a2, 5 + argc);
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %al,-0x14(%rbp)
movb   $0x2,-0x13(%rbp)
movb   $0x3,-0x12(%rbp)
movb   $0x4,-0x11(%rbp)
movb   $0x1,-0x18(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x17(%rbp)
movb   $0x3,-0x16(%rbp)
movb   $0x4,-0x15(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%edx
add    $0x5,%edx
call   1030 <memcmp@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %dil,0x4(%rsp)
movw   $0x302,0x5(%rsp)
movb   $0x4,0x7(%rsp)
movb   $0x1,(%rsp)
lea    (%rdi,%rdi,1),%eax
mov    %al,0x1(%rsp)
movw   $0x403,0x2(%rsp)
lea    0x5(%rdi),%edx
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <memcmp@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [4 x i8]
%7 = alloca [4 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%10 = load i32, i32* %4
%11 = trunc i32 %10 to i8
store i8 %11, i8* %9
%12 = getelementptr inbounds i8, i8* %9, i64 1
store i8 2, i8* %12
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 3, i8* %13
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 4, i8* %14
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
store i8 1, i8* %15
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i32, i32* %4
%18 = mul nsw i32 2, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %16
%20 = getelementptr inbounds i8, i8* %16, i64 1
store i8 3, i8* %20
%21 = getelementptr inbounds i8, i8* %20, i64 1
store i8 4, i8* %21
%22 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%24 = load i32, i32* %4
%25 = add nsw i32 5, %24
%26 = call i32 @memcmp(i8* %22, i8* %23, i32 %25)
store i32 %26, i32* %8
%27 = load i32, i32* %8
ret i32 %27
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [4 x i8]
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = trunc i32 %0 to i8
store i8 %6, i8* %5
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 2, i8* %7
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 3, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 4, i8* %9
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 1, i8* %10
%11 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
%12 = shl i8 %6, 1
store i8 %12, i8* %11
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 3, i8* %13
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 4, i8* %14
%15 = add nsw i32 %0, 5
%16 = call i32 @memcmp(i8* %5, i8* %10, i32 %15)
ret i32 %16
}