xunge/DecIR huggingface dataset:
IEH3revp(c) char c;
{
  extern char *IEH3outp, *IEH3outlim;
  *IEH3outp++ = c;
  if (IEH3outp > IEH3outlim + 100)
    IEH3err("unprint producing too many chars");
}


x86 assembly (clang, -O0):
<IEH3revp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%cl
mov    0x2ec0(%rip),%rax
mov    (%rax),%rax
mov    %rax,%rsi
add    $0x1,%rsi
mov    0x2eaf(%rip),%rdx
mov    %rsi,(%rdx)
mov    %cl,(%rax)
mov    0x2ea3(%rip),%rax
mov    (%rax),%rax
mov    0x2e89(%rip),%rcx
mov    (%rcx),%rcx
add    $0x64,%rcx
cmp    %rcx,%rax
jbe    116d <IEH3revp+0x5d>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <IEH3err@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IEH3revp>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%rcx
lea    0x1(%rcx),%rdx
mov    %rdx,(%rax)
mov    %dil,(%rcx)
mov    0x2eac(%rip),%rcx
mov    (%rcx),%rcx
add    $0x64,%rcx
cmp    %rcx,(%rax)
jbe    1146 <IEH3revp+0x36>
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <IEH3err@plt>
pop    %rcx
ret

