xunge/DecIR huggingface dataset:
void STEAM_LogLevelLoadFinished(const char *name) {}


x86 assembly (clang, -O0):
<STEAM_LogLevelLoadFinished>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<STEAM_LogLevelLoadFinished>:
ret

LLVM IR (-O0):
define void @STEAM_LogLevelLoadFinished(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @STEAM_LogLevelLoadFinished(i8* nocapture %0) {
ret void
}
int power(int num, int exp) {
  if (exp == 0)
    return 1;
  else if (exp == 1)
    return num;
  int result = power(num, exp / 2);
  result *= result;
  if (exp % 2 == 1)
    result *= num;
  return result;
}


x86 assembly (clang, -O0):
<power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1134 <power+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1194 <power+0x84>
cmpl   $0x1,-0xc(%rbp)
jne    1149 <power+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1194 <power+0x84>
jmp    114e <power+0x3e>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
call   1030 <power@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    118e <power+0x7e>
mov    -0x8(%rbp),%eax
imul   -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<power>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     1151 <power+0x41>
mov    %esi,%ebp
mov    %edi,%r14d
cmp    $0x1,%esi
je     1157 <power+0x47>
mov    %ebp,%ebx
shr    $0x1f,%ebx
add    %ebp,%ebx
mov    %ebx,%esi
sar    %esi
mov    %r14d,%edi
call   1030 <power@plt>
and    $0xfffffffe,%ebx
sub    %ebx,%ebp
cmp    $0x1,%ebp
mov    $0x1,%ecx
cmove  %r14d,%ecx
imul   %eax,%eax
imul   %ecx,%eax
mov    %eax,%r14d
jmp    1157 <power+0x47>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @power(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %33
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %3
br label %33
15: ; preds = %10
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = sdiv i32 %18, 2
%20 = call i32 @power(i32 %17, i32 %19)
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = load i32, i32* %6
%23 = mul nsw i32 %22, %21
store i32 %23, i32* %6
%24 = load i32, i32* %5
%25 = srem i32 %24, 2
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %31
27: ; preds = %16
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = mul nsw i32 %29, %28
store i32 %30, i32* %6
br label %31
31: ; preds = %27, %16
%32 = load i32, i32* %6
store i32 %32, i32* %3
br label %33
33: ; preds = %31, %13, %9
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @power(i32 %0, i32 %1) {
switch i32 %1, label %6 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %2
br label %4
4: ; preds = %3, %2, %6
%5 = phi i32 [ %13, %6 ], [ %0, %3 ], [ 1, %2 ]
ret i32 %5
6: ; preds = %2
%7 = sdiv i32 %1, 2
%8 = tail call i32 @power(i32 %0, i32 %7)
%9 = srem i32 %1, 2
%10 = icmp eq i32 %9, 1
%11 = select i1 %10, i32 %0, i32 1
%12 = mul i32 %8, %11
%13 = mul i32 %12, %8
br label %4
}
void ReportLegacy(char *cMonth, char *cYear, char *cPasswd) {
  char cTableName[12] = {""};
  ConnectDb();
  sprintf(cTableName, "t%.3s%.7s", cMonth, cYear);
  AcctReportLegacy(cTableName);
  exit(0);
}


x86 assembly (clang, -O0):
<ReportLegacy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x24(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1050 <memset@plt>
mov    $0x0,%al
call   1040 <ConnectDb@plt>
lea    -0x24(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0x24(%rbp),%rdi
mov    $0x0,%al
call   1030 <AcctReportLegacy@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<ReportLegacy>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movl   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
xor    %eax,%eax
call   1040 <ConnectDb@plt>
lea    0xe93(%rip),%rsi
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1030 <AcctReportLegacy@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"t%.3s%.7s\00"
define void @ReportLegacy(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [12 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = bitcast [12 x i8]* %7 to i8*
%9 = call i32 (...) @ConnectDb()
%10 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
%14 = getelementptr inbounds [12 x i8], [12 x i8]* %7, i64 0, i64 0
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @AcctReportLegacy to i32 (i8*, ...)*)(i8* %14)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"t%.3s%.7s\00"
define void @ReportLegacy(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = alloca [12 x i8]
%5 = getelementptr inbounds [12 x i8], [12 x i8]* %4, i64 0, i64 0
%6 = tail call i32 (...) @ConnectDb()
%7 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @AcctReportLegacy to i32 (i8*, ...)*)(i8* %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void signal_handler(int signo) { exit(0); }


x86 assembly (clang, -O0):
<signal_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<signal_handler>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @signal_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @signal_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void signal_handler_func(int signal_num) {
  printf("[CLIENT] "
         "catch signal: %d\n",
         signal_num);
}


x86 assembly (clang, -O0):
<signal_handler_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_handler_func>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"[CLIENT] catch signal: %d\0A\00"
define void @signal_handler_func(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"[CLIENT] catch signal: %d\0A\00"
define void @signal_handler_func(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printf(char *, ...);
char *read_input();
int main(void) {
  char *str = read_input();
  if (str == NULL) {
    printf("Error, nothing read.\n");
    exit(1);
  }
  printf("%s\n", str);
  free(str);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <read_input@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117d <main+0x3d>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rsi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1060 <read_input@plt>
test   %rax,%rax
jne    1163 <main+0x23>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Error, nothing read.\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* (...) @read_input()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %2
%13 = call i32 @free(i8* %12)
%14 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [21 x i8] c"Error, nothing read.\00"
define i32 @main() {
%1 = tail call i8* (...) @read_input()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* %1)
%8 = tail call i32 @free(i8* %1)
%9 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutexattr_t;

/* Variables and functions */
int EINVAL;
int /*<<< orphan*/ PTHREAD_PROCESS_PRIVATE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, ...);
int pthread_mutexattr_setpshared(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) {
  fprintf(stderr, "process-shared attribute is not available for testing\n");
  return 2;
  pthread_mutexattr_t mta;
  int ret;
  ret = pthread_mutexattr_setpshared(&mta, PTHREAD_PROCESS_PRIVATE);
  if (ret != 0) {
    if (ret == EINVAL) {
      printf("Test PASSED\n");
      return 0;
    }
    printf("Test FAILED: Expected return code 0 or EINVAL, got: %d\n", ret);
    return 1;
  }
  printf("Test PASSED: NOTE*: Returned 0 on error, though standard states "
         "'may' fail.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
lea    0xed1(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@EINVAL = global i32 0
@PTHREAD_PROCESS_PRIVATE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = load i32, i32* @stderr
%5 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 2
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [55 x i8] c"process-shared attribute is not available for testing\0A\00"
@EINVAL = global i32 0
@PTHREAD_PROCESS_PRIVATE = global i32 0
define i32 @main() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 2
}
/* Variables and functions */
char const *inet_ntop(int, void const *, char *, int);
const char *dns_ntop(int af, const void *src, char *dst, int size) {
  return inet_ntop(af, src, dst, size);
}


x86 assembly (clang, -O0):
<dns_ntop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <inet_ntop@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dns_ntop>:
jmp    1030 <inet_ntop@plt>

LLVM IR (-O0):
define i8* @dns_ntop(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i32, i32* %8
%13 = call i8* @inet_ntop(i32 %9, i8* %10, i8* %11, i32 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @dns_ntop(i32 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @inet_ntop(i32 %0, i8* %1, i8* %2, i32 %3)
ret i8* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
void printi64(int64_t n) { printf(" %ld", n); }


x86 assembly (clang, -O0):
<printi64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printi64>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" %ld\00"
define void @printi64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" %ld\00"
define void @printi64(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("start\n");
  void *mem = malloc(100);
  printf("malloc() -> %p\n", mem);
  *(int *)mem = 0;
  free(mem);
  printf("end\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
lea    0xe9f(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0x0,(%rbx)
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xe96(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"start\0A\00"
@.str.1 = [16 x i8] c"malloc() -> %p\0A\00"
@.str.2 = [5 x i8] c"end\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @malloc(i32 100)
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32 0, i32* %8
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"malloc() -> %p\0A\00"
@str = [6 x i8] c"start\00"
@str.3 = [4 x i8] c"end\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = bitcast i8* %2 to i32*
store i32 0, i32* %4
%5 = tail call i32 @free(i8* %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
int ft_strlen(char *str) {
  int i;
  i = -1;
  while (str && str[++i])
    ;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     113c <ft_strlen+0x3c>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114c <ft_strlen+0x4c>
jmp    1151 <ft_strlen+0x51>
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     111c <ft_strlen+0x1c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

LLVM IR (-O0):
define i32 @ft_strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 -1, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %16
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %7, %4
%17 = phi i1 [ false, %4 ], [ %15, %7 ]
br i1 %17, label %18, label %19
18: ; preds = %16
br label %4
19: ; preds = %16
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i64 %4, 1
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %5 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ -1, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int HeapAssignment() {
  int m = 0;
  int *x = malloc(4);
  int *y = x;
  *x = 5;
  clang_analyzer_eval(*x != *y);
  free(x);
  return 0;
}


x86 assembly (clang, -O0):
<HeapAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HeapAssignment>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
movl   $0x5,(%rax)
xor    %edi,%edi
call   1050 <clang_analyzer_eval@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @HeapAssignment() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = call i32* @malloc(i32 4)
store i32* %4, i32** %2
%5 = load i32*, i32** %2
store i32* %5, i32** %3
%6 = load i32*, i32** %2
store i32 5, i32* %6
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = icmp ne i32 %8, %10
%12 = zext i1 %11 to i32
%13 = call i32 @clang_analyzer_eval(i32 %12)
%14 = load i32*, i32** %2
%15 = call i32 @free(i32* %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @HeapAssignment() {
%1 = tail call i32* @malloc(i32 4)
store i32 5, i32* %1
%2 = tail call i32 @clang_analyzer_eval(i32 0)
%3 = tail call i32 @free(i32* %1)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ socklen_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char *);
int setsockopt(int, int, int, void const *, int /*<<< orphan*/);
void std_setsockopt(int s, int level, int optname, const void *optval,
                    socklen_t optlen) {
  if (setsockopt(s, level, optname, optval, optlen) == -1) {
    perror("setsockopt");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<std_setsockopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    117e <std_setsockopt+0x4e>
lea    0xe91(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_setsockopt>:
push   %rax
call   1030 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     113d <std_setsockopt+0xd>
pop    %rax
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"setsockopt\00"
define void @std_setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = call i32 @setsockopt(i32 %11, i32 %12, i32 %13, i8* %14, i32 %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %21
18: ; preds = %5
%19 = call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 1)
unreachable
21: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"setsockopt\00"
define void @std_setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @setsockopt(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = tail call i32 @perror(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %5
ret void
}
/* Variables and functions */
unsigned long pack_to_align(unsigned long, int);
void struct_pack_finish_bitfield(unsigned long *poffset,
                                 unsigned *pbitfield_current) {
  unsigned change = *pbitfield_current / 8;
  *poffset = pack_to_align(*poffset + change, 1);
  *pbitfield_current = 0;
}


x86 assembly (clang, -O0):
<struct_pack_finish_bitfield>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shr    $0x3,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x14(%rbp),%eax
add    %rax,%rdi
mov    $0x1,%esi
call   1030 <pack_to_align@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<struct_pack_finish_bitfield>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%edi
shr    $0x3,%rdi
add    (%rbx),%rdi
mov    $0x1,%esi
call   1030 <pack_to_align@plt>
mov    %rax,(%rbx)
movl   $0x0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @struct_pack_finish_bitfield(i64* %0, i32* %1) {
%3 = alloca i64*
%4 = alloca i32*
%5 = alloca i32
store i64* %0, i64** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = udiv i32 %7, 8
store i32 %8, i32* %5
%9 = load i64*, i64** %3
%10 = load i64, i64* %9
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = add i64 %10, %12
%14 = call i64 @pack_to_align(i64 %13, i32 1)
%15 = load i64*, i64** %3
store i64 %14, i64* %15
%16 = load i32*, i32** %4
store i32 0, i32* %16
ret void
}

LLVM IR (-O2):
define void @struct_pack_finish_bitfield(i64* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = lshr i32 %3, 3
%5 = load i64, i64* %0
%6 = zext i32 %4 to i64
%7 = add i64 %5, %6
%8 = tail call i64 @pack_to_align(i64 %7, i32 1)
store i64 %8, i64* %0
store i32 0, i32* %1
ret void
}
int acct(s)
char *s;
{ return (0); }


x86 assembly (clang, -O0):
<acct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<acct>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @acct(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @acct(i8* nocapture readnone %0) {
ret i32 0
}
int is_directory(const char *name, const char *type) {
  if ((*(unsigned long long *)name) != 0x0000000100000000ULL)
    return 0;
  if ((*(unsigned long long *)type) != 0xc4c9d9c5c3e3d6d9ULL)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_directory>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movabs $0x100000000,%rcx
cmp    %rcx,(%rax)
je     112f <is_directory+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_directory+0x59>
mov    -0x18(%rbp),%rax
movabs $0xc4c9d9c5c3e3d6d9,%rcx
d9 c9 c4
cmp    %rcx,(%rax)
je     1152 <is_directory+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1159 <is_directory+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_directory>:
xor    %eax,%eax
movabs $0x100000000,%rcx
cmp    %rcx,(%rdi)
jne    1123 <is_directory+0x23>
movabs $0xc4c9d9c5c3e3d6d9,%rcx
d9 c9 c4
xor    %eax,%eax
cmp    %rcx,(%rsi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_directory(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
%8 = load i64, i64* %7
%9 = icmp ne i64 %8, 4294967296
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %18
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to i64*
%14 = load i64, i64* %13
%15 = icmp ne i64 %14, -4266639728538560807
br i1 %15, label %16, label %17
16: ; preds = %11
store i32 0, i32* %3
br label %18
17: ; preds = %11
store i32 1, i32* %3
br label %18
18: ; preds = %17, %16, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @is_directory(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = icmp eq i64 %4, 4294967296
br i1 %5, label %6, label %11
6: ; preds = %2
%7 = bitcast i8* %1 to i64*
%8 = load i64, i64* %7
%9 = icmp eq i64 %8, -4266639728538560807
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
unsigned char gfmultby02(unsigned char);
unsigned char gfmultby0e(unsigned char b) {
  return (unsigned char)((int)gfmultby02(gfmultby02(gfmultby02(b))) ^
                         (int)gfmultby02(gfmultby02(b)) ^ (int)gfmultby02(b));
}


x86 assembly (clang, -O0):
<gfmultby0e>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <gfmultby02@plt>
movzbl %al,%edi
call   1030 <gfmultby02@plt>
movzbl %al,%edi
call   1030 <gfmultby02@plt>
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <gfmultby02@plt>
movzbl %al,%edi
call   1030 <gfmultby02@plt>
mov    %al,%cl
mov    -0xc(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <gfmultby02@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gfmultby0e>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
call   1030 <gfmultby02@plt>
movzbl %al,%edi
call   1030 <gfmultby02@plt>
movzbl %al,%edi
call   1030 <gfmultby02@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1030 <gfmultby02@plt>
movzbl %al,%edi
call   1030 <gfmultby02@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <gfmultby02@plt>
xor    %r14b,%al
xor    %bpl,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @gfmultby0e(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @gfmultby02(i8 zeroext %3)
%5 = call zeroext i8 @gfmultby02(i8 zeroext %4)
%6 = call zeroext i8 @gfmultby02(i8 zeroext %5)
%7 = zext i8 %6 to i32
%8 = load i8, i8* %2
%9 = call zeroext i8 @gfmultby02(i8 zeroext %8)
%10 = call zeroext i8 @gfmultby02(i8 zeroext %9)
%11 = zext i8 %10 to i32
%12 = xor i32 %7, %11
%13 = load i8, i8* %2
%14 = call zeroext i8 @gfmultby02(i8 zeroext %13)
%15 = zext i8 %14 to i32
%16 = xor i32 %12, %15
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define zeroext i8 @gfmultby0e(i8 zeroext %0) {
%2 = tail call zeroext i8 @gfmultby02(i8 zeroext %0)
%3 = tail call zeroext i8 @gfmultby02(i8 zeroext %2)
%4 = tail call zeroext i8 @gfmultby02(i8 zeroext %3)
%5 = tail call zeroext i8 @gfmultby02(i8 zeroext %0)
%6 = tail call zeroext i8 @gfmultby02(i8 zeroext %5)
%7 = xor i8 %6, %4
%8 = tail call zeroext i8 @gfmultby02(i8 zeroext %0)
%9 = xor i8 %7, %8
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
scalar_t__ read_cmd(char *);
int /*<<< orphan*/ run_cmd(char *);
int main() {
  printf("Vector CLI; use `help` if you are totally lost.\n");
  char command[80 + 1];
  while (read_cmd(command)) {
    run_cmd(command);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1040 <read_cmd@plt>
cmp    $0x0,%rax
je     116c <main+0x3c>
lea    -0x60(%rbp),%rdi
call   1050 <run_cmd@plt>
jmp    114b <main+0x1b>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <read_cmd@plt>
test   %rax,%rax
je     1175 <main+0x45>
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1050 <run_cmd@plt>
mov    %rbx,%rdi
call   1040 <read_cmd@plt>
test   %rax,%rax
jne    1160 <main+0x30>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [49 x i8] c"Vector CLI; use `help` if you are totally lost.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [81 x i8]
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%6 = call i64 @read_cmd(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds [81 x i8], [81 x i8]* %2, i64 0, i64 0
%10 = call i32 @run_cmd(i8* %9)
br label %4
11: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@str = [48 x i8] c"Vector CLI; use `help` if you are totally lost.\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%4 = call i64 @read_cmd(i8* %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %0, %6
%7 = call i32 @run_cmd(i8* %3)
%8 = call i64 @read_cmd(i8* %3)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  printf("%d\n", a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    (%rsp),%esi
add    0x4(%rsp),%esi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = add nsw i32 %4, %5
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
void *debugmalloc_malloc_full(size_t, char *, char *, char *,
                              int /*<<< orphan*/, int /*<<< orphan*/);
void *debugmalloc_malloc(size_t meret) {
  return debugmalloc_malloc_full(meret, "malloc", "ismeretlen", "(ismeretlen)",
                                 0, 0);
}


x86 assembly (clang, -O0):
<debugmalloc_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    0xed9(%rip),%rdx
lea    0xedd(%rip),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <debugmalloc_malloc_full@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugmalloc_malloc>:
lea    0xee9(%rip),%rsi
lea    0xee9(%rip),%rdx
lea    0xeed(%rip),%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <debugmalloc_malloc_full@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@.str.1 = [11 x i8] c"ismeretlen\00"
@.str.2 = [13 x i8] c"(ismeretlen)\00"
define i8* @debugmalloc_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @debugmalloc_malloc_full(i64 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
ret i8* %4
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@.str.1 = [11 x i8] c"ismeretlen\00"
@.str.2 = [13 x i8] c"(ismeretlen)\00"
define i8* @debugmalloc_malloc(i64 %0) {
%2 = tail call i8* @debugmalloc_malloc_full(i64 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ f1(int **);
int /*<<< orphan*/ f2(int ****);
int /*<<< orphan*/ f3(int *******);
int main(void) {
  int q[1][3];
  f1(q);
  int(*r[2][3])[5];
  f2(r);
  int(*(**s[3])[])[][2];
  f3(s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0xc(%rbp),%rdi
call   1050 <f1@plt>
lea    -0x40(%rbp),%rdi
call   1030 <f2@plt>
lea    -0x60(%rbp),%rdi
call   1040 <f3@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x68,%rsp
lea    0x4(%rsp),%rdi
call   1050 <f1@plt>
lea    0x30(%rsp),%rdi
call   1030 <f2@plt>
lea    0x10(%rsp),%rdi
call   1040 <f3@plt>
xor    %eax,%eax
add    $0x68,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [1 x [3 x i32]]
%2 = alloca [2 x [3 x [5 x i32]*]]
%3 = alloca [3 x [0 x [0 x [2 x i32]]*]**]
%4 = getelementptr inbounds [1 x [3 x i32]], [1 x [3 x i32]]* %1, i64 0, i64 0
%5 = bitcast [3 x i32]* %4 to i32**
%6 = call i32 @f1(i32** %5)
%7 = getelementptr inbounds [2 x [3 x [5 x i32]*]], [2 x [3 x [5 x i32]*]]* %2, i64 0, i64 0
%8 = bitcast [3 x [5 x i32]*]* %7 to i32****
%9 = call i32 @f2(i32**** %8)
%10 = getelementptr inbounds [3 x [0 x [0 x [2 x i32]]*]**], [3 x [0 x [0 x [2 x i32]]*]**]* %3, i64 0, i64 0
%11 = bitcast [0 x [0 x [2 x i32]]*]*** %10 to i32*******
%12 = call i32 @f3(i32******* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1 x [3 x i32]]
%2 = alloca [2 x [3 x [5 x i32]*]]
%3 = alloca [3 x [0 x [0 x [2 x i32]]*]**]
%4 = bitcast [1 x [3 x i32]]* %1 to i8*
%5 = bitcast [1 x [3 x i32]]* %1 to i32**
%6 = call i32 @f1(i32** %5)
%7 = bitcast [2 x [3 x [5 x i32]*]]* %2 to i8*
%8 = bitcast [2 x [3 x [5 x i32]*]]* %2 to i32****
%9 = call i32 @f2(i32**** %8)
%10 = bitcast [3 x [0 x [0 x [2 x i32]]*]**]* %3 to i8*
%11 = bitcast [3 x [0 x [0 x [2 x i32]]*]**]* %3 to i32*******
%12 = call i32 @f3(i32******* %11)
ret i32 0
}
int test_imm_A0uint16_reg(unsigned short val) {
  return ((val) & (-0xA0 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A0uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff60,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A0uint16_reg>:
test   $0xff60,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A0uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -160
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_A0uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -160
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int PMPI_Initialized(int *);
int MPI_Initialized(int *flag) {
  ;
  return PMPI_Initialized(flag);
}


x86 assembly (clang, -O0):
<MPI_Initialized>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <PMPI_Initialized@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPI_Initialized>:
jmp    1030 <PMPI_Initialized@plt>

LLVM IR (-O0):
define i32 @MPI_Initialized(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @PMPI_Initialized(i32* %3)
ret i32 %4
}

LLVM IR (-O2):
define i32 @MPI_Initialized(i32* %0) {
%2 = tail call i32 @PMPI_Initialized(i32* %0)
ret i32 %2
}
/* Variables and functions */
int atoi(char *);
int get_val(char *str) {
  char *pointer = str;
  if (*pointer == 45) {
    pointer++;
    return atoi(pointer) * -1;
  } else {
    pointer++;
    return atoi(pointer);
  }
}


x86 assembly (clang, -O0):
<get_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1154 <get_val+0x44>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atoi@plt>
imul   $0xffffffff,%eax,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <get_val+0x5c>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_val>:
push   %rbx
mov    (%rdi),%bl
add    $0x1,%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
neg    %ecx
cmp    $0x2d,%bl
cmove  %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_val(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
store i8* %5, i8** %4
%6 = load i8*, i8** %4
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %16
10: ; preds = %1
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 @atoi(i8* %13)
%15 = mul nsw i32 %14, -1
store i32 %15, i32* %2
br label %21
16: ; preds = %1
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
%19 = load i8*, i8** %4
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %2
br label %21
21: ; preds = %16, %10
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @get_val(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call i32 @atoi(i8* %4)
%6 = sub nsw i32 0, %5
%7 = select i1 %3, i32 %6, i32 %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int count, sum;
  count = 0;
  sum = 0;
  while (count++ < 20)
    sum = sum + count;
  printf("sum = %d\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x14,%eax
jge    114f <main+0x3f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0xd2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %0
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = icmp slt i32 %5, 20
br i1 %7, label %8, label %12
8: ; preds = %4
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = add nsw i32 %9, %10
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"sum = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 210)
ret i32 0
}
/* Variables and functions */
int chdir(char const *);
int deleter(char const *);
int /*<<< orphan*/ perror(char const *);
int cmd_delete(const char *jobid) {
  if (chdir(jobid) == -1) {
    perror(jobid);
    return 1;
  }
  return deleter(jobid);
}


x86 assembly (clang, -O0):
<cmd_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0xffffffff,%eax
jne    1163 <cmd_delete+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    116f <cmd_delete+0x3f>
mov    -0x10(%rbp),%rdi
call   1050 <deleter@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_delete>:
push   %rbx
mov    %rdi,%rbx
call   1030 <chdir@plt>
mov    %rbx,%rdi
cmp    $0xffffffff,%eax
je     1147 <cmd_delete+0x17>
pop    %rbx
jmp    1050 <deleter@plt>
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @cmd_delete(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @chdir(i8* %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
store i32 1, i32* %2
br label %13
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @deleter(i8* %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %10, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @cmd_delete(i8* %0) {
%2 = tail call i32 @chdir(i8* %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* %0)
br label %8
6: ; preds = %1
%7 = tail call i32 @deleter(i8* %0)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %4 ], [ %7, %6 ]
ret i32 %9
}
void t22() {}


x86 assembly (clang, -O0):
<t22>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t22>:
ret

LLVM IR (-O0):
define void @t22() {
ret void
}

LLVM IR (-O2):
define void @t22() {
ret void
}
int tabpos(int pos, char *tab) {
  if (pos >= 1000)
    return 1;
  else
    return tab[pos];
}


x86 assembly (clang, -O0):
<tabpos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jl     1124 <tabpos+0x24>
movl   $0x1,-0x4(%rbp)
jmp    1133 <tabpos+0x33>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tabpos>:
mov    $0x1,%eax
cmp    $0x3e7,%edi
jg     1114 <tabpos+0x14>
movslq %edi,%rax
movsbl (%rsi,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @tabpos(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i32, i32* %4
%7 = icmp sge i32 %6, 1000
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %16
9: ; preds = %2
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
store i32 %15, i32* %3
br label %16
16: ; preds = %9, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @tabpos(i32 %0, i8* nocapture %1) {
%3 = icmp sgt i32 %0, 999
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ 1, %2 ]
ret i32 %10
}