#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 */
unsigned int atoi(char *);
int /*<<< orphan*/ expand(unsigned char *, unsigned char *, unsigned int,
                          unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main(int argc, char *argv[]) {
  unsigned char out[4];
  unsigned char in[4] = {0x2, 0x3, 0x5, 0x7};
  unsigned int x = atoi(argv[1]);
  unsigned int y = atoi(argv[2]);
  expand(out, in, x, y);
  printf("%02hhx\n", (unsigned int)out[0]);
  printf("%02hhx\n", (unsigned int)out[1]);
  printf("%02hhx\n", (unsigned int)out[2]);
  printf("%02hhx\n", (unsigned int)out[3]);
  return 0;
}


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    0xeb4(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x20(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1040 <expand@plt>
movzbl -0x14(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x13(%rbp),%esi
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x12(%rbp),%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
movzbl -0x11(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
movl   $0x7050302,0x4(%rsp)
07
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    %ebp,%edx
mov    %eax,%ecx
call   1040 <expand@plt>
movzbl (%rsp),%esi
lea    0xe92(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movzbl 0x1(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movzbl 0x2(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
movzbl 0x3(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.in = [4 x i8] c"\02\03\05\07"
@.str = [8 x i8] c"%02hhx\0A\00"
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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [4 x i8]* %7 to i8*
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %8
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %9
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%20 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = call i32 @expand(i8* %19, i8* %20, i32 %21, i32 %22)
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 0
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 2
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = getelementptr inbounds [4 x i8], [4 x i8]* %6, i64 0, i64 3
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%02hhx\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = bitcast i32* %4 to i8*
store i32 117768962, i32* %4
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = call i32 @expand(i8* %5, i8* %6, i32 %9, i32 %12)
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}