LLVM IR (-O0):
@IEH3outp = external global i8*
@IEH3outlim = external global i8*
@.str = [33 x i8] c"unprint producing too many chars\00"
define i32 @IEH3revp(i32 %0) {
%2 = alloca i32
%3 = alloca i8
%4 = trunc i32 %0 to i8
store i8 %4, i8* %3
%5 = load i8, i8* %3
%6 = load i8*, i8** @IEH3outp
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** @IEH3outp
store i8 %5, i8* %6
%8 = load i8*, i8** @IEH3outp
%9 = load i8*, i8** @IEH3outlim
%10 = getelementptr inbounds i8, i8* %9, i64 100
%11 = icmp ugt i8* %8, %10
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @IEH3err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %1
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@IEH3outp = external global i8*
@IEH3outlim = external global i8*
@.str = [33 x i8] c"unprint producing too many chars\00"
define i32 @IEH3revp(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = load i8*, i8** @IEH3outp
%4 = getelementptr inbounds i8, i8* %3, i64 1
store i8* %4, i8** @IEH3outp
store i8 %2, i8* %3
%5 = load i8*, i8** @IEH3outp
%6 = load i8*, i8** @IEH3outlim
%7 = getelementptr inbounds i8, i8* %6, i64 100
%8 = icmp ugt i8* %5, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @IEH3err to i32 (i8*, ...)*)(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
ret i32 undef
}
void terminate_string(char *line) { *line = '\0'; }


x86 assembly (clang, -O0):
<terminate_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminate_string>:
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @terminate_string(i8* nocapture writeonly %0) {
store i8 0, i8* %0
ret void
}
/* Variables and functions */
size_t strlen(char const *);
void validatedatetime(const char *str) {
  const char *templates[] = {"dddd-dd-dd dd:dd", "dddd-dd-dd"};
  size_t len = strlen(str);
  for (unsigned t = 0; t < 2; t++) {
    if (len != strlen(templates[t])) {
      continue;
    }
  }
}


x86 assembly (clang, -O0):
<validatedatetime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ced(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cea(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jae    118d <validatedatetime+0x7d>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x20(%rbp,%rax,8),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmp    %rcx,%rax
je     117a <validatedatetime+0x6a>
jmp    117f <validatedatetime+0x6f>
jmp    117f <validatedatetime+0x6f>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1146 <validatedatetime+0x36>
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"dddd-dd-dd dd:dd\00"
@.str.1 = [11 x i8] c"dddd-dd-dd\00"
@__const.validatedatetime.templates = [2 x i8*] [i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i32 0, i32 0)]
define void @validatedatetime(i8* %0) {
%2 = alloca i8*
%3 = alloca [2 x i8*]
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %2
%6 = bitcast [2 x i8*]* %3 to i8*
%7 = load i8*, i8** %2
%8 = call i64 @strlen(i8* %7)
store i64 %8, i64* %4
store i32 0, i32* %5
br label %9
9: ; preds = %22, %1
%10 = load i32, i32* %5
%11 = icmp ult i32 %10, 2
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load i64, i64* %4
%14 = load i32, i32* %5
%15 = zext i32 %14 to i64
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* %3, i64 0, i64 %15
%17 = load i8*, i8** %16
%18 = call i64 @strlen(i8* %17)
%19 = icmp ne i64 %13, %18
br i1 %19, label %20, label %21
20: ; preds = %12
br label %22
21: ; preds = %12
br label %22
22: ; preds = %21, %20
%23 = load i32, i32* %5
%24 = add i32 %23, 1
store i32 %24, i32* %5
br label %9
25: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @validatedatetime(i8* nocapture %0) {
ret void
}
int int_hash(const void *data) { return *(int *)data; }


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

x86 assembly (clang, -O2):
<int_hash>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @int_hash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @int_hash(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int qpwrap() { return 1; }


x86 assembly (clang, -O0):
<qpwrap>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @qpwrap() {
ret i32 1
}

LLVM IR (-O2):
define i32 @qpwrap() {
ret i32 1
}
int allTrue(int *array, int length) {
  for (int i = 0; i < length; i++)
    if (!array[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<allTrue>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    114f <allTrue+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    113c <allTrue+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    1156 <allTrue+0x56>
jmp    1141 <allTrue+0x41>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <allTrue+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<allTrue>:
test   %esi,%esi
jle    112b <allTrue+0x2b>
cmpl   $0x0,(%rdi)
je     1131 <allTrue+0x31>
mov    %esi,%ecx
mov    $0x1,%eax
mov    %rax,%rdx
cmp    %rax,%rcx
je     1122 <allTrue+0x22>
lea    0x1(%rdx),%rax
cmpl   $0x0,(%rdi,%rdx,4)
jne    1110 <allTrue+0x10>
xor    %eax,%eax
cmp    %rcx,%rdx
setae  %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @allTrue(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
store i32 0, i32* %6
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32*, i32** %4
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %11
store i32 0, i32* %3
br label %24
19: ; preds = %11
br label %20
20: ; preds = %19
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %7
23: ; preds = %7
store i32 1, i32* %3
br label %24
24: ; preds = %23, %18
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @allTrue(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %20
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
%7 = load i32, i32* %0
%8 = icmp eq i32 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %4, %12
%10 = phi i64 [ %16, %12 ], [ 1, %4 ]
%11 = icmp eq i64 %10, %6
br i1 %11, label %17, label %12
12: ; preds = %9
%13 = getelementptr inbounds i32, i32* %0, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 0
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %17, label %9
17: ; preds = %9, %12
%18 = icmp uge i64 %10, %5
%19 = zext i1 %18 to i32
br label %20
20: ; preds = %17, %4, %2
%21 = phi i32 [ 1, %2 ], [ 0, %4 ], [ %19, %17 ]
ret i32 %21
}
int my_str_tw_is_separator(char c) {
  if ((c < 'a' || c > 'z') && (c < 'A' || c > 'Z') && (c < '0' || c > '9')) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<my_str_tw_is_separator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1124 <my_str_tw_is_separator+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jle    1164 <my_str_tw_is_separator+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     113e <my_str_tw_is_separator+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    1164 <my_str_tw_is_separator+0x64>
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1158 <my_str_tw_is_separator+0x58>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jle    1164 <my_str_tw_is_separator+0x64>
movl   $0x1,-0x4(%rbp)
jmp    116b <my_str_tw_is_separator+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_tw_is_separator>:
lea    -0x7b(%rdi),%eax
cmp    $0xe6,%al
setb   %al
lea    -0x5b(%rdi),%ecx
cmp    $0xe6,%cl
setb   %cl
and    %al,%cl
add    $0xc6,%dil
cmp    $0xf6,%dil
setb   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
define i32 @my_str_tw_is_separator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp slt i32 %5, 97
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sgt i32 %9, 122
br i1 %10, label %11, label %28
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp slt i32 %13, 65
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sgt i32 %17, 90
br i1 %18, label %19, label %28
19: ; preds = %15, %11
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp slt i32 %21, 48
br i1 %22, label %27, label %23
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sgt i32 %25, 57
br i1 %26, label %27, label %28
27: ; preds = %23, %19
store i32 1, i32* %2
br label %29
28: ; preds = %23, %15, %7
store i32 0, i32* %2
br label %29
29: ; preds = %28, %27
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @my_str_tw_is_separator(i8 signext %0) {
%2 = add i8 %0, -123
%3 = icmp ult i8 %2, -26
%4 = add i8 %0, -91
%5 = icmp ult i8 %4, -26
%6 = and i1 %3, %5
%7 = add i8 %0, -58
%8 = icmp ult i8 %7, -10
%9 = and i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
char const *strerror(int);
const char *gp_strerror(int errnum) { return strerror(errnum); }


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

x86 assembly (clang, -O2):
<gp_strerror>:
jmp    1030 <strerror@plt>

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

LLVM IR (-O2):
define i8* @gp_strerror(i32 %0) {
%2 = tail call i8* @strerror(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ play();
int main() {
  play();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @play()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @play()
ret i32 0
}
/* Variables and functions */
int creatsys(char *, int);
volatile int _creat(char *name, int perms) {
  int temp;
  temp = creatsys(name, perms);
  return temp;
}


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

x86 assembly (clang, -O2):
<_creat>:
jmp    1030 <creatsys@plt>

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

LLVM IR (-O2):
define i32 @_creat(i8* %0, i32 %1) {
%3 = tail call i32 @creatsys(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int error_handler(Display *dpy, XErrorEvent *err) {
  fprintf(stderr, "Failed to grab key!\n");
  return 0;
}


x86 assembly (clang, -O0):
<error_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"Failed to grab key!\0A\00"
define i32 @error_handler(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"Failed to grab key!\0A\00"
define i32 @error_handler(i32* nocapture readnone %0, i32* nocapture readnone %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int remap(int all, int turns, int n) {
  int spt = all / turns;
  return (n % spt) * turns + n / spt;
}


x86 assembly (clang, -O0):
<remap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
imul   -0x8(%rbp),%edx
mov    %edx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<remap>:
mov    %edx,%ecx
mov    %edi,%eax
cltd
idiv   %esi
mov    %eax,%edi
mov    %ecx,%eax
cltd
idiv   %edi
imul   %esi,%edx
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @remap(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sdiv i32 %8, %9
store i32 %10, i32* %7
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = srem i32 %11, %12
%14 = load i32, i32* %5
%15 = mul nsw i32 %13, %14
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = sdiv i32 %16, %17
%19 = add nsw i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @remap(i32 %0, i32 %1, i32 %2) {
%4 = sdiv i32 %0, %1
%5 = srem i32 %2, %4
%6 = mul nsw i32 %5, %1
%7 = sdiv i32 %2, %4
%8 = add nsw i32 %6, %7
ret i32 %8
}
int foo(int x, int y, int z) { return (x + y + z) / 3; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
add    %esi,%edi
add    %edx,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = sdiv i32 %11, 3
ret i32 %12
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = sdiv i32 %5, 3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
void strncpy_exact(char *buf, const char *src, size_t buf_len) {
  strncpy(buf, src, buf_len);
}


x86 assembly (clang, -O0):
<strncpy_exact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strncpy_exact>:
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
define void @strncpy_exact(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @strncpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @strncpy_exact(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @strncpy(i8* %0, i8* %1, i64 %2)
ret void
}
int f5(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @f5() {
ret i32 0
}

LLVM IR (-O2):
define i32 @f5() {
ret i32 0
}
int fun711() { return 711; }


x86 assembly (clang, -O0):
<fun711>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2c7,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @fun711() {
ret i32 711
}

LLVM IR (-O2):
define i32 @fun711() {
ret i32 711
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, char const *, struct stat *, int);
int fstatat(int fd, const char *path, struct stat *buf, int flag) {
  return syscall(327, fd, path, buf, flag);
}


x86 assembly (clang, -O0):
<fstatat>:
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),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
mov    $0x147,%edi
call   1030 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fstatat>:
mov    %ecx,%r8d
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x147,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca %struct.stat*
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store %struct.stat* %2, %struct.stat** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load %struct.stat*, %struct.stat** %7
%12 = load i32, i32* %8
%13 = call i32 @syscall(i32 327, i32 %9, i8* %10, %struct.stat* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @fstatat(i32 %0, i8* %1, %struct.stat* %2, i32 %3) {
%5 = tail call i32 @syscall(i32 327, i32 %0, i8* %1, %struct.stat* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ h2o__fatal(char *);
void *realloc(void *, size_t);
void *h2o_mem_realloc(void *oldp, size_t sz) {
  void *newp = realloc(oldp, sz);
  if (newp == NULL) {
    h2o__fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/"
               "heads/master/lib/common/h2o/memory.h"
               ":"
               "318"
               ":"
               "no memory");
    return oldp;
  }
  return newp;
}


x86 assembly (clang, -O0):
<h2o_mem_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1165 <h2o_mem_realloc+0x45>
lea    0xead(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <h2o_mem_realloc+0x4d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h2o_mem_realloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     1130 <h2o_mem_realloc+0x10>
pop    %rbx
ret
lea    0xec9(%rip),%rdi
call   1030 <h2o__fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/heads/master/lib/common/h2o/memory.h:318:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = call i8* @realloc(i8* %7, i64 %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = call i32 @h2o__fatal(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %4
store i8* %14, i8** %3
br label %17
15: ; preds = %2
%16 = load i8*, i8** %6
store i8* %16, i8** %3
br label %17
17: ; preds = %15, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
@.str = [165 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/nkmideb/h2o-server/refs/heads/master/lib/common/h2o/memory.h:318:no memory\00"
define i8* @h2o_mem_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @h2o__fatal(i8* getelementptr inbounds ([165 x i8], [165 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %0, %5 ], [ %3, %2 ]
ret i8* %8
}
void data_abort_pc(void) {}


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

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

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

LLVM IR (-O2):
define void @data_abort_pc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ info_usage(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void info_help(void) {
  info_usage(stdout);
  fputs("Print information about a file and its resource fork.\n"
        "\n"
        "options:\n"
        "  -bytes        display sizes in bytes instead of using prefixes\n",
        stdout);
}


x86 assembly (clang, -O0):
<info_help>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
call   1040 <info_usage@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
lea    0xebe(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<info_help>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
call   1040 <info_usage@plt>
mov    (%rbx),%esi
lea    0xec8(%rip),%rdi
pop    %rbx
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [130 x i8] c"Print information about a file and its resource fork.\0A\0Aoptions:\0A -bytes display sizes in bytes instead of using prefixes\0A\00"
define void @info_help() {
%1 = load i32, i32* @stdout
%2 = call i32 @info_usage(i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @fputs(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [130 x i8] c"Print information about a file and its resource fork.\0A\0Aoptions:\0A -bytes display sizes in bytes instead of using prefixes\0A\00"
define void @info_help() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @info_usage(i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fputs(i8* getelementptr inbounds ([130 x i8], [130 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b();
__attribute__((no)) void a() { b(); }


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

x86 assembly (clang, -O2):
<a>:
xor    %eax,%eax
jmp    1030 <b@plt>

LLVM IR (-O0):
define void @a() {
%1 = call i32 (...) @b()
ret void
}

LLVM IR (-O2):
define void @a() {
%1 = tail call i32 (...) @b()
ret void
}
long scale2(long x, long y, long z) {
  long t = 5 * x + 2 * y + 8 * z;
  return t;
}


x86 assembly (clang, -O0):
<scale2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
imul   $0x5,-0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale2>:
lea    (%rdi,%rdi,4),%rax
lea    (%rax,%rsi,2),%rax
lea    (%rax,%rdx,8),%rax
ret

LLVM IR (-O0):
define i64 @scale2(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = mul nsw i64 5, %8
%10 = load i64, i64* %5
%11 = mul nsw i64 2, %10
%12 = add nsw i64 %9, %11
%13 = load i64, i64* %6
%14 = mul nsw i64 8, %13
%15 = add nsw i64 %12, %14
store i64 %15, i64* %7
%16 = load i64, i64* %7
ret i64 %16
}

LLVM IR (-O2):
define i64 @scale2(i64 %0, i64 %1, i64 %2) {
%4 = mul nsw i64 %0, 5
%5 = shl nsw i64 %1, 1
%6 = add nsw i64 %5, %4
%7 = shl nsw i64 %2, 3
%8 = add nsw i64 %6, %7
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, char);
void print(char src, char dest) { printf("Move %c to %c\n", src, dest); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    -0x1(%rbp),%al
lea    0xed2(%rip),%rdi
movsbl %al,%esi
movsbl -0x2(%rbp),%edx
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [15 x i8] c"Move %c to %c\0A\00"
define void @print(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = load i8, i8* %4
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %5, i8 signext %6)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Move %c to %c\0A\00"
define void @print(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8 signext %0, i8 signext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
void fun() {
  int i;
  for (i = 1; i < 1000; i += 2) {
    __VERIFIER_assert(i < 2000);
  }
  __VERIFIER_assert(i == 1001);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    114e <fun+0x3e>
cmpl   $0x7d0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <fun+0xf>
cmpl   $0x3e9,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    $0x1,%edi
call   1030 <__VERIFIER_assert@plt>
add    $0x2,%ebx
cmp    $0x3e6,%ebx
jb     1120 <fun+0x10>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <__VERIFIER_assert@plt>

LLVM IR (-O0):
define void @fun() {
%1 = alloca i32
store i32 1, i32* %1
br label %2
2: ; preds = %10, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 1000
br i1 %4, label %5, label %13
5: ; preds = %2
%6 = load i32, i32* %1
%7 = icmp slt i32 %6, 2000
%8 = zext i1 %7 to i32
%9 = call i32 @__VERIFIER_assert(i32 %8)
br label %10
10: ; preds = %5
%11 = load i32, i32* %1
%12 = add nsw i32 %11, 2
store i32 %12, i32* %1
br label %2
13: ; preds = %2
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 1001
%16 = zext i1 %15 to i32
%17 = call i32 @__VERIFIER_assert(i32 %16)
ret void
}

LLVM IR (-O2):
define void @fun() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 1, %0 ], [ %4, %1 ]
%3 = tail call i32 @__VERIFIER_assert(i32 1)
%4 = add nuw nsw i32 %2, 2
%5 = icmp ult i32 %2, 998
br i1 %5, label %1, label %6
6: ; preds = %1
%7 = tail call i32 @__VERIFIER_assert(i32 1)
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int d_strcmp(const char *s1, const char *s2) { return strcmp(s1, s2); }


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

x86 assembly (clang, -O2):
<d_strcmp>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @d_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
double sign(double f) { return f > 0 ? 1.0 : f < 0 ? -1.0 : 0.0; }


x86 assembly (clang, -O0):
<sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    112d <sign+0x2d>
movsd  0xee5(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1156 <sign+0x56>
movsd  -0x8(%rbp),%xmm0
movsd  0xec6(%rip),%xmm3
xorps  %xmm2,%xmm2
cmpltsd %xmm2,%xmm0
movaps %xmm0,%xmm1
andpd  %xmm3,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sign>:
xorpd  %xmm1,%xmm1
movapd %xmm0,%xmm2
cmpltsd %xmm1,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
cmpltsd %xmm0,%xmm1
movsd  0xee2(%rip),%xmm0
andpd  %xmm1,%xmm0
andnpd %xmm3,%xmm1
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp ogt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %11
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp olt double %7, 0.000000e+00
%9 = zext i1 %8 to i64
%10 = select i1 %8, double -1.000000e+00, double 0.000000e+00
br label %11
11: ; preds = %6, %5
%12 = phi double [ 1.000000e+00, %5 ], [ %10, %6 ]
ret double %12
}

LLVM IR (-O2):
define double @sign(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = select i1 %3, double -1.000000e+00, double 0.000000e+00
%5 = select i1 %2, double 1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void uninitvar_printf(char *Format, int Argument) {
  char *format;
  int argument;
  (void)printf("x");
  (void)printf(format, argument);
  (void)printf(Format, argument);
  (void)printf(format, Argument);
  (void)printf(format, 1);
  (void)printf(Format, Argument);
}


x86 assembly (clang, -O0):
<uninitvar_printf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uninitvar_printf>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x78,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
define void @uninitvar_printf(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @putchar(i32 120)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) undef, i32 undef)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 undef)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) undef, i32 %1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) undef, i32 1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %0, i32 %1)
ret void
}
void caller_1_1_1_2_1_2_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_1_1_2_1_2_1() {
ret void
}
int id_compare(const void *e1, const void *e2) {
  int v1 = *(int *)e1;
  int v2 = *(int *)e2;
  return (v1 < v2) ? -1 : (v1 > v2) ? 1 : 0;
}


x86 assembly (clang, -O0):
<id_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1137 <id_compare+0x37>
mov    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <id_compare+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id_compare>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @id_compare(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp sgt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ -1, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @id_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp sgt i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void RSA_set_method(void) {}


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

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

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

LLVM IR (-O2):
define void @RSA_set_method() {
ret void
}
/* Variables and functions */
double frexp(double, int *);
double Double_frexp(double x, int *exponent) { return frexp(x, exponent); }


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

x86 assembly (clang, -O2):
<Double_frexp>:
jmp    1030 <frexp@plt>

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

LLVM IR (-O2):
define double @Double_frexp(double %0, i32* nocapture %1) {
%3 = tail call double @frexp(double %0, i32* %1)
ret double %3
}
int deger(char c) {
  if (c >= 'A' && c <= 'Z')
    return c - 'A';
  return c - 'a';
}


x86 assembly (clang, -O0):
<deger>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1133 <deger+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     1133 <deger+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    113d <deger+0x3d>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deger>:
lea    -0x41(%rdi),%eax
xor    %ecx,%ecx
cmp    $0x1a,%al
setb   %cl
shl    $0x5,%ecx
lea    (%rcx,%rdi,1),%eax
add    $0xffffff9f,%eax
ret

LLVM IR (-O0):
define i32 @deger(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 65
store i32 %14, i32* %2
br label %19
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = sub nsw i32 %17, 97
store i32 %18, i32* %2
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @deger(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -65
%4 = icmp ult i8 %3, 26
%5 = select i1 %4, i32 -65, i32 -97
%6 = add nsw i32 %5, %2
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ abort();
float fabsf(float);
void fabd_f(float x, float y, float d) {
  if ((fabsf(x - y) - d) > 0.00001)
    abort();
}


x86 assembly (clang, -O0):
<fabd_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movaps 0xed8(%rip),%xmm1
pand   %xmm1,%xmm0
subss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb3(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    115e <fabd_f+0x4e>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabd_f>:
push   %rax
subss  %xmm1,%xmm0
andps  0xee4(%rip),%xmm0
subss  %xmm2,%xmm0
cvtss2sd %xmm0,%xmm0
ucomisd 0xee4(%rip),%xmm0
ja     1130 <fabd_f+0x20>
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @fabd_f(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fsub float %7, %8
%10 = call float @llvm.fabs.f32(float %9)
%11 = load float, float* %6
%12 = fsub float %10, %11
%13 = fpext float %12 to double
%14 = fcmp ogt double %13, 1.000000e-05
br i1 %14, label %15, label %17
15: ; preds = %3
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @fabd_f(float %0, float %1, float %2) {
%4 = fsub float %0, %1
%5 = tail call float @llvm.fabs.f32(float %4)
%6 = fsub float %5, %2
%7 = fpext float %6 to double
%8 = fcmp ogt double %7, 1.000000e-05
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @abort()
unreachable
11: ; preds = %3
ret void
}
void RTEnvQueryUtf16Block(void) {}


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

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

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

LLVM IR (-O2):
define void @RTEnvQueryUtf16Block() {
ret void
}
/* Variables and functions */
int sum_divisors(int);
int sum_proper_divisors(int n) { return sum_divisors(n) - n; }


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

x86 assembly (clang, -O2):
<sum_proper_divisors>:
push   %rbx
mov    %edi,%ebx
call   1030 <sum_divisors@plt>
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @sum_proper_divisors(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sum_divisors(i32 %3)
%5 = load i32, i32* %2
%6 = sub nsw i32 %4, %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @sum_proper_divisors(i32 %0) {
%2 = tail call i32 @sum_divisors(i32 %0)
%3 = sub nsw i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double volumeCilindro(int, int);
main() {
  printf("O volume de um cilindro circular com raio = 5 e altura igual 3 eh: "
         "%0.4f",
         volumeCilindro(5, 3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x5,%edi
mov    $0x3,%esi
call   1030 <volumeCilindro@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [73 x i8] c"O volume de um cilindro circular com raio = 5 e altura igual 3 eh: %0.4f\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call double @volumeCilindro(i32 5, i32 3)
%3 = call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), double %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [73 x i8] c"O volume de um cilindro circular com raio = 5 e altura igual 3 eh: %0.4f\00"
define i32 @main() {
%1 = tail call double @volumeCilindro(i32 5, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void allocArgRegs(int count) {}


x86 assembly (clang, -O0):
<allocArgRegs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @allocArgRegs(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int ts_y_origin;
};
typedef TYPE_1__ XGCValues;

/* Variables and functions */
void set_XGCValues_ts_y_origin(void *_p, int _v) {
  ((XGCValues *)_p)->ts_y_origin = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGCValues_ts_y_origin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGCValues_ts_y_origin>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGCValues_ts_y_origin(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGCValues_ts_y_origin(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
void gfx_delay_microseconds(unsigned long microseconds) {
  unsigned long loop_count = microseconds * 150;
  while (loop_count-- > 0) {
    ;
  }
}


x86 assembly (clang, -O0):
<gfx_delay_microseconds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x96,-0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
jbe    1132 <gfx_delay_microseconds+0x32>
jmp    1114 <gfx_delay_microseconds+0x14>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @gfx_delay_microseconds(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = mul i64 %4, 150
store i64 %5, i64* %3
br label %6
6: ; preds = %10, %1
%7 = load i64, i64* %3
%8 = add i64 %7, -1
store i64 %8, i64* %3
%9 = icmp ugt i64 %7, 0
br i1 %9, label %10, label %11
10: ; preds = %6
br label %6
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @gfx_delay_microseconds(i64 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
void real_32_to_c(float r) { printf("%f\n", r); }


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

x86 assembly (clang, -O2):
<real_32_to_c>:
lea    0xee9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define void @real_32_to_c(float %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), float %0)
ret void
}