xunge/DecIR huggingface dataset:
/* Variables and functions */
int strlen(char *);
int COM_Compress(char *data_p) { return strlen(data_p); }


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

x86 assembly (clang, -O2):
<COM_Compress>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define i32 @COM_Compress(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
ret i32 %2
}
/* Variables and functions */
int core12_swap(char *, int);
int U_EMRCREATEDIBPATTERNBRUSHPT_swap(char *record, int torev) {
  return (core12_swap(record, torev));
}


x86 assembly (clang, -O0):
<U_EMRCREATEDIBPATTERNBRUSHPT_swap>:
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 <core12_swap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U_EMRCREATEDIBPATTERNBRUSHPT_swap>:
jmp    1030 <core12_swap@plt>

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

LLVM IR (-O2):
define i32 @U_EMRCREATEDIBPATTERNBRUSHPT_swap(i8* %0, i32 %1) {
%3 = tail call i32 @core12_swap(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct aparams {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ aparams_enctostr(struct aparams *, char *);
int /*<<< orphan*/ log_puts(char *);
void aparams_log(struct aparams *par) {
  char enc[10];
  aparams_enctostr(par, enc);
  log_puts(enc);
}


x86 assembly (clang, -O0):
<aparams_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rsi
call   1040 <aparams_enctostr@plt>
lea    -0x12(%rbp),%rdi
call   1030 <log_puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aparams_log>:
push   %rbx
sub    $0x10,%rsp
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <aparams_enctostr@plt>
mov    %rbx,%rdi
call   1030 <log_puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.aparams = type { i32 }
define void @aparams_log(%struct.aparams* %0) {
%2 = alloca %struct.aparams*
%3 = alloca [10 x i8]
store %struct.aparams* %0, %struct.aparams** %2
%4 = load %struct.aparams*, %struct.aparams** %2
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @aparams_enctostr(%struct.aparams* %4, i8* %5)
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call i32 @log_puts(i8* %7)
ret void
}

LLVM IR (-O2):
%struct.aparams = type { i32 }
define void @aparams_log(%struct.aparams* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @aparams_enctostr(%struct.aparams* %0, i8* %3)
%5 = call i32 @log_puts(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ nexterrorline();
char *strchr(char const *, char);
void advanceline(char const *line) {
  char const *p;
  for (p = line - 1; p; p = strchr(p + 1, '\n'))
    nexterrorline();
}


x86 assembly (clang, -O0):
<advanceline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <advanceline+0x45>
mov    $0x0,%al
call   1040 <nexterrorline@plt>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
jmp    1138 <advanceline+0x18>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<advanceline>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <nexterrorline@plt>
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <strchr@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1130 <advanceline+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @advanceline(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 -1
store i8* %5, i8** %3
br label %6
6: ; preds = %11, %1
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = call i32 (...) @nexterrorline()
br label %11
11: ; preds = %9
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = call i8* @strchr(i8* %13, i8 signext 10)
store i8* %14, i8** %3
br label %6
15: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @advanceline(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -1
br label %3
3: ; preds = %1, %3
%4 = phi i8* [ %2, %1 ], [ %7, %3 ]
%5 = tail call i32 (...) @nexterrorline()
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = tail call i8* @strchr(i8* %6, i8 signext 10)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %3
9: ; preds = %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ jmp();
int /*<<< orphan*/ set();
int main() {
  set();
  jmp();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @set()
%2 = tail call i32 (...) @jmp()
ret i32 0
}
void os_set_font(int x) {}


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

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

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

LLVM IR (-O2):
define void @os_set_font(i32 %0) {
ret void
}
void av_frame_get_sample_rate() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_get_sample_rate() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(char *prog) {
  fprintf(stderr, "Usage: rangesort -i inputfile -o outputfile -l lowvalue "
                  "-h highvalue\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: rangesort -i inputfile -o outputfile -l lowvalue -h highvalue\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"Usage: rangesort -i inputfile -o outputfile -l lowvalue -h highvalue\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct evhttp_connection {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ evhttp_connection_reset(struct evhttp_connection *);
void evhttp_detect_close_cb(int fd, short what, void *arg) {
  struct evhttp_connection *evcon = arg;
  evhttp_connection_reset(evcon);
}


x86 assembly (clang, -O0):
<evhttp_detect_close_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <evhttp_connection_reset@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evhttp_detect_close_cb>:
mov    %rdx,%rdi
jmp    1030 <evhttp_connection_reset@plt>

LLVM IR (-O0):
%struct.evhttp_connection = type { i32 }
define void @evhttp_detect_close_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.evhttp_connection*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%8 = load i8*, i8** %6
%9 = bitcast i8* %8 to %struct.evhttp_connection*
store %struct.evhttp_connection* %9, %struct.evhttp_connection** %7
%10 = load %struct.evhttp_connection*, %struct.evhttp_connection** %7
%11 = call i32 @evhttp_connection_reset(%struct.evhttp_connection* %10)
ret void
}

LLVM IR (-O2):
%struct.evhttp_connection = type { i32 }
define void @evhttp_detect_close_cb(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.evhttp_connection*
%5 = tail call i32 @evhttp_connection_reset(%struct.evhttp_connection* %4)
ret void
}
/* Variables and functions */
void *malloc(size_t);
void *m1(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<m1>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @m1(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
char *malloc(size_t);
size_t malloc_usable_size(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, size_t);
int main(void) {
  size_t len = 21;
  size_t size;
  char *buf;
  buf = malloc(len);
  if (!buf) {
    perror("malloc");
    return -1;
  }
  size = malloc_usable_size(buf);
  printf("size %zu\n", size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x15,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1187 <main+0x47>
lea    0xe8a(%rip),%rdi
call   1060 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11a4 <main+0x64>
mov    -0x20(%rbp),%rdi
call   1040 <malloc_usable_size@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x15,%edi
call   1050 <malloc@plt>
test   %rax,%rax
je     116b <main+0x2b>
mov    %rax,%rdi
call   1040 <malloc_usable_size@plt>
lea    0xea8(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret
lea    0xe8e(%rip),%rdi
call   1060 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
@.str.1 = [10 x i8] c"size %zu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i8*
store i32 0, i32* %1
store i64 21, i64* %2
%5 = load i64, i64* %2
%6 = call i8* @malloc(i64 %5)
store i8* %6, i8** %4
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %0
%10 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %16
11: ; preds = %0
%12 = load i8*, i8** %4
%13 = call i64 @malloc_usable_size(i8* %12)
store i64 %13, i64* %3
%14 = load i64, i64* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %14)
br label %16
16: ; preds = %11, %9
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
@.str.1 = [10 x i8] c"size %zu\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(21) i8* @malloc(i64 21)
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %8
5: ; preds = %0
%6 = tail call i64 @malloc_usable_size(i8* %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i64 %6)
br label %8
8: ; preds = %5, %3
%9 = phi i32 [ 0, %5 ], [ -1, %3 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("\nUsage: truncate [-s size] FILENAME\n\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"\0AUsage: truncate [-s size] FILENAME\0A\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [37 x i8] c"\0AUsage: truncate [-s size] FILENAME\0A\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void main() {
  int i = 0;
  for (i = 0; i < 256; i++)
    printf("%d %c\n", i, i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x100,-0x4(%rbp)
jge    1153 <main+0x43>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1126 <main+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %c\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int sum_square_difference_1(int);
int sum_square_difference_2(int);
int main() {
  int temp1 = sum_square_difference_1(100);
  int temp2 = sum_square_difference_2(100);
  printf("%d %d\n", temp1, temp2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1050 <sum_square_difference_1@plt>
mov    %eax,-0x8(%rbp)
mov    $0x64,%edi
call   1030 <sum_square_difference_2@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x64,%edi
call   1050 <sum_square_difference_1@plt>
mov    %eax,%ebx
mov    $0x64,%edi
call   1030 <sum_square_difference_2@plt>
lea    0xeb2(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum_square_difference_1(i32 100)
%2 = tail call i32 @sum_square_difference_2(i32 100)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret i32 0
}
void foo077() {}


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

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

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

LLVM IR (-O2):
define void @foo077() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void debug_append_to_file(char *fname, char *msg) {
  FILE *f_to_append = fopen(fname, "at");
  fprintf(f_to_append, "[INFO] %s", msg);
  fclose(f_to_append);
}


x86 assembly (clang, -O0):
<debug_append_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea0(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_append_to_file>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeb6(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"at\00"
@.str.1 = [10 x i8] c"[INFO] %s\00"
define void @debug_append_to_file(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i8*, i8** %4
%10 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"at\00"
@.str.1 = [10 x i8] c"[INFO] %s\00"
define void @debug_append_to_file(i8* nocapture %0, i8* %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
int am_getconfig_float(const char *path, float *value) { return -1; }


x86 assembly (clang, -O0):
<am_getconfig_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @am_getconfig_float(i8* %0, float* %1) {
%3 = alloca i8*
%4 = alloca float*
store i8* %0, i8** %3
store float* %1, float** %4
ret i32 -1
}

LLVM IR (-O2):
define i32 @am_getconfig_float(i8* nocapture readnone %0, float* nocapture readnone %1) {
ret i32 -1
}
int NumLength(int Num) {
  int Len = 1;
  if (Num < 0) {
    Len++;
    Num = -Num;
  }
  while (Num / 10 > 0) {
    Len++;
    Num = Num / 10;
  }
  return (Len);
}


x86 assembly (clang, -O0):
<NumLength>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1129 <NumLength+0x29>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    112e <NumLength+0x2e>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
jle    115e <NumLength+0x5e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    112e <NumLength+0x2e>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NumLength>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
add    $0x1,%eax
cmp    $0xa,%ecx
jb     1134 <NumLength+0x34>
mov    $0xcccccccd,%edx
nopl   0x0(%rax)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x63,%ecx
mov    %esi,%ecx
ja     1120 <NumLength+0x20>
ret

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

LLVM IR (-O2):
define i32 @NumLength(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = sub nsw i32 0, %0
%4 = select i1 %2, i32 %3, i32 %0
%5 = select i1 %2, i32 2, i32 1
%6 = icmp ugt i32 %4, 9
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = phi i32 [ %10, %7 ], [ %4, %1 ]
%10 = udiv i32 %9, 10
%11 = add nuw nsw i32 %8, 1
%12 = icmp ugt i32 %9, 99
br i1 %12, label %7, label %13
13: ; preds = %7, %1
%14 = phi i32 [ %5, %1 ], [ %11, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ end_test();
int /*<<< orphan*/ start_test(char *);
void test_subtract_values() {
  start_test("subtract_values");
  assert((1 / (1.0 / 8 - 1.0 / 16)) == 16);
  assert((1 / (1.0 / 4 - 1.0 / 8)) == 8);
  assert((1 / (1.0 / 2 - 1.0 / 4)) == 4);
  end_test();
}


x86 assembly (clang, -O0):
<test_subtract_values>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <start_test@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <end_test@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_subtract_values>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <start_test@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
mov    $0x1,%edi
call   1050 <assert@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <end_test@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"subtract_values\00"
define void @test_subtract_values() {
%1 = call i32 @start_test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @assert(i32 1)
%3 = call i32 @assert(i32 1)
%4 = call i32 @assert(i32 1)
%5 = call i32 (...) @end_test()
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"subtract_values\00"
define void @test_subtract_values() {
%1 = tail call i32 @start_test(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 (...) @end_test()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpd_epi32(int /*<<< orphan*/);
__m128i test_mm_cvtpd_epi32(__m128d A) { return _mm_cvtpd_epi32(A); }


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

x86 assembly (clang, -O2):
<test_mm_cvtpd_epi32>:
jmp    1030 <_mm_cvtpd_epi32@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtpd_epi32(i32 %0) {
%2 = tail call i32 @_mm_cvtpd_epi32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ _vWriteFormat(char, int);
void _vWriteError(char c) { _vWriteFormat(c, 0xC0 | 0x0F); }


x86 assembly (clang, -O0):
<_vWriteError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xcf,%esi
movsbl -0x1(%rbp),%edi
call   1030 <_vWriteFormat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_vWriteError>:
mov    $0xcf,%esi
jmp    1030 <_vWriteFormat@plt>

LLVM IR (-O0):
define void @_vWriteError(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @_vWriteFormat(i8 signext %3, i32 207)
ret void
}

LLVM IR (-O2):
define void @_vWriteError(i8 signext %0) {
%2 = tail call i32 @_vWriteFormat(i8 signext %0, i32 207)
ret void
}
/* Variables and functions */
size_t bits_to_bytes(size_t size) { return (size + 8 - 1) / 8; }


x86 assembly (clang, -O0):
<bits_to_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
sub    $0x1,%rax
shr    $0x3,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bits_to_bytes>:
lea    0x7(%rdi),%rax
shr    $0x3,%rax
ret

LLVM IR (-O0):
define i64 @bits_to_bytes(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 8
%5 = sub i64 %4, 1
%6 = udiv i64 %5, 8
ret i64 %6
}

LLVM IR (-O2):
define i64 @bits_to_bytes(i64 %0) {
%2 = add i64 %0, 7
%3 = lshr i64 %2, 3
ret i64 %3
}
void emit_float64(struct processor_explicatory_state *process_state,
                  struct modern_stream *stream, void *stream_state,
                  struct modern_vfile *vfile, void *vfile_state) {}


x86 assembly (clang, -O0):
<emit_float64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_float64(%struct.processor_explicatory_state* %0, %struct.modern_stream* %1, i8* %2, %struct.modern_vfile* %3, i8* %4) {
%6 = alloca %struct.processor_explicatory_state*
%7 = alloca %struct.modern_stream*
%8 = alloca i8*
%9 = alloca %struct.modern_vfile*
%10 = alloca i8*
store %struct.processor_explicatory_state* %0, %struct.processor_explicatory_state** %6
store %struct.modern_stream* %1, %struct.modern_stream** %7
store i8* %2, i8** %8
store %struct.modern_vfile* %3, %struct.modern_vfile** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
%struct.processor_explicatory_state = type opaque
%struct.modern_stream = type opaque
%struct.modern_vfile = type opaque
define void @emit_float64(%struct.processor_explicatory_state* nocapture %0, %struct.modern_stream* nocapture %1, i8* nocapture %2, %struct.modern_vfile* nocapture %3, i8* nocapture %4) {
ret void
}
int fun702() { return 702; }


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

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

LLVM IR (-O0):
define i32 @fun702() {
ret i32 702
}

LLVM IR (-O2):
define i32 @fun702() {
ret i32 702
}
/* Type definitions */
struct timeval {
  int tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ sleep(struct timeval *);
int main(int argc, char *argv[]) {
  struct timeval tv;
  tv.tv_sec = 0;
  tv.tv_usec = 5000;
  sleep(&tv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x1388,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movq   $0x0,0x10(%rsp)
movl   $0x1388,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to i8*
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 1
store i64 0, i64* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
store i32 5000, i32* %6
%7 = call i32 @sleep(%struct.timeval* %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ getheight();
int gethei_() { return ((int)getheight()); }


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

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

LLVM IR (-O0):
define i32 @gethei_() {
%1 = call i64 (...) @getheight()
%2 = trunc i64 %1 to i32
ret i32 %2
}

LLVM IR (-O2):
define i32 @gethei_() {
%1 = tail call i64 (...) @getheight()
%2 = trunc i64 %1 to i32
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int PROT_READ;
int PROT_WRITE;
int dag_attach_stream_protection(int, int, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int);
int dag_attach_stream(int dagfd, int stream_num, uint32_t flags,
                      uint32_t extra_window_size) {
  return dag_attach_stream_protection(
      dagfd, stream_num, flags, extra_window_size, PROT_READ | PROT_WRITE);
}


x86 assembly (clang, -O0):
<dag_attach_stream>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2ec1(%rip),%rax
mov    (%rax),%r8d
mov    0x2e97(%rip),%rax
or     (%rax),%r8d
call   1030 <dag_attach_stream_protection@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dag_attach_stream>:
mov    0x2ee1(%rip),%r9
mov    0x2eba(%rip),%rax
mov    (%rax),%r8d
or     (%r9),%r8d
jmp    1030 <dag_attach_stream_protection@plt>

LLVM IR (-O0):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define i32 @dag_attach_stream(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* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* @PROT_READ
%14 = load i32, i32* @PROT_WRITE
%15 = or i32 %13, %14
%16 = call i32 @dag_attach_stream_protection(i32 %9, i32 %10, i32 %11, i32 %12, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define i32 @dag_attach_stream(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = load i32, i32* @PROT_READ
%6 = load i32, i32* @PROT_WRITE
%7 = or i32 %6, %5
%8 = tail call i32 @dag_attach_stream_protection(i32 %0, i32 %1, i32 %2, i32 %3, i32 %7)
ret i32 %8
}
/* Variables and functions */
unsigned long __cmpxchg(void volatile *, unsigned long, unsigned long, int);
int /*<<< orphan*/ smp_mb();
unsigned long __cmpxchg_mb(volatile void *ptr, unsigned long old,
                           unsigned long new, int size) {
  unsigned long ret;
  smp_mb();
  ret = __cmpxchg(ptr, old, new, size);
  smp_mb();
  return ret;
}


x86 assembly (clang, -O0):
<__cmpxchg_mb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <smp_mb@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <__cmpxchg@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <smp_mb@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cmpxchg_mb>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <smp_mb@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <__cmpxchg@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <smp_mb@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i64 @__cmpxchg_mb(i8* %0, i64 %1, i64 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%10 = call i32 (...) @smp_mb()
%11 = load i8*, i8** %5
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = load i32, i32* %8
%15 = call i64 @__cmpxchg(i8* %11, i64 %12, i64 %13, i32 %14)
store i64 %15, i64* %9
%16 = call i32 (...) @smp_mb()
%17 = load i64, i64* %9
ret i64 %17
}

LLVM IR (-O2):
define i64 @__cmpxchg_mb(i8* %0, i64 %1, i64 %2, i32 %3) {
%5 = tail call i32 (...) @smp_mb()
%6 = tail call i64 @__cmpxchg(i8* %0, i64 %1, i64 %2, i32 %3)
%7 = tail call i32 (...) @smp_mb()
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ UUT(unsigned char *);
long long cpucycles();
void __attribute__((no))
measure_helper(int n, unsigned char *buf, long long *cycles) {
  for (int i = 0; i <= n; ++i) {
    cycles[i] = cpucycles();
    UUT(buf);
  }
}


x86 assembly (clang, -O0):
<measure_helper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1173 <measure_helper+0x53>
mov    $0x0,%al
call   1030 <cpucycles@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rdi
call   1040 <UUT@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113a <measure_helper+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measure_helper>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
js     115c <measure_helper+0x3c>
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r12d
add    $0x1,%r12d
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <cpucycles@plt>
mov    %rax,(%r14,%rbx,8)
mov    %r15,%rdi
call   1040 <UUT@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <measure_helper+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @measure_helper(i32 %0, i8* %1, i64* nocapture writeonly %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = add nuw i32 %0, 1
%7 = zext i32 %6 to i64
br label %9
8: ; preds = %9, %3
ret void
9: ; preds = %5, %9
%10 = phi i64 [ 0, %5 ], [ %14, %9 ]
%11 = tail call i64 (...) @cpucycles()
%12 = getelementptr inbounds i64, i64* %2, i64 %10
store i64 %11, i64* %12
%13 = tail call i32 @UUT(i8* %1)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %7
br i1 %15, label %8, label %9
}
/* Variables and functions */
double rndgamma(double);
int rndpoisson(double);
int rndNegBinomial(double shape, double mean) {
  return (rndpoisson(rndgamma(shape) / shape * mean));
}


x86 assembly (clang, -O0):
<rndNegBinomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <rndgamma@plt>
divsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1030 <rndpoisson@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rndNegBinomial>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <rndgamma@plt>
divsd  0x8(%rsp),%xmm0
mulsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
jmp    1030 <rndpoisson@plt>

LLVM IR (-O0):
define i32 @rndNegBinomial(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call double @rndgamma(double %5)
%7 = load double, double* %3
%8 = fdiv double %6, %7
%9 = load double, double* %4
%10 = fmul double %8, %9
%11 = call i32 @rndpoisson(double %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @rndNegBinomial(double %0, double %1) {
%3 = tail call double @rndgamma(double %0)
%4 = fdiv double %3, %0
%5 = fmul double %4, %1
%6 = tail call i32 @rndpoisson(double %5)
ret i32 %6
}
/* Variables and functions */
double pow(double, double);
double decay_shake(double shake, double time) {
  return (shake <= 0.1 ? 0.0 : shake * pow(0.1, time));
}


x86 assembly (clang, -O0):
<decay_shake>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xed6(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     1142 <decay_shake+0x32>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    116f <decay_shake+0x5f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xea7(%rip),%xmm0
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decay_shake>:
push   %rax
movapd %xmm0,%xmm3
xorpd  %xmm0,%xmm0
movsd  0xedf(%rip),%xmm2
ucomisd %xmm3,%xmm2
jae    113e <decay_shake+0x2e>
movsd  0xed1(%rip),%xmm0
movsd  %xmm3,(%rsp)
call   1030 <pow@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @decay_shake(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp ole double %5, 1.000000e-01
br i1 %6, label %7, label %8
7: ; preds = %2
br label %13
8: ; preds = %2
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call double @pow(double 1.000000e-01, double %10)
%12 = fmul double %9, %11
br label %13
13: ; preds = %8, %7
%14 = phi double [ 0.000000e+00, %7 ], [ %12, %8 ]
ret double %14
}

LLVM IR (-O2):
define double @decay_shake(double %0, double %1) {
%3 = fcmp ugt double %0, 1.000000e-01
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call double @pow(double 1.000000e-01, double %1)
%6 = fmul double %5, %0
br label %7
7: ; preds = %2, %4
%8 = phi double [ %6, %4 ], [ 0.000000e+00, %2 ]
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ bar(int);
void foo(int i) {
  if (!i)
    bar(0);
  else {
    static int varz = 5;
    goto f1;
  }
  bar(1);
f1:
  bar(2);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1131 <foo+0x21>
xor    %edi,%edi
call   1030 <bar@plt>
jmp    1136 <foo+0x26>
jmp    1140 <foo+0x30>
mov    $0x1,%edi
call   1030 <bar@plt>
mov    $0x2,%edi
call   1030 <bar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
je     111e <foo+0xe>
mov    $0x2,%edi
jmp    1030 <bar@plt>
push   %rax
xor    %edi,%edi
call   1030 <bar@plt>
mov    $0x1,%edi
call   1030 <bar@plt>
add    $0x8,%rsp
mov    $0x2,%edi
jmp    1030 <bar@plt>

LLVM IR (-O0):
@foo.varz = internal global i32 5
define void @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 @bar(i32 0)
br label %8
7: ; preds = %1
br label %10
8: ; preds = %5
%9 = call i32 @bar(i32 1)
br label %10
10: ; preds = %8, %7
%11 = call i32 @bar(i32 2)
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @bar(i32 0)
%5 = tail call i32 @bar(i32 1)
br label %6
6: ; preds = %1, %3
%7 = tail call i32 @bar(i32 2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int O_CREAT;
int O_TRUNC;
int O_WRONLY;
int open(char const *, int, int /*<<< orphan*/);
int creat(const char *filename, mode_t mode) {
  return open(filename, O_CREAT | O_WRONLY | O_TRUNC, mode);
}


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    0x2ece(%rip),%rax
mov    (%rax),%esi
mov    0x2e95(%rip),%rax
or     (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
mov    -0xc(%rbp),%edx
call   1030 <open@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creat>:
mov    0x2ee1(%rip),%rcx
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
or     (%rcx),%eax
mov    %esi,%edx
mov    0x2ec5(%rip),%rcx
or     (%rcx),%eax
mov    %eax,%esi
jmp    1030 <open@plt>

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_WRONLY
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = load i32, i32* %4
%12 = call i32 @open(i8* %5, i32 %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
define i32 @creat(i8* nocapture %0, i32 %1) {
%3 = load i32, i32* @O_CREAT
%4 = load i32, i32* @O_WRONLY
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* %0, i32 %7, i32 %1)
ret i32 %8
}
int isgraph(int c) {
  if (c >= 33 && c <= 126)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x21,-0x8(%rbp)
jl     1127 <isgraph+0x27>
cmpl   $0x7e,-0x8(%rbp)
jg     1127 <isgraph+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isgraph+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isgraph(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 33
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
char *hash_plugin_detailed(void) {
  return ("django256 - Django SHA-256 plugin\n"
          "------------------------\n"
          "Use this module to crack Django SHA-256 passwords\n"
          "Input should be in form: \'user:hash\' or just \'hash\'\n"
          "Known software that uses this password hashing method:\n"
          "Django\n"
          "\nAuthor: Milen Rangelov <gat3way@gat3way.eu>\n");
}


x86 assembly (clang, -O0):
<hash_plugin_detailed>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_plugin_detailed>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [269 x i8] c"django256 - Django SHA-256 plugin\0A------------------------\0AUse this module to crack Django SHA-256 passwords\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0ADjango\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [269 x i8] c"django256 - Django SHA-256 plugin\0A------------------------\0AUse this module to crack Django SHA-256 passwords\0AInput should be in form: 'user:hash' or just 'hash'\0AKnown software that uses this password hashing method:\0ADjango\0A\0AAuthor: Milen Rangelov <gat3way@gat3way.eu>\0A\00"
define i8* @hash_plugin_detailed() {
ret i8* getelementptr inbounds ([269 x i8], [269 x i8]* @.str, i64 0, i64 0)
}
int gcd(int n1, int n2) {
  if (n2 > 0) {
    gcd(n2, n1 % n2);
  } else
    return n1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113e <gcd+0x2e>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd@plt>
jmp    1144 <gcd+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %esi,%esi
jle    111b <gcd+0x1b>
mov    %esi,%edx
mov    %edi,%eax
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 returned %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp sgt i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %2
ret i32 %0
}