#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*/ printf(char *, int, ...);
int /*<<< orphan*/ strlen(char *);
void proc1(int param1, char param2[], int param3) {
  int g3_1;
  int g3_2;
  int local0;
  int local1;
  int local2;
  local2 = param3;
  if (param1 <= 2) {
    strlen(param2);
    local0 = g3_1;
  } else {
    strlen(param2);
    local0 = g3_2;
    strlen(param2);
    local1 = g3_1;
    printf("%d", g3_2 + g3_1);
    local2 = local1;
  }
  param3 = local2;
  printf("%d, %d", local0, param3);
  return;
}


x86 assembly (clang, -O0):
<proc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x2,-0x4(%rbp)
jg     1156 <proc1+0x36>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    118e <proc1+0x6e>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%esi
add    -0x18(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc1>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
cmp    $0x3,%ebp
jl     114f <proc1+0x2f>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d, %d\00"
define void @proc1(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
store i32 %12, i32* %11
%13 = load i32, i32* %4
%14 = icmp sle i32 %13, 2
br i1 %14, label %15, label %19
15: ; preds = %3
%16 = load i8*, i8** %5
%17 = call i32 @strlen(i8* %16)
%18 = load i32, i32* %7
store i32 %18, i32* %9
br label %31
19: ; preds = %3
%20 = load i8*, i8** %5
%21 = call i32 @strlen(i8* %20)
%22 = load i32, i32* %8
store i32 %22, i32* %9
%23 = load i8*, i8** %5
%24 = call i32 @strlen(i8* %23)
%25 = load i32, i32* %7
store i32 %25, i32* %10
%26 = load i32, i32* %8
%27 = load i32, i32* %7
%28 = add nsw i32 %26, %27
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %10
store i32 %30, i32* %11
br label %31
31: ; preds = %19, %15
%32 = load i32, i32* %11
store i32 %32, i32* %6
%33 = load i32, i32* %9
%34 = load i32, i32* %6
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %33, i32 %34)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d, %d\00"
define void @proc1(i32 %0, i8* %1, i32 %2) {
%4 = icmp slt i32 %0, 3
%5 = tail call i32 @strlen(i8* %1)
br i1 %4, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @strlen(i8* %1)
%8 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 undef)
br label %9
9: ; preds = %3, %6
%10 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 undef, i32 %2)
ret void
}