xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ isspace(char);
int is_comment(char *string) {
  for (; *string; string++) {
    if (*string == '#')
      return (1);
    if (!isspace(*string))
      return (0);
  }
  return (0);
}


x86 assembly (clang, -O0):
<is_comment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     117c <is_comment+0x6c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1145 <is_comment+0x35>
movl   $0x1,-0x4(%rbp)
jmp    1183 <is_comment+0x73>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%eax
jne    1166 <is_comment+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1183 <is_comment+0x73>
jmp    116b <is_comment+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_comment+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_comment>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%eax
test   %al,%al
je     113b <is_comment+0x2b>
cmp    $0x23,%al
je     113f <is_comment+0x2f>
movsbl %al,%edi
call   1030 <isspace@plt>
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <is_comment+0x10>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_comment(i8* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %8, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %11
i8 35, label %9
]
5: ; preds = %2
%6 = tail call i32 @isspace(i8 signext %4)
%7 = icmp eq i32 %6, 0
%8 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2, %5
%10 = phi i32 [ 0, %5 ], [ 1, %2 ]
br label %11
11: ; preds = %2, %9
%12 = phi i32 [ %10, %9 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ upCopy(char *, char *);
int main() {
  char *p1, *p2 = "AbCdEFghi";
  upCopy(p1, p2);
  printf("%s,%s", p1, p2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <upCopy@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rsi
call   1040 <upCopy@plt>
lea    0xed3(%rip),%rdi
mov    %rbx,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"AbCdEFghi\00"
@.str.1 = [6 x i8] c"%s,%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = call i32 @upCopy(i8* %4, i8* %5)
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"AbCdEFghi\00"
@.str.1 = [6 x i8] c"%s,%s\00"
define i32 @main() {
%1 = tail call i32 @upCopy(i8* undef, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* undef, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void mwsync_pbdhook_free(void *chook) { return; }


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

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

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

LLVM IR (-O2):
define void @mwsync_pbdhook_free(i8* nocapture %0) {
ret void
}
char *strspl(cp, dp)
register char *cp, *dp;
{
  register char *ep = malloc((unsigned)(strlen(cp) + strlen(dp) + 1));
  if (ep == (char *)0)
    fatal("Out of memory");
  (void)strcpy(ep, cp);
  (void)strcat(ep, dp);
  return (ep);
}


x86 assembly (clang, -O0):
<strspl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
add    $0x1,%rax
mov    %eax,%eax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11aa <strspl+0x5a>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1070 <fatal@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strspl>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%rbx,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    118c <strspl+0x3c>
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1070 <fatal@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @strspl(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 1
%12 = trunc i64 %11 to i32
%13 = zext i32 %12 to i64
%14 = call i8* @malloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %2
%18 = call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load i8*, i8** %5
%21 = load i8*, i8** %3
%22 = call i8* @strcpy(i8* %20, i8* %21)
%23 = load i8*, i8** %5
%24 = load i8*, i8** %4
%25 = call i8* @strcat(i8* %23, i8* %24)
%26 = load i8*, i8** %5
ret i8* %26
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @strspl(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 1
%6 = add i64 %5, %4
%7 = and i64 %6, 4294967295
%8 = tail call i8* @malloc(i64 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fatal to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = tail call i8* @strcpy(i8* dereferenceable(1) %8, i8* dereferenceable(1) %0)
%14 = tail call i8* @strcat(i8* dereferenceable(1) %8, i8* dereferenceable(1) %1)
ret i8* %8
}
int gouraudAdjust(int color, int tableValue) {
  color += (tableValue - 0x10);
  if (color < 0)
    color = 0;
  if (color > 0x1f)
    color = 0x1f;
  return color;
}


x86 assembly (clang, -O0):
<gouraudAdjust>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x10,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1127 <gouraudAdjust+0x27>
movl   $0x0,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jle    1138 <gouraudAdjust+0x38>
movl   $0x1f,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gouraudAdjust>:
lea    (%rdi,%rsi,1),%eax
add    $0xfffffff0,%eax
xor    %ecx,%ecx
test   %eax,%eax
cmovns %eax,%ecx
cmp    $0x1f,%ecx
mov    $0x1f,%eax
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @gouraudAdjust(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sub nsw i32 %5, 16
%7 = load i32, i32* %3
%8 = add nsw i32 %7, %6
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 31
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 31, i32* %3
br label %16
16: ; preds = %15, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @gouraudAdjust(i32 %0, i32 %1) {
%3 = add i32 %0, -16
%4 = add i32 %3, %1
%5 = icmp sgt i32 %4, 0
%6 = select i1 %5, i32 %4, i32 0
%7 = icmp ult i32 %6, 31
%8 = select i1 %7, i32 %6, i32 31
ret i32 %8
}
int symbolic_start(int c) {
  return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_';
}


x86 assembly (clang, -O0):
<symbolic_start>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1120 <symbolic_start+0x20>
mov    $0x1,%al
cmpl   $0x7a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1143 <symbolic_start+0x43>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <symbolic_start+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1143 <symbolic_start+0x43>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<symbolic_start>:
mov    %edi,%eax
and    $0xffffffdf,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
setb   %al
cmp    $0x5f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @symbolic_start(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br i1 %7, label %17, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %17, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 95
br label %17
17: ; preds = %14, %11, %5
%18 = phi i1 [ true, %11 ], [ true, %5 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @symbolic_start(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = icmp eq i32 %0, 95
%6 = or i1 %5, %4
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int strlen(char const *);
int is_sane_path(const char *path) {
  if (strlen(path) > 512)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_sane_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x200,%eax
jle    113c <is_sane_path+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    1143 <is_sane_path+0x33>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sane_path>:
push   %rax
call   1030 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x201,%eax
setl   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_sane_path(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @strlen(i8* %4)
%6 = icmp sgt i32 %5, 512
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %9
8: ; preds = %1
store i32 1, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @is_sane_path(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp slt i32 %2, 513
%4 = zext i1 %3 to i32
ret i32 %4
}
void test2_multi(int x) {
  int buf[100][100];
  buf[0][-1] = 1;
}


x86 assembly (clang, -O0):
<test2_multi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9bd0,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x9c54(%rbp)
add    $0x9bd0,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test2_multi(i32 %0) {
%2 = alloca i32
%3 = alloca [100 x [100 x i32]]
store i32 %0, i32* %2
%4 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %3, i64 0, i64 0
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 -1
store i32 1, i32* %5
ret void
}

LLVM IR (-O2):
define void @test2_multi(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rd_4dim_slice(int *, int, int, int, int, int, int, int, int,
                                 int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void rd_4dim(int *array, int dim1, int dim2, int dim3, int dim4, int shift1,
             int shift2, int shift3, int shift4) {
  rd_4dim_slice(array, dim1, dim2, dim3, dim4, shift1, shift2, shift3, shift4,
                0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<rd_4dim>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x58,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x20(%rbp),%eax
xor    %ebx,%ebx
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x30(%rsp)
call   1030 <rd_4dim_slice@plt>
add    $0x58,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<rd_4dim>:
push   %rax
mov    0x10(%rsp),%r10d
mov    0x18(%rsp),%r11d
mov    0x20(%rsp),%eax
sub    $0x8,%rsp
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   %rax
push   %r11
push   %r10
call   1030 <rd_4dim_slice@plt>
add    $0x40,%rsp
pop    %rax
ret

LLVM IR (-O0):
define void @rd_4dim(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32* %0, i32** %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load i32*, i32** %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = load i32, i32* %15
%25 = load i32, i32* %16
%26 = load i32, i32* %17
%27 = load i32, i32* %18
%28 = call i32 @rd_4dim_slice(i32* %19, i32 %20, i32 %21, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26, i32 %27, i32 0, i32 0, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @rd_4dim(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = tail call i32 @rd_4dim_slice(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 0, i32 0, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_subs_pu16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test48(__m64 a, __m64 b) { return _mm_subs_pu16(a, b); }


x86 assembly (clang, -O0):
<test48>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_subs_pu16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test48>:
jmp    1030 <_mm_subs_pu16@plt>

LLVM IR (-O0):
define i32 @test48(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @_mm_subs_pu16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test48(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_subs_pu16(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int c1, c2;
  c1 = 197, c2 = 198;
  printf("c1=%lc, c2=%lc\n", c1, c2);
  printf("c1=%d, c2=%d\n", c1, c2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc5,-0x8(%rbp)
movl   $0xc6,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec4(%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    $0xc5,%esi
mov    $0xc6,%edx
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0xc5,%esi
mov    $0xc6,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"c1=%lc, c2=%lc\0A\00"
@.str.1 = [14 x i8] c"c1=%d, c2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 197, i32* %2
store i32 198, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"c1=%lc, c2=%lc\0A\00"
@.str.1 = [14 x i8] c"c1=%d, c2=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 197, i32 198)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 197, i32 198)
ret i32 0
}
long bits_needed(unsigned long val) {
  long count = 0;
  while (val != 0) {
    count += 1;
    val = val >> 1;
  }
  return count;
}


x86 assembly (clang, -O0):
<bits_needed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <bits_needed+0x38>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <bits_needed+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_needed>:
xor    %eax,%eax
test   %rdi,%rdi
je     1120 <bits_needed+0x20>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
add    $0x1,%rax
shr    %rcx
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <bits_needed+0x10>
ret

LLVM IR (-O0):
define i64 @bits_needed(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
br label %4
4: ; preds = %7, %1
%5 = load i64, i64* %2
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = load i64, i64* %3
%9 = add nsw i64 %8, 1
store i64 %9, i64* %3
%10 = load i64, i64* %2
%11 = lshr i64 %10, 1
store i64 %11, i64* %2
br label %4
12: ; preds = %4
%13 = load i64, i64* %3
ret i64 %13
}

LLVM IR (-O2):
define i64 @bits_needed(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %6, %3 ], [ 0, %1 ]
%5 = phi i64 [ %7, %3 ], [ %0, %1 ]
%6 = add nuw nsw i64 %4, 1
%7 = lshr i64 %5, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i64 [ 0, %1 ], [ %6, %3 ]
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ eembed_stdout();
int /*<<< orphan*/ eembed_system_fprintf(int /*<<< orphan*/, char *,
                                         char const *);
void eembed_stdout_print(const char *str) {
  eembed_system_fprintf(eembed_stdout(), "%s", str);
}


x86 assembly (clang, -O0):
<eembed_stdout_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <eembed_stdout@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <eembed_system_fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eembed_stdout_print>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <eembed_stdout@plt>
lea    0xece(%rip),%rsi
mov    %eax,%edi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <eembed_system_fprintf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @eembed_stdout_print(i8* %0) {
%2 = tail call i32 (...) @eembed_stdout()
%3 = tail call i32 @eembed_system_fprintf(i32 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int strlen(char *);
int main(int argc, char **argv) { return strlen(argv[0]); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rdi
jmp    1030 <strlen@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = call i32 @strlen(i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @strlen(i8* %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ calculate();
int main(void) { calculate(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <calculate@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <calculate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @calculate()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @calculate()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pr_4630_aux(char *, int *);
int /*<<< orphan*/ pr_4630_aux_2(char *, int *);
int pr_4630(char *a, int y) {
  int x;
  if (y) {
    pr_4630_aux(a, &x);
    return x;
  } else {
    pr_4630_aux_2(a, &x);
    return x;
  }
}


x86 assembly (clang, -O0):
<pr_4630>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1151 <pr_4630+0x31>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <pr_4630_aux@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1164 <pr_4630+0x44>
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <pr_4630_aux_2@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_4630>:
push   %rax
test   %esi,%esi
je     1131 <pr_4630+0x11>
lea    0x4(%rsp),%rsi
call   1030 <pr_4630_aux@plt>
jmp    113b <pr_4630+0x1b>
lea    0x4(%rsp),%rsi
call   1040 <pr_4630_aux_2@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pr_4630(i8* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %1, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @pr_4630_aux(i8* %0, i32* %3)
br label %10
8: ; preds = %2
%9 = call i32 @pr_4630_aux_2(i8* %0, i32* %3)
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %3
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fun(int, int);
int main() { fun(3, 5); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1030 <fun@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @fun(i32 3, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(i32 3, i32 5)
ret i32 0
}
int main() {
  int i = 1;
  return i-- + i++;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 1
store i32 %6, i32* %2
%7 = add nsw i32 %3, %5
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char newChar = 'a' + 2;
  printf("The char 'a'+ 2 is equal to: %c \n", newChar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x63,-0x5(%rbp)
lea    0xed6(%rip),%rdi
movsbl -0x5(%rbp),%esi
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    $0x63,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"The char 'a'+ 2 is equal to: %c \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 99, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"The char 'a'+ 2 is equal to: %c \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8 signext 99)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_TLC;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
int asn1_item_ex_d2i_intern(int /*<<< orphan*/ **, unsigned char const **, long,
                            int /*<<< orphan*/ const *, int, int, char,
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *);
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
                     const ASN1_ITEM *it, int tag, int aclass, char opt,
                     ASN1_TLC *ctx) {
  return asn1_item_ex_d2i_intern(pval, in, len, it, tag, aclass, opt, ctx, NULL,
                                 NULL);
}


x86 assembly (clang, -O0):
<ASN1_item_ex_d2i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
mov    -0x28(%rbp),%r9d
mov    0x10(%rbp),%r10b
mov    0x18(%rbp),%rax
xor    %r11d,%r11d
movsbl %r10b,%r10d
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
call   1030 <asn1_item_ex_d2i_intern@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_item_ex_d2i>:
sub    $0x28,%rsp
movsbl 0x30(%rsp),%eax
mov    0x38(%rsp),%r10
xorps  %xmm0,%xmm0
movups %xmm0,0x10(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,(%rsp)
call   1030 <asn1_item_ex_d2i_intern@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @ASN1_item_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 %4, i32 %5, i8 signext %6, i32* %7) {
%9 = alloca i32**
%10 = alloca i8**
%11 = alloca i64
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8
%16 = alloca i32*
store i32** %0, i32*** %9
store i8** %1, i8*** %10
store i64 %2, i64* %11
store i32* %3, i32** %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8 %6, i8* %15
store i32* %7, i32** %16
%17 = load i32**, i32*** %9
%18 = load i8**, i8*** %10
%19 = load i64, i64* %11
%20 = load i32*, i32** %12
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = load i8, i8* %15
%24 = load i32*, i32** %16
%25 = call i32 @asn1_item_ex_d2i_intern(i32** %17, i8** %18, i64 %19, i32* %20, i32 %21, i32 %22, i8 signext %23, i32* %24, i32* null, i32* null)
ret i32 %25
}

LLVM IR (-O2):
define i32 @ASN1_item_ex_d2i(i32** %0, i8** %1, i64 %2, i32* %3, i32 %4, i32 %5, i8 signext %6, i32* %7) {
%9 = tail call i32 @asn1_item_ex_d2i_intern(i32** %0, i8** %1, i64 %2, i32* %3, i32 %4, i32 %5, i8 signext %6, i32* %7, i32* null, i32* null)
ret i32 %9
}
int _max(int a, int b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @_max(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ write(char *, char *, char *);
void function_real_date_ini(char *ini) {
  write("json-task.json", "\"real-start-date\":\"%s\", ", ini);
}


x86 assembly (clang, -O0):
<function_real_date_ini>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<function_real_date_ini>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
jmp    1030 <write@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [25 x i8] c"\22real-start-date\22:\22%s\22, \00"
define void @function_real_date_ini(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"json-task.json\00"
@.str.1 = [25 x i8] c"\22real-start-date\22:\22%s\22, \00"
define void @function_real_date_ini(i8* %0) {
%2 = tail call i32 @write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
unsigned long _string_hash(const char *str) {
  unsigned long x;
  unsigned long len = 0;
  x = *str << 7;
  while (*str) {
    x = (1000003 * x) ^ *str++;
    len++;
  }
  x ^= len;
  return x;
}


x86 assembly (clang, -O0):
<_string_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
shl    $0x7,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <_string_hash+0x60>
imul   $0xf4243,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbq (%rcx),%rcx
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1120 <_string_hash+0x20>
mov    -0x18(%rbp),%rax
xor    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_string_hash>:
movsbq (%rdi),%rdx
mov    %rdx,%rax
shl    $0x7,%rax
xor    %ecx,%ecx
test   %rdx,%rdx
je     113b <_string_hash+0x3b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
imul   $0xf4243,%rax,%rsi
movsbq %dl,%rax
xor    %rsi,%rax
movzbl 0x1(%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <_string_hash+0x20>
xor    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @_string_hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %4
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = shl i32 %7, 7
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
br label %10
10: ; preds = %14, %1
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i64, i64* %3
%16 = mul i64 1000003, %15
%17 = load i8*, i8** %2
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %2
%19 = load i8, i8* %17
%20 = sext i8 %19 to i64
%21 = xor i64 %16, %20
store i64 %21, i64* %3
%22 = load i64, i64* %4
%23 = add i64 %22, 1
store i64 %23, i64* %4
br label %10
24: ; preds = %10
%25 = load i64, i64* %4
%26 = load i64, i64* %3
%27 = xor i64 %26, %25
store i64 %27, i64* %3
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @_string_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = shl nsw i32 %3, 7
%5 = sext i32 %4 to i64
%6 = icmp eq i8 %2, 0
br i1 %6, label %19, label %7
7: ; preds = %1, %7
%8 = phi i64 [ %16, %7 ], [ 0, %1 ]
%9 = phi i64 [ %15, %7 ], [ %5, %1 ]
%10 = phi i8* [ %13, %7 ], [ %0, %1 ]
%11 = phi i8 [ %17, %7 ], [ %2, %1 ]
%12 = mul i64 %9, 1000003
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = sext i8 %11 to i64
%15 = xor i64 %12, %14
%16 = add i64 %8, 1
%17 = load i8, i8* %13
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %7
19: ; preds = %7, %1
%20 = phi i64 [ %5, %1 ], [ %15, %7 ]
%21 = phi i64 [ 0, %1 ], [ %16, %7 ]
%22 = xor i64 %21, %20
ret i64 %22
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *program_name) {
  printf("Usage: %s [-hq] [--help] [--quiet] [file ...]\n", program_name);
  printf("Check whether input files are valid UTF-8.\n");
  printf("This is version %s.\n", "1.1");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
lea    0xf26(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
lea    0xeea(%rip),%rdi
lea    0xef8(%rip),%rsi
xor    %eax,%eax
pop    %rcx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"Usage: %s [-hq] [--help] [--quiet] [file ...]\0A\00"
@.str.1 = [44 x i8] c"Check whether input files are valid UTF-8.\0A\00"
@.str.2 = [21 x i8] c"This is version %s.\0A\00"
@.str.3 = [4 x i8] c"1.1\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [47 x i8] c"Usage: %s [-hq] [--help] [--quiet] [file ...]\0A\00"
@.str.2 = [21 x i8] c"This is version %s.\0A\00"
@.str.3 = [4 x i8] c"1.1\00"
@str = [43 x i8] c"Check whether input files are valid UTF-8.\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
struct utsname {
  int /*<<< orphan*/ nodename;
};

/* Variables and functions */
int /*<<< orphan*/ SYS_uname;
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int syscall(int /*<<< orphan*/, struct utsname *);
int uname(struct utsname *buf) {
  int ret;
  ret = syscall(SYS_uname, buf);
  strcpy(buf->nodename, "localhost");
  return ret;
}


x86 assembly (clang, -O0):
<uname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1040 <syscall@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uname>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1040 <syscall@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
lea    0xebe(%rip),%rsi
call   1030 <strcpy@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.utsname = type { i32 }
@SYS_uname = global i32 0
@.str = [10 x i8] c"localhost\00"
define i32 @uname(%struct.utsname* %0) {
%2 = alloca %struct.utsname*
%3 = alloca i32
store %struct.utsname* %0, %struct.utsname** %2
%4 = load i32, i32* @SYS_uname
%5 = load %struct.utsname*, %struct.utsname** %2
%6 = call i32 @syscall(i32 %4, %struct.utsname* %5)
store i32 %6, i32* %3
%7 = load %struct.utsname*, %struct.utsname** %2
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @strcpy(i32 %9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
%struct.utsname = type { i32 }
@SYS_uname = global i32 0
@.str = [10 x i8] c"localhost\00"
define i32 @uname(%struct.utsname* %0) {
%2 = load i32, i32* @SYS_uname
%3 = tail call i32 @syscall(i32 %2, %struct.utsname* %0)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %0, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @strcpy(i32 %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
int sys$free(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(12), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$free>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0xc,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$free>:
mov    $0xc,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$free"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 12, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$free"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 12, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int Kit_TruthWordNum(int);
void Kit_TruthClear(unsigned *pOut, int nVars) {
  int w;
  for (w = Kit_TruthWordNum(nVars) - 1; w >= 0; w--)
    pOut[w] = 0;
}


x86 assembly (clang, -O0):
<Kit_TruthClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <Kit_TruthWordNum@plt>
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1154 <Kit_TruthClear+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <Kit_TruthClear+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_TruthClear>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1040 <Kit_TruthWordNum@plt>
test   %eax,%eax
jle    113f <Kit_TruthClear+0x1f>
mov    %eax,%edx
shl    $0x2,%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @Kit_TruthClear(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @Kit_TruthWordNum(i32 %6)
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 0, i32* %16
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @Kit_TruthClear(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @Kit_TruthWordNum(i32 %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = bitcast i32* %0 to i8*
%7 = zext i32 %3 to i64
%8 = shl nuw nsw i64 %7, 2
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
long rul__sql_fetch_setup(char *rse) {
  printf("\n Now in routine rul__sql_fetch_setup ... \n");
  return 1;
}


x86 assembly (clang, -O0):
<rul__sql_fetch_setup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rul__sql_fetch_setup>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0A Now in routine rul__sql_fetch_setup ... \0A\00"
define i64 @rul__sql_fetch_setup(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i64 1
}

LLVM IR (-O2):
@str = [43 x i8] c"\0A Now in routine rul__sql_fetch_setup ... \00"
define i64 @rul__sql_fetch_setup(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
ret i64 1
}
int hmsg(s)
char *s;
{
  int x;
  if ((x = cmcfm()) < 0)
    return (x);
  printf("\n%s\n\n", s);
  return (0);
}


x86 assembly (clang, -O0):
<hmsg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <cmcfm@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    114a <hmsg+0x2a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <hmsg+0x43>
mov    -0x10(%rbp),%rsi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmsg>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <cmcfm@plt>
test   %eax,%eax
js     1147 <hmsg+0x27>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1149 <hmsg+0x29>
mov    %eax,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"\0A%s\0A\0A\00"
define i32 @hmsg(i8* %0) {
%2 = tail call i32 (...) @cmcfm()
%3 = icmp slt i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 0, %4 ], [ %2, %1 ]
ret i32 %7
}