xunge/DecIR huggingface dataset:
int alloc_re(x, m, n)
char **x;
unsigned int m;
unsigned int n;
{
  char *y;
  y = alloc(n);
  if (!y)
    return 0;
  byte_copy(y, m, *x);
  alloc_free(*x);
  *x = y;
  return 1;
}


x86 assembly (clang, -O0):
<alloc_re>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    $0x0,%al
call   1040 <alloc@plt>
cltq
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1169 <alloc_re+0x39>
movl   $0x0,-0x4(%rbp)
jmp    119e <alloc_re+0x6e>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    $0x0,%al
call   1050 <byte_copy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1030 <alloc_free@plt>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_re>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %ebp,%ebp
mov    %edx,%edi
xor    %eax,%eax
call   1040 <alloc@plt>
test   %eax,%eax
je     116e <alloc_re+0x3e>
movslq %eax,%rbp
mov    (%rbx),%rdx
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <byte_copy@plt>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1030 <alloc_free@plt>
mov    %rbp,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @alloc_re(i8** %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%9 = load i32, i32* %7
%10 = call i32 (i32, ...) bitcast (i32 (...)* @alloc to i32 (i32, ...)*)(i32 %9)
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
store i8* %12, i8** %8
%13 = load i8*, i8** %8
%14 = icmp ne i8* %13, null
br i1 %14, label %16, label %15
15: ; preds = %3
store i32 0, i32* %4
br label %27
16: ; preds = %3
%17 = load i8*, i8** %8
%18 = load i32, i32* %6
%19 = load i8**, i8*** %5
%20 = load i8*, i8** %19
%21 = call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @byte_copy to i32 (i8*, i32, i8*, ...)*)(i8* %17, i32 %18, i8* %20)
%22 = load i8**, i8*** %5
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @alloc_free to i32 (i8*, ...)*)(i8* %23)
%25 = load i8*, i8** %8
%26 = load i8**, i8*** %5
store i8* %25, i8** %26
store i32 1, i32* %4
br label %27
27: ; preds = %16, %15
%28 = load i32, i32* %4
ret i32 %28
}

LLVM IR (-O2):
define i32 @alloc_re(i8** nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @alloc to i32 (i32, ...)*)(i32 %2)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = icmp eq i32 %4, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = load i8*, i8** %0
%10 = tail call i32 (i8*, i32, i8*, ...) bitcast (i32 (...)* @byte_copy to i32 (i8*, i32, i8*, ...)*)(i8* %6, i32 %1, i8* %9)
%11 = load i8*, i8** %0
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @alloc_free to i32 (i8*, ...)*)(i8* %11)
store i8* %6, i8** %0
br label %13
13: ; preds = %3, %8
%14 = phi i32 [ 1, %8 ], [ 0, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void stop(void) { printf("dummy audio stopped\n"); }


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"dummy audio stopped\0A\00"
define void @stop() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [20 x i8] c"dummy audio stopped\00"
define void @stop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret void
}
int fun_si32(int a, int b) { return a; }


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

x86 assembly (clang, -O2):
<fun_si32>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @fun_si32(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
ret i32 %5
}

