xunge/DecIR huggingface dataset:
/* Variables and functions */
int EXIT_SUCCESS;
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char str[] = "Take a walk on the wild side";
  char *p;
  p = malloc(sizeof(*p));
  p = str;
  printf("%s\n", p);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x18(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x14(%rbp)
mov    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xef2(%rip),%xmm0
movups %xmm0,0xd(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeeb(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [29 x i8] c"Take a walk on the wild side\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [29 x i8]
%3 = alloca i8*
store i32 0, i32* %1
%4 = bitcast [29 x i8]* %2 to i8*
%5 = call i8* @malloc(i32 1)
store i8* %5, i8** %3
%6 = getelementptr inbounds [29 x i8], [29 x i8]* %2, i64 0, i64 0
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32, i32* @EXIT_SUCCESS
ret i32 %9
}

LLVM IR (-O2):
@__const.main.str = [29 x i8] c"Take a walk on the wild side\00"
@.str = [4 x i8] c"%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [29 x i8]
%2 = getelementptr inbounds [29 x i8], [29 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i32, i32* @EXIT_SUCCESS
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ const uint8_t;

/* Variables and functions */
uint8_t
hfp_subevent_audio_connection_established_get_status(const uint8_t *event) {
  return event[3];
}


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

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

LLVM IR (-O0):
define i32 @hfp_subevent_audio_connection_established_get_status(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 3
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @hfp_subevent_audio_connection_established_get_status(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 3
%3 = load i32, i32* %2
ret i32 %3
}
int float_lt_xxxx(int a, int b) {
  if (a < 0) {
    a = 0x80000000u - a;
  }
  if (b < 0) {
    b = 0x80000000u - b;
  }
  return a < b;
}


x86 assembly (clang, -O0):
<float_lt_xxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111f <float_lt_xxxx+0x1f>
mov    $0x80000000,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1134 <float_lt_xxxx+0x34>
mov    $0x80000000,%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<float_lt_xxxx>:
mov    $0x80000000,%ecx
mov    $0x80000000,%edx
sub    %edi,%edx
test   %edi,%edi
cmovns %edi,%edx
sub    %esi,%ecx
test   %esi,%esi
cmovns %esi,%ecx
xor    %eax,%eax
cmp    %ecx,%edx
setl   %al
ret

LLVM IR (-O0):
define i32 @float_lt_xxxx(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 = icmp slt i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %3
%9 = sub i32 -2147483648, %8
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %2
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sub i32 -2147483648, %14
store i32 %15, i32* %4
br label %16
16: ; preds = %13, %10
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @float_lt_xxxx(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
%4 = sub i32 -2147483648, %0
%5 = select i1 %3, i32 %4, i32 %0
%6 = icmp slt i32 %1, 0
%7 = sub i32 -2147483648, %1
%8 = select i1 %6, i32 %7, i32 %1
%9 = icmp slt i32 %5, %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int);
void print_sample(unsigned sample, unsigned tl) {
  if (sample % 10000 == 0) {
    printf("[%10u] %10u\n", sample, tl);
  }
}


x86 assembly (clang, -O0):
<print_sample>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2710,%ecx
xor    %edx,%edx
div    %ecx
cmp    $0x0,%edx
jne    1145 <print_sample+0x35>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_sample>:
imul   $0x3afb7e91,%edi,%eax
ror    $0x4,%eax
cmp    $0x68db8,%eax
jbe    1121 <print_sample+0x11>
ret
mov    %esi,%edx
mov    %edi,%esi
lea    0xed4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"[%10u] %10u\0A\00"
define void @print_sample(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 = urem i32 %5, 10000
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
br label %12
12: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"[%10u] %10u\0A\00"
define void @print_sample(i32 %0, i32 %1) {
%3 = urem i32 %0, 10000
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void make_dir(char *module_name) {
  char dir_name[256];
  sprintf(dir_name, "%s/%s", "./", module_name);
  printf("Make dir %s \n", dir_name);
  mkdir(dir_name, 0755);
}


x86 assembly (clang, -O0):
<make_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xeaf(%rip),%rsi
lea    0xeae(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x110(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_dir>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rcx
lea    0xebe(%rip),%rsi
lea    0xebd(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
lea    0xeae(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    $0x1ed,%esi
call   1030 <mkdir@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [3 x i8] c"./\00"
@.str.2 = [14 x i8] c"Make dir %s \0A\00"
define void @make_dir(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @mkdir(i8* %9, i32 493)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s/%s\00"
@.str.1 = [3 x i8] c"./\00"
@.str.2 = [14 x i8] c"Make dir %s \0A\00"
define void @make_dir(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%6 = call i32 @mkdir(i8* %3, i32 493)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *);
int phStopSoundFile() {
  char reqbuf[16];
  snprintf(reqbuf, sizeof(reqbuf), "PLSTOP");
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phStopSoundFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x10,%esi
lea    0xec8(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x10(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phStopSoundFile>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"PLSTOP\00"
define i32 @phStopSoundFile() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%5 = call i32 @ph_rpc(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
@.str = [7 x i8] c"PLSTOP\00"
define i32 @phStopSoundFile() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @snprintf(i8* %2, i32 16, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @ph_rpc(i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gmvwrite_subvars_header();
void fgmvwrite_subvars_header_() { gmvwrite_subvars_header(); }


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

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

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

LLVM IR (-O2):
define void @fgmvwrite_subvars_header_() {
%1 = tail call i32 (...) @gmvwrite_subvars_header()
ret void
}
/* Variables and functions */
int _close(int);
int /*<<< orphan*/ socket_clear(int);
int close(int fd) {
  socket_clear(fd);
  return _close(fd);
}


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

x86 assembly (clang, -O2):
<close>:
push   %rbx
mov    %edi,%ebx
call   1030 <socket_clear@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <_close@plt>

LLVM IR (-O0):
define i32 @close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @socket_clear(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @_close(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @close(i32 %0) {
%2 = tail call i32 @socket_clear(i32 %0)
%3 = tail call i32 @_close(i32 %0)
ret i32 %3
}
/* Variables and functions */
scalar_t__ strlen(char *);
int is_mvd_name(char *fname) { return strlen(fname) > 0 && fname[0] == '%'; }


x86 assembly (clang, -O0):
<is_mvd_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
jle    1147 <is_mvd_name+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x25,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_mvd_name>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
jle    1128 <is_mvd_name+0x18>
xor    %eax,%eax
cmpb   $0x25,(%rbx)
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_mvd_name(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 37
br label %12
12: ; preds = %6, %1
%13 = phi i1 [ false, %1 ], [ %11, %6 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @is_mvd_name(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp sgt i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 37
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int athTxStart(char *);
int athTxSineStart() { return athTxStart("sine"); }


x86 assembly (clang, -O0):
<athTxSineStart>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <athTxStart@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [5 x i8] c"sine\00"
define i32 @athTxSineStart() {
%1 = call i32 @athTxStart(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [5 x i8] c"sine\00"
define i32 @athTxSineStart() {
%1 = tail call i32 @athTxStart(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
void close_msg(int f) {
  if (close(f) == -1)
    fprintf(stderr, "Failed to close file descriptor %d: %s\n", f,
            strerror(errno));
}


x86 assembly (clang, -O0):
<close_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1181 <close_msg+0x51>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    %rax,%rcx
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_msg>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     1146 <close_msg+0x16>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e93(%rip),%rax
mov    (%rax),%ebp
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xe9c(%rip),%rsi
mov    %ebp,%edi
mov    %ebx,%edx
mov    %rax,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [40 x i8] c"Failed to close file descriptor %d: %s\0A\00"
@errno = global i32 0
define void @close_msg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @close(i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* %2
%9 = load i32, i32* @errno
%10 = call i8* @strerror(i32 %9)
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %8, i8* %10)
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [40 x i8] c"Failed to close file descriptor %d: %s\0A\00"
@errno = global i32 0
define void @close_msg(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = load i32, i32* @errno
%7 = tail call i8* @strerror(i32 %6)
%8 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %7)
br label %9
9: ; preds = %4, %1
ret void
}
/* Type definitions */
struct mntent {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
char *hasmntopt(const struct mntent *mnt, const char *opt) {
  ;
  errno = ENOSYS;
  return NULL;
  ;
}


x86 assembly (clang, -O0):
<hasmntopt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hasmntopt>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.mntent = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define i8* @hasmntopt(%struct.mntent* %0, i8* %1) {
%3 = alloca %struct.mntent*
%4 = alloca i8*
store %struct.mntent* %0, %struct.mntent** %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOSYS
store i32 %5, i32* @errno
ret i8* null
}

LLVM IR (-O2):
%struct.mntent = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias i8* @hasmntopt(%struct.mntent* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ fail();
int /*<<< orphan*/ message(int, char const *, char *);
void fatal_enomem(const char *fname) {
  message(3, fname, ("cannot find enough memory"));
  fail();
}


x86 assembly (clang, -O0):
<fatal_enomem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x3,%edi
lea    0xec4(%rip),%rdx
call   1030 <message@plt>
mov    $0x0,%al
call   1040 <fail@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fatal_enomem>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdx
mov    $0x3,%edi
call   1030 <message@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <fail@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"cannot find enough memory\00"
define void @fatal_enomem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @message(i32 3, i8* %3, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @fail()
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"cannot find enough memory\00"
define void @fatal_enomem(i8* %0) {
%2 = tail call i32 @message(i32 3, i8* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @fail()
ret void
}
void chk_msg(const char *msg) { (void)msg; }


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

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

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

LLVM IR (-O2):
define void @chk_msg(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char const *ERR_getErrorName(size_t);
const char *HUF_getErrorName(size_t code) { return ERR_getErrorName(code); }


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

x86 assembly (clang, -O2):
<HUF_getErrorName>:
jmp    1030 <ERR_getErrorName@plt>

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

LLVM IR (-O2):
define i8* @HUF_getErrorName(i64 %0) {
%2 = tail call i8* @ERR_getErrorName(i64 %0)
ret i8* %2
}
unsigned char f32(unsigned char x, long int y) {
  return (x >> ((-y) & (8 * sizeof(unsigned char) - 1))) ^ (x << y);
}


x86 assembly (clang, -O0):
<f32>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
sar    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f32>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shr    %cl,%eax
mov    %esi,%ecx
shl    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f32(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 0, %7
%9 = and i64 %8, 7
%10 = trunc i64 %9 to i32
%11 = ashr i32 %6, %10
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = shl i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f32(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 7
%7 = lshr i32 %3, %6
%8 = shl i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
int interpolate(int y0, int y1, int y2, int x) {
  return y1 + (x < 50 ? y1 - y0 : y2 - y1) * (x - 50) / 50;
}


x86 assembly (clang, -O0):
<interpolate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x32,-0x10(%rbp)
jge    112e <interpolate+0x2e>
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1137 <interpolate+0x37>
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x32,%ecx
imul   %ecx,%eax
mov    $0x32,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpolate>:
mov    %esi,%eax
sub    %edi,%eax
sub    %esi,%edx
cmp    $0x32,%ecx
cmovl  %eax,%edx
add    $0xffffffce,%ecx
imul   %edx,%ecx
movslq %ecx,%rax
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x24,%rax
add    %ecx,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @interpolate(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %16
12: ; preds = %4
%13 = load i32, i32* %6
%14 = load i32, i32* %5
%15 = sub nsw i32 %13, %14
br label %20
16: ; preds = %4
%17 = load i32, i32* %7
%18 = load i32, i32* %6
%19 = sub nsw i32 %17, %18
br label %20
20: ; preds = %16, %12
%21 = phi i32 [ %15, %12 ], [ %19, %16 ]
%22 = load i32, i32* %8
%23 = sub nsw i32 %22, 50
%24 = mul nsw i32 %21, %23
%25 = sdiv i32 %24, 50
%26 = add nsw i32 %9, %25
ret i32 %26
}

LLVM IR (-O2):
define i32 @interpolate(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, 50
%6 = sub nsw i32 %1, %0
%7 = sub nsw i32 %2, %1
%8 = select i1 %5, i32 %6, i32 %7
%9 = add nsw i32 %3, -50
%10 = mul nsw i32 %8, %9
%11 = sdiv i32 %10, 50
%12 = add nsw i32 %11, %1
ret i32 %12
}
void foo_2_2_2_1_2_1_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_1_1_2_2() {
ret void
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("current process id: %d\n", getpid());
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"current process id: %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"current process id: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int am_hal_clkgen_sysclk_get();
int /*<<< orphan*/ am_hal_flash_delay(int);
void am_util_delay_ms(uint32_t ui32MilliSeconds) {
  uint32_t ui32Loops = ui32MilliSeconds * (am_hal_clkgen_sysclk_get() / 3000);
  am_hal_flash_delay(ui32Loops);
}


x86 assembly (clang, -O0):
<am_util_delay_ms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <am_hal_clkgen_sysclk_get@plt>
mov    $0xbb8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <am_hal_flash_delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<am_util_delay_ms>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <am_hal_clkgen_sysclk_get@plt>
cltq
imul   $0x57619f1,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
imul   %eax,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <am_hal_flash_delay@plt>

LLVM IR (-O0):
define void @am_util_delay_ms(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 (...) @am_hal_clkgen_sysclk_get()
%6 = sdiv i32 %5, 3000
%7 = mul nsw i32 %4, %6
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i32 @am_hal_flash_delay(i32 %8)
ret void
}

LLVM IR (-O2):
define void @am_util_delay_ms(i32 %0) {
%2 = tail call i32 (...) @am_hal_clkgen_sysclk_get()
%3 = sdiv i32 %2, 3000
%4 = mul nsw i32 %3, %0
%5 = tail call i32 @am_hal_flash_delay(i32 %4)
ret void
}
int DivRounded(int a, int b) {
  return a >= 0 ? (a + b / 2) / b : (a - b / 2) / b;
}


x86 assembly (clang, -O0):
<DivRounded>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1138 <DivRounded+0x38>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
jmp    1157 <DivRounded+0x57>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<DivRounded>:
mov    %edi,%eax
not    %eax
shr    $0x1f,%eax
lea    -0x2(,%rax,4),%ecx
mov    %esi,%eax
cltd
idiv   %ecx
add    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @DivRounded(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 = icmp sge i32 %5, 0
br i1 %6, label %7, label %14
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sdiv i32 %9, 2
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %4
%13 = sdiv i32 %11, %12
br label %21
14: ; preds = %2
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sdiv i32 %16, 2
%18 = sub nsw i32 %15, %17
%19 = load i32, i32* %4
%20 = sdiv i32 %18, %19
br label %21
21: ; preds = %14, %7
%22 = phi i32 [ %13, %7 ], [ %20, %14 ]
ret i32 %22
}

LLVM IR (-O2):
define i32 @DivRounded(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, -1
%4 = select i1 %3, i32 2, i32 -2
%5 = sdiv i32 %1, %4
%6 = add i32 %5, %0
%7 = sdiv i32 %6, %1
ret i32 %7
}
void t2(void) {}


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

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

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

LLVM IR (-O2):
define void @t2() {
ret void
}
/* Variables and functions */
long long hash31(long long, long long, long long);
long fourwise(long long a, long long b, long long c, long long d, long long x) {
  long long result;
  long lresult;
  result = hash31(hash31(hash31(x, a, b), x, c), x, d);
  lresult = (long)result;
  return lresult;
}


x86 assembly (clang, -O0):
<fourwise>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <hash31@plt>
mov    %rax,%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <hash31@plt>
mov    %rax,%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <hash31@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourwise>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%rbx
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    %r8,%rdi
call   1030 <hash31@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
call   1030 <hash31@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <hash31@plt>

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

LLVM IR (-O2):
define i64 @fourwise(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4) {
%6 = tail call i64 @hash31(i64 %4, i64 %0, i64 %1)
%7 = tail call i64 @hash31(i64 %6, i64 %4, i64 %2)
%8 = tail call i64 @hash31(i64 %7, i64 %4, i64 %3)
ret i64 %8
}
/* Variables and functions */
int fn_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(
    char const *);
int fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(
    const char *text) {
  int pos = 0;
  pos =
      fn_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(
          text);
  if (pos != -1)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     1144 <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121+0x34>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121+0x3b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121>:
jmp    1030 <fn_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121@plt>

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

LLVM IR (-O2):
define i32 @fn_al_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(i8* %0) {
%2 = tail call i32 @fn_sq_ch_68_ch_97_ch_116_ch_97_ch_80_ch_114_ch_111_ch_112_ch_101_ch_114_ch_116_ch_121(i8* %0)
ret i32 %2
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t gca_roundup64(uint64_t x) {
  return (--x, x |= x >> 1, x |= x >> 2, x |= x >> 4, x |= x >> 8, x |= x >> 16,
          x |= x >> 32, ++x);
}


x86 assembly (clang, -O0):
<gca_roundup64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x2,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @gca_roundup64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, -1
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 2
%11 = load i32, i32* %2
%12 = or i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = ashr i32 %13, 4
%15 = load i32, i32* %2
%16 = or i32 %15, %14
store i32 %16, i32* %2
%17 = load i32, i32* %2
%18 = ashr i32 %17, 8
%19 = load i32, i32* %2
%20 = or i32 %19, %18
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = ashr i32 %21, 16
%23 = load i32, i32* %2
%24 = or i32 %23, %22
store i32 %24, i32* %2
%25 = load i32, i32* %2
%26 = ashr i32 %25, 32
%27 = load i32, i32* %2
%28 = or i32 %27, %26
store i32 %28, i32* %2
%29 = load i32, i32* %2
%30 = add nsw i32 %29, 1
store i32 %30, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @gca_roundup64(i32 %0) {
ret i32 poison
}
int __attribute__((target("arch=sandybridge,sse4.2"))) mangle(void) {
  return 2;
}


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

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

LLVM IR (-O0):
define i32 @mangle() {
ret i32 2
}

LLVM IR (-O2):
define i32 @mangle() {
ret i32 2
}
int int_cmp(const void *a, const void *b) {
  int aa = *((int *)a);
  int bb = *((int *)b);
  return aa - bb;
}


x86 assembly (clang, -O0):
<int_cmp>:
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
sub    -0x18(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @int_cmp(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 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @int_cmp(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 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ set_aux_carry_flag(int);
void handle_aux_carry_flag_add(const int value1, const int value2) {
  set_aux_carry_flag(((value1 & 0xF) + (value2 & 0xF)) > 0xF);
}


x86 assembly (clang, -O0):
<handle_aux_carry_flag_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
cmp    $0xf,%eax
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <set_aux_carry_flag@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_aux_carry_flag_add>:
and    $0xf,%edi
and    $0xf,%esi
add    %edi,%esi
xor    %edi,%edi
cmp    $0x10,%esi
setae  %dil
jmp    1030 <set_aux_carry_flag@plt>

LLVM IR (-O0):
define void @handle_aux_carry_flag_add(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 = and i32 %5, 15
%7 = load i32, i32* %4
%8 = and i32 %7, 15
%9 = add nsw i32 %6, %8
%10 = icmp sgt i32 %9, 15
%11 = zext i1 %10 to i32
%12 = call i32 @set_aux_carry_flag(i32 %11)
ret void
}

LLVM IR (-O2):
define void @handle_aux_carry_flag_add(i32 %0, i32 %1) {
%3 = and i32 %0, 15
%4 = and i32 %1, 15
%5 = add nuw nsw i32 %4, %3
%6 = icmp ugt i32 %5, 15
%7 = zext i1 %6 to i32
%8 = tail call i32 @set_aux_carry_flag(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
void add(char *ptr_out, char *ptr_in1, size_t len_in1, char *ptr_in2,
         size_t len_in2) {
  memcpy(ptr_out, ptr_in1, len_in1);
  ptr_out += len_in1;
  memcpy(ptr_out, ptr_in2, len_in2);
  ptr_out += len_in2;
  *ptr_out = '\n';
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0xa,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rdi,%rbx
call   1030 <memcpy@plt>
add    %r12,%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1030 <memcpy@plt>
movb   $0xa,(%r15,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @add(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4) {
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
%7 = getelementptr inbounds i8, i8* %0, i64 %2
%8 = tail call i32 @memcpy(i8* %7, i8* %3, i64 %4)
%9 = getelementptr inbounds i8, i8* %7, i64 %4
store i8 10, i8* %9
ret void
}
/* Variables and functions */
int strlen(char const *);
int strspn(char const *, char *);
int rend_valid_service_id(const char *query) {
  if (strlen(query) != 16)
    return 0;
  if (strspn(query, "abcdefghijklmnopqrstuvwxyz234567") != 16)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<rend_valid_service_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x10,%eax
je     114a <rend_valid_service_id+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1176 <rend_valid_service_id+0x56>
mov    -0x10(%rbp),%rdi
lea    0xeab(%rip),%rsi
call   1040 <strspn@plt>
cmp    $0x10,%eax
je     116f <rend_valid_service_id+0x4f>
movl   $0x0,-0x4(%rbp)
jmp    1176 <rend_valid_service_id+0x56>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rend_valid_service_id>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
jne    114b <rend_valid_service_id+0x2b>
lea    0xec7(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strspn@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x10,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"abcdefghijklmnopqrstuvwxyz234567\00"
define i32 @rend_valid_service_id(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 ne i32 %5, 16
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i32 @strspn(i8* %9, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%11 = icmp ne i32 %10, 16
br i1 %11, label %12, label %13
12: ; preds = %8
store i32 0, i32* %2
br label %14
13: ; preds = %8
store i32 1, i32* %2
br label %14
14: ; preds = %13, %12, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@.str = [33 x i8] c"abcdefghijklmnopqrstuvwxyz234567\00"
define i32 @rend_valid_service_id(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 16
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @strspn(i8* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 16
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *buf = realloc(ptr, size);
  assert(buf != NULL);
  return buf;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1040 <realloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %5
ret i8* %13
}

LLVM IR (-O2):
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
ret i8* %3
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local2;
  unsigned short local1;
  {
    state[0UL] = input[0UL] + (unsigned short)2885;
    local1 = 0UL;
    while (local1 < 1UL) {
      local2 = 0UL;
      while (local2 < 1UL) {
        local2 += 2UL;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] * 371143069UL - (unsigned short)23309;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0xb45,%eax
mov    %ax,-0x12(%rbp)
movw   $0x0,-0x16(%rbp)
movzwl -0x16(%rbp),%eax
cmp    $0x1,%rax
jae    1166 <RandomFunc+0x66>
movw   $0x0,-0x14(%rbp)
movzwl -0x14(%rbp),%eax
cmp    $0x1,%rax
jae    1155 <RandomFunc+0x55>
movzwl -0x14(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x14(%rbp)
jmp    1136 <RandomFunc+0x36>
movzwl -0x16(%rbp),%eax
add    $0x2,%rax
mov    %ax,-0x16(%rbp)
jmp    1122 <RandomFunc+0x22>
movzwl -0x12(%rbp),%eax
imul   $0x161f319d,%rax,%rax
sub    $0x5b0d,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
imul   $0x319d,%eax,%eax
add    $0xffffc344,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
%6 = alloca i16
%7 = alloca i16
store i16* %0, i16** %3
store i16* %1, i16** %4
%8 = load i16*, i16** %3
%9 = getelementptr inbounds i16, i16* %8, i64 0
%10 = load i16, i16* %9
%11 = zext i16 %10 to i32
%12 = add nsw i32 %11, 2885
%13 = trunc i32 %12 to i16
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %13, i16* %14
store i16 0, i16* %7
br label %15
15: ; preds = %29, %2
%16 = load i16, i16* %7
%17 = zext i16 %16 to i64
%18 = icmp ult i64 %17, 1
br i1 %18, label %19, label %34
19: ; preds = %15
store i16 0, i16* %6
br label %20
20: ; preds = %24, %19
%21 = load i16, i16* %6
%22 = zext i16 %21 to i64
%23 = icmp ult i64 %22, 1
br i1 %23, label %24, label %29
24: ; preds = %20
%25 = load i16, i16* %6
%26 = zext i16 %25 to i64
%27 = add i64 %26, 2
%28 = trunc i64 %27 to i16
store i16 %28, i16* %6
br label %20
29: ; preds = %20
%30 = load i16, i16* %7
%31 = zext i16 %30 to i64
%32 = add i64 %31, 2
%33 = trunc i64 %32 to i16
store i16 %33, i16* %7
br label %15
34: ; preds = %15
%35 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%36 = load i16, i16* %35
%37 = zext i16 %36 to i64
%38 = mul i64 %37, 371143069
%39 = sub i64 %38, 23309
%40 = trunc i64 %39 to i16
%41 = load i16*, i16** %4
%42 = getelementptr inbounds i16, i16* %41, i64 0
store i16 %40, i16* %42
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = mul i16 %3, 12701
%5 = add i16 %4, -15548
store i16 %5, i16* %1
ret void
}