LLVM IR (-O2):
define i32 @fun_si32(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Variables and functions */
scalar_t__ beq();
int /*<<< orphan*/ jsr_inc16();
int /*<<< orphan*/ jsr_inc_pointer();
int /*<<< orphan*/ lda(int, int);
int /*<<< orphan*/ ldx(int /*<<< orphan*/, int);
int /*<<< orphan*/ sta(int, int);
void jsr_strcat() {
strcat_loop:
  lda(2, 0xf8);
  sta(2, 0xfc);
  if (beq())
    goto strcat_done;
  ldx(0, 0xf8);
  jsr_inc16();
  jsr_inc_pointer();
  goto strcat_loop;
strcat_done:;
}


x86 assembly (clang, -O0):
<jsr_strcat>:
push   %rbp
mov    %rsp,%rbp
jmp    1169 <jsr_strcat+0x9>
mov    $0x2,%edi
mov    $0xf8,%esi
call   1080 <lda@plt>
mov    $0x2,%edi
mov    $0xfc,%esi
call   1030 <sta@plt>
mov    $0x0,%al
call   1040 <beq@plt>
cmp    $0x0,%rax
je     119d <jsr_strcat+0x3d>
jmp    11bc <jsr_strcat+0x5c>
xor    %edi,%edi
mov    $0xf8,%esi
call   1060 <ldx@plt>
mov    $0x0,%al
call   1050 <jsr_inc16@plt>
mov    $0x0,%al
call   1070 <jsr_inc_pointer@plt>
jmp    1169 <jsr_strcat+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<jsr_strcat>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x2,%edi
mov    $0xf8,%esi
call   1080 <lda@plt>
mov    $0x2,%edi
mov    $0xfc,%esi
call   1030 <sta@plt>
xor    %eax,%eax
call   1040 <beq@plt>
test   %rax,%rax
jne    11b6 <jsr_strcat+0x56>
xor    %edi,%edi
mov    $0xf8,%esi
call   1060 <ldx@plt>
xor    %eax,%eax
call   1050 <jsr_inc16@plt>
xor    %eax,%eax
call   1070 <jsr_inc_pointer@plt>
jmp    1170 <jsr_strcat+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @jsr_strcat() {
br label %1
1: ; preds = %7, %0
%2 = call i32 @lda(i32 2, i32 248)
%3 = call i32 @sta(i32 2, i32 252)
%4 = call i64 (...) @beq()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %11
7: ; preds = %1
%8 = call i32 @ldx(i32 0, i32 248)
%9 = call i32 (...) @jsr_inc16()
%10 = call i32 (...) @jsr_inc_pointer()
br label %1
11: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @jsr_strcat() {
%1 = tail call i32 @lda(i32 2, i32 248)
%2 = tail call i32 @sta(i32 2, i32 252)
%3 = tail call i64 (...) @beq()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %5
%6 = tail call i32 @ldx(i32 0, i32 248)
%7 = tail call i32 (...) @jsr_inc16()
%8 = tail call i32 (...) @jsr_inc_pointer()
%9 = tail call i32 @lda(i32 2, i32 248)
%10 = tail call i32 @sta(i32 2, i32 252)
%11 = tail call i64 (...) @beq()
%12 = icmp eq i64 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void swap(void *a, void *b, void *buf, size_t element_size) {
  memcpy(buf, b, element_size);
  memcpy(b, a, element_size);
  memcpy(a, buf, element_size);
}


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

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

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %2, i8* %1, i64 %3)
%6 = tail call i32 @memcpy(i8* %1, i8* %0, i64 %3)
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i64 %3)
ret void
}
/* Type definitions */
struct tm {
  int tm_sec;
  int tm_min;
  int tm_hour;
  int tm_mday;
  int tm_mon;
  int tm_year;
  int tm_wday;
};

/* Variables and functions */
int /*<<< orphan*/ asctime(struct tm *);
int /*<<< orphan*/ puts(int /*<<< orphan*/);
int main() {
  struct tm t;
  t.tm_sec = 10;
  t.tm_min = 10;
  t.tm_hour = 6;
  t.tm_mday = 25;
  t.tm_mon = 2;
  t.tm_year = 89;
  t.tm_wday = 6;
  puts(asctime(&t));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x20(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x6,-0x18(%rbp)
movl   $0x19,-0x14(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x59,-0xc(%rbp)
movl   $0x6,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <asctime@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x5900000002,%rax
mov    %rax,0x10(%rsp)
movl   $0x6,0x18(%rsp)
mov    %rsp,%rdi
call   1040 <asctime@plt>
mov    %eax,%edi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 0
store i32 10, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 1
store i32 10, i32* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 2
store i32 6, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 3
store i32 25, i32* %6
%7 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 4
store i32 2, i32* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 5
store i32 89, i32* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %2, i32 0, i32 6
store i32 6, i32* %9
%10 = call i32 @asctime(%struct.tm* %2)
%11 = call i32 @puts(i32 %10)
ret i32 0
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i32, i32 }
define i32 @main() {
%1 = alloca %struct.tm
%2 = bitcast %struct.tm* %1 to i8*
%3 = bitcast %struct.tm* %1 to <4 x i32>*
store <4 x i32> <i32 10, i32 10, i32 6, i32 25>, <4 x i32>* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 4
store i32 2, i32* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 5
store i32 89, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 6
store i32 6, i32* %6
%7 = call i32 @asctime(%struct.tm* %1)
%8 = call i32 @puts(i32 %7)
ret i32 0
}
void handle_59(int sig) {}


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

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

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

LLVM IR (-O2):
define void @handle_59(i32 %0) {
ret void
}
void *memset5(void *s, int c) { return __builtin_memset(s, c, 512); }


x86 assembly (clang, -O0):
<memset5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    %rdi,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x200,%edx
movzbl %al,%esi
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset5>:
mov    $0x200,%edx
jmp    1030 <memset@plt>

LLVM IR (-O0):
define i8* @memset5(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 = trunc i32 %6 to i8
ret i8* %5
}

LLVM IR (-O2):
define i8* @memset5(i8* returned writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
tail call void @llvm.memset.p0i8.i64(i8* align 1 dereferenceable(512) %0, i8 %3, i64 512, i1 false)
ret i8* %0
}
/* Type definitions */
struct hashmap {
  int dummy;
};

/* Variables and functions */
scalar_t__ hashmap_get(struct hashmap *, void *);
int hashmap_exists(struct hashmap *hm, void *key) {
  return hashmap_get(hm, key) != 0;
}


x86 assembly (clang, -O0):
<hashmap_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hashmap_get@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_exists>:
push   %rax
call   1030 <hashmap_get@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.hashmap = type { i32 }
define i32 @hashmap_exists(%struct.hashmap* %0, i8* %1) {
%3 = alloca %struct.hashmap*
%4 = alloca i8*
store %struct.hashmap* %0, %struct.hashmap** %3
store i8* %1, i8** %4
%5 = load %struct.hashmap*, %struct.hashmap** %3
%6 = load i8*, i8** %4
%7 = call i64 @hashmap_get(%struct.hashmap* %5, i8* %6)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.hashmap = type { i32 }
define i32 @hashmap_exists(%struct.hashmap* %0, i8* %1) {
%3 = tail call i64 @hashmap_get(%struct.hashmap* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned char *sha384_buffer(unsigned char *, unsigned char const *, size_t);
unsigned char *hash_buffer_sha384(unsigned char *out, const unsigned char *in,
                                  size_t in_len) {
  return sha384_buffer(out, in, in_len);
}


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

x86 assembly (clang, -O2):
<hash_buffer_sha384>:
jmp    1030 <sha384_buffer@plt>

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

LLVM IR (-O2):
define i8* @hash_buffer_sha384(i8* %0, i8* %1, i64 %2) {
%4 = tail call i8* @sha384_buffer(i8* %0, i8* %1, i64 %2)
ret i8* %4
}
int sort_int(const void *a, const void *b) {
  long *a1, *b1;
  a1 = (long *)a;
  b1 = (long *)b;
  return (*a1 > *b1);
}


x86 assembly (clang, -O0):
<sort_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort_int>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmp    (%rsi),%rcx
setg   %al
ret

LLVM IR (-O0):
define i32 @sort_int(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
store i64* %8, i64** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i64*
store i64* %10, i64** %6
%11 = load i64*, i64** %5
%12 = load i64, i64* %11
%13 = load i64*, i64** %6
%14 = load i64, i64* %13
%15 = icmp sgt i64 %12, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @sort_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = bitcast i8* %1 to i64*
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp sgt i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
double __math_check_oflow(double);
double check_oflow(double x) { return 0 ? __math_check_oflow(x) : x; }


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

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

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

LLVM IR (-O2):
define double @check_oflow(double returned %0) {
ret double %0
}
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t max_s64(int64_t a, int64_t b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<max_s64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <max_s64+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <max_s64+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_s64>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @max_s64(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int test_imm_1Auint32_reg(unsigned int val) {
  return ((val) & (0x1A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Auint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x1a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Auint32_reg>:
test   $0x1a,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Auint32_reg(i32 %0) {
%2 = and i32 %0, 26
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct stream {
  int dummy;
};
struct rdp_iso {
  int dummy;
};

/* Variables and functions */
scalar_t__ rdp_iso_recv_msg(struct rdp_iso *, struct stream *, int *);
int rdp_iso_recv(struct rdp_iso *self, struct stream *s) {
  int code;
  if (rdp_iso_recv_msg(self, s, &code) != 0) {
    return 1;
  }
  if (code != 0xF0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rdp_iso_recv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <rdp_iso_recv_msg@plt>
cmp    $0x0,%rax
je     1147 <rdp_iso_recv+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1167 <rdp_iso_recv+0x57>
cmpl   $0xf0,-0x1c(%rbp)
je     1160 <rdp_iso_recv+0x50>
movl   $0x1,-0x4(%rbp)
jmp    1167 <rdp_iso_recv+0x57>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_iso_recv>:
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <rdp_iso_recv_msg@plt>
test   %rax,%rax
setne  %al
cmpl   $0xf0,0x4(%rsp)
setne  %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rdp_iso = type { i32 }
%struct.stream = type { i32 }
define i32 @rdp_iso_recv(%struct.rdp_iso* %0, %struct.stream* %1) {
%3 = alloca i32
%4 = alloca %struct.rdp_iso*
%5 = alloca %struct.stream*
%6 = alloca i32
store %struct.rdp_iso* %0, %struct.rdp_iso** %4
store %struct.stream* %1, %struct.stream** %5
%7 = load %struct.rdp_iso*, %struct.rdp_iso** %4
%8 = load %struct.stream*, %struct.stream** %5
%9 = call i64 @rdp_iso_recv_msg(%struct.rdp_iso* %7, %struct.stream* %8, i32* %6)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 1, i32* %3
br label %17
12: ; preds = %2
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 240
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 1, i32* %3
br label %17
16: ; preds = %12
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
%struct.rdp_iso = type { i32 }
%struct.stream = type { i32 }
define i32 @rdp_iso_recv(%struct.rdp_iso* %0, %struct.stream* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i64 @rdp_iso_recv_msg(%struct.rdp_iso* %0, %struct.stream* %1, i32* %3)
%6 = icmp ne i64 %5, 0
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 240
%9 = select i1 %6, i1 true, i1 %8
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main() {
  char line[1024];
  fgets(line, 1024, stdin);
  printf("%lf\n", atof(line));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    $0x400,%esi
call   1050 <fgets@plt>
lea    -0x410(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x400,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <fgets@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x400,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@stdin = global i32 0
@.str = [5 x i8] c"%lf\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 1024, i32 %3)
%5 = call i32 @atof(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct framerate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct framerate *);
int framerate_destroy(struct framerate *framerate) {
  int ret = 0;
  if (framerate == NULL)
    return -1;
  free(framerate);
  return ret;
}


x86 assembly (clang, -O0):
<framerate_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    113a <framerate_destroy+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <framerate_destroy+0x39>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<framerate_destroy>:
test   %rdi,%rdi
je     1122 <framerate_destroy+0x12>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
%struct.framerate = type { i32 }
define i32 @framerate_destroy(%struct.framerate* %0) {
%2 = alloca i32
%3 = alloca %struct.framerate*
%4 = alloca i32
store %struct.framerate* %0, %struct.framerate** %3
store i32 0, i32* %4
%5 = load %struct.framerate*, %struct.framerate** %3
%6 = icmp eq %struct.framerate* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %12
8: ; preds = %1
%9 = load %struct.framerate*, %struct.framerate** %3
%10 = call i32 @free(%struct.framerate* %9)
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.framerate = type { i32 }
define i32 @framerate_destroy(%struct.framerate* %0) {
%2 = icmp eq %struct.framerate* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.framerate* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ 0, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int f(int);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  if (f(1) != 2) {
    printf("Error %d\n", (int)1);
    exit(1);
  };
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <f@plt>
cmp    $0x2,%eax
je     116f <main+0x3f>
lea    0xea7(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <f@plt>
cmp    $0x2,%eax
jne    1163 <main+0x23>
lea    0xeb3(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe96(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f(i32 1)
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @exit(i32 1)
unreachable
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = tail call i32 @f(i32 1)
%2 = icmp eq i32 %1, 2
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
}
int _opus_false(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @_opus_false() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ENGINE;

/* Variables and functions */
int /*<<< orphan*/ ENGINE_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *ENGINE_new();
int /*<<< orphan*/ bind_helper(int /*<<< orphan*/ *);
ENGINE *ENGINE_rsax(void) {
  ENGINE *ret = ENGINE_new();
  if (!ret)
    return NULL;
  if (!bind_helper(ret)) {
    ENGINE_free(ret);
    return NULL;
  }
  return ret;
}


x86 assembly (clang, -O0):
<ENGINE_rsax>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ENGINE_new@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <ENGINE_rsax+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    118b <ENGINE_rsax+0x5b>
mov    -0x10(%rbp),%rdi
call   1050 <bind_helper@plt>
cmp    $0x0,%eax
jne    1183 <ENGINE_rsax+0x53>
mov    -0x10(%rbp),%rdi
call   1030 <ENGINE_free@plt>
movq   $0x0,-0x8(%rbp)
jmp    118b <ENGINE_rsax+0x5b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ENGINE_rsax>:
push   %rbx
xor    %eax,%eax
call   1040 <ENGINE_new@plt>
test   %rax,%rax
je     1154 <ENGINE_rsax+0x24>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <bind_helper@plt>
test   %eax,%eax
jne    1156 <ENGINE_rsax+0x26>
mov    %rbx,%rdi
call   1030 <ENGINE_free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32* @ENGINE_rsax() {
%1 = tail call i32* (...) @ENGINE_new()
%2 = icmp eq i32* %1, null
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 @bind_helper(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @ENGINE_free(i32* %1)
br label %8
8: ; preds = %3, %0, %6
%9 = phi i32* [ null, %6 ], [ null, %0 ], [ %1, %3 ]
ret i32* %9
}
int trailingZeroes(int n) {
  int count = 0;
  for (long long i = 5; n >= i; i *= 5)
    count += n / i;
  return count;
}


x86 assembly (clang, -O0):
<trailingZeroes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x5,-0x10(%rbp)
movslq -0x4(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     1149 <trailingZeroes+0x49>
movslq -0x4(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
imul   $0x5,-0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1116 <trailingZeroes+0x16>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trailingZeroes>:
xor    %ecx,%ecx
cmp    $0x4,%edi
jg     110a <trailingZeroes+0xa>
mov    %ecx,%eax
ret
mov    %edi,%r8d
movslq %edi,%rsi
mov    $0x5,%edi
jmp    1133 <trailingZeroes+0x33>
nopw   0x0(%rax,%rax,1)
mov    %rsi,%rax
cqto
idiv   %rdi
add    %eax,%ecx
lea    (%rdi,%rdi,4),%rdi
cmp    %rsi,%rdi
jg     1107 <trailingZeroes+0x7>
mov    %rsi,%rax
or     %rdi,%rax
shr    $0x20,%rax
jne    1120 <trailingZeroes+0x20>
mov    %r8d,%eax
xor    %edx,%edx
div    %edi
jmp    1128 <trailingZeroes+0x28>

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

LLVM IR (-O2):
define i32 @trailingZeroes(i32 %0) {
%2 = sext i32 %0 to i64
%3 = icmp slt i32 %0, 5
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %12, %6 ], [ 5, %1 ]
%8 = phi i32 [ %11, %6 ], [ 0, %1 ]
%9 = sdiv i64 %2, %7
%10 = trunc i64 %9 to i32
%11 = add i32 %8, %10
%12 = mul nsw i64 %7, 5
%13 = icmp sgt i64 %12, %2
br i1 %13, label %4, label %6
}
/* Type definitions */
struct timeval {
  unsigned long long tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long generic_timestamp() {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) == 0)
    return ((unsigned long long)tv.tv_sec) * 1000000 + tv.tv_usec;
  else
    return 0;
}


x86 assembly (clang, -O0):
<generic_timestamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jne    1144 <generic_timestamp+0x34>
imul   $0xf4240,-0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114c <generic_timestamp+0x3c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generic_timestamp>:
push   %rbx
sub    $0x10,%rsp
xor    %ebx,%ebx
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rcx
add    (%rsp),%rcx
test   %rax,%rax
cmovne %rbx,%rcx
mov    %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @generic_timestamp() {
%1 = alloca i64
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%10 = load i64, i64* %9
%11 = add i64 %8, %10
store i64 %11, i64* %1
br label %13
12: ; preds = %0
store i64 0, i64* %1
br label %13
13: ; preds = %12, %5
%14 = load i64, i64* %1
ret i64 %14
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @generic_timestamp() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%6 = load i64, i64* %5
%7 = mul i64 %6, 1000000
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = add i64 %7, %9
%11 = select i1 %4, i64 %10, i64 0
ret i64 %11
}
long gcd(long x, long y) {
  if (x == 0) {
    return y;
  }
  while (y != 0) {
    if (x > y) {
      x = x - y;
    } else {
      y = y - x;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1124 <gcd+0x24>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <gcd+0x6c>
jmp    1129 <gcd+0x29>
cmpq   $0x0,-0x18(%rbp)
je     1164 <gcd+0x64>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    1153 <gcd+0x53>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    115f <gcd+0x5f>
mov    -0x18(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1129 <gcd+0x29>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
test   %rdi,%rdi
je     112c <gcd+0x2c>
mov    %rdi,%rax
test   %rsi,%rsi
je     112b <gcd+0x2b>
xor    %ecx,%ecx
nop
cmp    %rax,%rsi
mov    $0x0,%edx
cmovl  %rsi,%rdx
mov    %rax,%rdi
cmovl  %rcx,%rdi
sub    %rdx,%rax
sub    %rdi,%rsi
jne    1110 <gcd+0x10>
ret
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @gcd(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %5
store i64 %9, i64* %3
br label %29
10: ; preds = %2
br label %11
11: ; preds = %26, %10
%12 = load i64, i64* %5
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %27
14: ; preds = %11
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = icmp sgt i64 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i64, i64* %4
%20 = load i64, i64* %5
%21 = sub nsw i64 %19, %20
store i64 %21, i64* %4
br label %26
22: ; preds = %14
%23 = load i64, i64* %5
%24 = load i64, i64* %4
%25 = sub nsw i64 %23, %24
store i64 %25, i64* %5
br label %26
26: ; preds = %22, %18
br label %11
27: ; preds = %11
%28 = load i64, i64* %4
store i64 %28, i64* %3
br label %29
29: ; preds = %27, %8
%30 = load i64, i64* %3
ret i64 %30
}

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %15, label %4
4: ; preds = %2
%5 = icmp eq i64 %1, 0
br i1 %5, label %15, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %13, %6 ], [ %1, %4 ]
%8 = phi i64 [ %11, %6 ], [ %0, %4 ]
%9 = icmp slt i64 %7, %8
%10 = select i1 %9, i64 %7, i64 0
%11 = sub nsw i64 %8, %10
%12 = select i1 %9, i64 0, i64 %8
%13 = sub nsw i64 %7, %12
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %4, %2
%16 = phi i64 [ %1, %2 ], [ %0, %4 ], [ %11, %6 ]
ret i64 %16
}
void irreducible(char *a, int b) {
  if (b) {
    goto L;
  }
  while (*a) {
    a++;
  L:
    a++;
  }
}


x86 assembly (clang, -O0):
<irreducible>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     111a <irreducible+0x1a>
jmp    1138 <irreducible+0x38>
jmp    111f <irreducible+0x1f>
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <irreducible+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111f <irreducible+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<irreducible>:
test   %esi,%esi
jne    110d <irreducible+0xd>
cmpb   $0x0,(%rdi)
je     1113 <irreducible+0x13>
add    $0x1,%rdi
add    $0x1,%rdi
jmp    1104 <irreducible+0x4>
ret

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

LLVM IR (-O2):
define void @irreducible(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %4, label %10
4: ; preds = %2, %10
%5 = phi i8* [ %12, %10 ], [ %0, %2 ]
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %5, i64 1
br label %10
10: ; preds = %2, %8
%11 = phi i8* [ %0, %2 ], [ %9, %8 ]
%12 = getelementptr inbounds i8, i8* %11, i64 1
br label %4
13: ; preds = %4
ret void
}
/* Variables and functions */
int gcd(int, int);
int lcm(int m, int n) { return (m * n) / gcd(m, n); }


x86 assembly (clang, -O0):
<lcm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <gcd@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @lcm(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @gcd(i32 %0, i32 %1)
%5 = sdiv i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int c();
int b(void) { return c() + 1; }


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

x86 assembly (clang, -O2):
<b>:
push   %rax
xor    %eax,%eax
call   1030 <c@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @b() {
%1 = call i32 (...) @c()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @b() {
%1 = tail call i32 (...) @c()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
scalar_t__ isblank(char);
char *skip_blanks(char *s) {
  while (isblank(*s))
    s++;
  return s;
}


x86 assembly (clang, -O0):
<skip_blanks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
je     1143 <skip_blanks+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_blanks+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_blanks>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isblank@plt>
test   %rax,%rax
jne    1120 <skip_blanks+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_blanks(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isblank(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ MSG_DONTWAIT;
int recv(int, char *, int, int /*<<< orphan*/);
int long_read(int *cfd, char *buf, int current_length) {
  ssize_t length_read = recv(*cfd, buf + current_length, 4096, MSG_DONTWAIT);
  return length_read;
}


x86 assembly (clang, -O0):
<long_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
add    %rax,%rsi
mov    0x2ea5(%rip),%rax
mov    (%rax),%ecx
mov    $0x1000,%edx
call   1030 <recv@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_read>:
mov    (%rdi),%edi
movslq %edx,%rax
add    %rax,%rsi
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    $0x1000,%edx
jmp    1030 <recv@plt>

LLVM IR (-O0):
@MSG_DONTWAIT = global i32 0
define i32 @long_read(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i32, i32* @MSG_DONTWAIT
%15 = call i32 @recv(i32 %9, i8* %13, i32 4096, i32 %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
ret i32 %16
}

LLVM IR (-O2):
@MSG_DONTWAIT = global i32 0
define i32 @long_read(i32* nocapture %0, i8* %1, i32 %2) {
%4 = load i32, i32* %0
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i32, i32* @MSG_DONTWAIT
%8 = tail call i32 @recv(i32 %4, i8* %6, i32 4096, i32 %7)
ret i32 %8
}
int cast_uint_int(unsigned int x) { return (int)x; }


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

x86 assembly (clang, -O2):
<cast_uint_int>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @cast_uint_int(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Jump_If_Equal(char *label) { Inst_Printf("beq", "$1,%s", label); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"beq\00"
@.str.1 = [6 x i8] c"$1,%s\00"
define void @Jump_If_Equal(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ putchar(int);
egchar2() {
  int c, f;
  while ((c = getchar()) != EOF) {
    putchar(c);
    printf("%ld\n", sizeof(0.0));
    f = c - '0';
  }
}


x86 assembly (clang, -O0):
<egchar2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2e9f(%rip),%rcx
cmp    (%rcx),%eax
je     1178 <egchar2+0x48>
mov    -0x8(%rbp),%edi
call   1030 <putchar@plt>
lea    0xea0(%rip),%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    1138 <egchar2+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<egchar2>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    0x2ea6(%rip),%r14
cmp    (%r14),%eax
je     1170 <egchar2+0x40>
lea    0xeb2(%rip),%rbx
xchg   %ax,%ax
mov    %eax,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    (%r14),%eax
jne    1150 <egchar2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @egchar2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
br label %4
4: ; preds = %8, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @putchar(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
%12 = load i32, i32* %2
%13 = sub nsw i32 %12, 48
store i32 %13, i32* %3
br label %4
14: ; preds = %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [5 x i8] c"%ld\0A\00"
define i32 @egchar2() {
%1 = tail call i32 (...) @getchar()
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %1, %2
br i1 %3, label %11, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %8, %4 ], [ %1, %0 ]
%6 = tail call i32 @putchar(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 8)
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %4
11: ; preds = %4, %0
ret i32 undef
}