xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_mday;
};
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ localtime_r(int /*<<< orphan*/ *, struct tm *);
int time_today() {
  struct tm tm_now;
  struct timeval tv;
  gettimeofday(&tv, NULL);
  time_t now = tv.tv_sec;
  localtime_r(&now, &tm_now);
  return tm_now.tm_mday;
}


x86 assembly (clang, -O0):
<time_today>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <gettimeofday@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1030 <localtime_r@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_today>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x14(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <localtime_r@plt>
mov    0x10(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
%struct.timeval = type { i32 }
define i32 @time_today() {
%1 = alloca %struct.tm
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = call i32 @localtime_r(i32* %3, %struct.tm* %1)
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
%struct.tm = type { i32 }
%struct.timeval = type { i32 }
define i32 @time_today() {
%1 = alloca %struct.tm
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = bitcast %struct.tm* %1 to i8*
%5 = bitcast %struct.timeval* %2 to i8*
%6 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%7 = bitcast i32* %3 to i8*
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
%9 = load i32, i32* %8
store i32 %9, i32* %3
%10 = call i32 @localtime_r(i32* %3, %struct.tm* %1)
%11 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%12 = load i32, i32* %11
ret i32 %12
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t clr_xtrail_0s(uint64_t u) { return (u - 1) & ~u; }


x86 assembly (clang, -O0):
<clr_xtrail_0s>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clr_xtrail_0s>:
lea    -0x1(%rdi),%eax
not    %edi
and    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @clr_xtrail_0s(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = xor i32 %0, -1
%4 = and i32 %2, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *easy_pool_default_realloc(void *ptr, size_t size) {
  if (size) {
    return realloc(ptr, size);
  } else if (ptr) {
    free(ptr);
  }
  return 0;
}


x86 assembly (clang, -O0):
<easy_pool_default_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1151 <easy_pool_default_realloc+0x31>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
jmp    1172 <easy_pool_default_realloc+0x52>
cmpq   $0x0,-0x10(%rbp)
je     1165 <easy_pool_default_realloc+0x45>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
jmp    116a <easy_pool_default_realloc+0x4a>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<easy_pool_default_realloc>:
test   %rsi,%rsi
je     112a <easy_pool_default_realloc+0xa>
jmp    1040 <realloc@plt>
test   %rdi,%rdi
je     1139 <easy_pool_default_realloc+0x19>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @easy_pool_default_realloc(i8* %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @realloc(i8* %0, i64 %1)
br label %10
6: ; preds = %2
%7 = icmp eq i8* %0, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @free(i8* %0)
br label %10
10: ; preds = %8, %6, %4
%11 = phi i8* [ %5, %4 ], [ null, %6 ], [ null, %8 ]
ret i8* %11
}
/* Variables and functions */
int pwalign_task(int, char **);
int main(int argc, char *argv[]) { return pwalign_task(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <pwalign_task@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @pwalign_task(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ V_DrawPatchDirect(int, int, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ W_CacheLumpName(char *, int);
void M_DrawNewGame(void) {
  V_DrawPatchDirect(96, 14, 0, W_CacheLumpName("M_NEWG", 101));
  V_DrawPatchDirect(54, 38, 0, W_CacheLumpName("M_SKILL", 101));
}


x86 assembly (clang, -O0):
<M_DrawNewGame>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x65,%esi
call   1040 <W_CacheLumpName@plt>
mov    %eax,%ecx
mov    $0x60,%edi
mov    $0xe,%esi
xor    %edx,%edx
call   1030 <V_DrawPatchDirect@plt>
lea    0xeb8(%rip),%rdi
mov    $0x65,%esi
call   1040 <W_CacheLumpName@plt>
mov    %eax,%ecx
mov    $0x36,%edi
mov    $0x26,%esi
xor    %edx,%edx
call   1030 <V_DrawPatchDirect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<M_DrawNewGame>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x65,%esi
call   1040 <W_CacheLumpName@plt>
mov    $0x60,%edi
mov    $0xe,%esi
xor    %edx,%edx
mov    %eax,%ecx
call   1030 <V_DrawPatchDirect@plt>
lea    0xebb(%rip),%rdi
mov    $0x65,%esi
call   1040 <W_CacheLumpName@plt>
mov    $0x36,%edi
mov    $0x26,%esi
xor    %edx,%edx
mov    %eax,%ecx
pop    %rax
jmp    1030 <V_DrawPatchDirect@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"M_NEWG\00"
@.str.1 = [8 x i8] c"M_SKILL\00"
define void @M_DrawNewGame() {
%1 = call i32 @W_CacheLumpName(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = call i32 @V_DrawPatchDirect(i32 96, i32 14, i32 0, i32 %1)
%3 = call i32 @W_CacheLumpName(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 101)
%4 = call i32 @V_DrawPatchDirect(i32 54, i32 38, i32 0, i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"M_NEWG\00"
@.str.1 = [8 x i8] c"M_SKILL\00"
define void @M_DrawNewGame() {
%1 = tail call i32 @W_CacheLumpName(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 101)
%2 = tail call i32 @V_DrawPatchDirect(i32 96, i32 14, i32 0, i32 %1)
%3 = tail call i32 @W_CacheLumpName(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 101)
%4 = tail call i32 @V_DrawPatchDirect(i32 54, i32 38, i32 0, i32 %3)
ret void
}
/* Variables and functions */
int subStrleng(char const *, char);
int strleng(const char *s) { return subStrleng(s, '\0'); }


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

x86 assembly (clang, -O2):
<strleng>:
xor    %esi,%esi
jmp    1030 <subStrleng@plt>

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

LLVM IR (-O2):
define i32 @strleng(i8* %0) {
%2 = tail call i32 @subStrleng(i8* %0, i8 signext 0)
ret i32 %2
}
int is_path(char *p) {
  int i;
  for (i = 0; p[i] != '\0'; i++) {
    if (p[i] == '/')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_path>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <is_path+0x58>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    1145 <is_path+0x45>
movl   $0x1,-0x4(%rbp)
jmp    115f <is_path+0x5f>
jmp    114a <is_path+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <is_path+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_path>:
movzbl (%rdi),%eax
test   %al,%al
je     1111 <is_path+0x11>
cmp    $0x2f,%al
je     1114 <is_path+0x14>
add    $0x1,%rdi
jmp    1100 <is_path>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_path(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i64 [ %7, %6 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %9
i8 47, label %8
]
6: ; preds = %2
%7 = add nuw i64 %3, 1
br label %2
8: ; preds = %2
br label %9
9: ; preds = %2, %8
%10 = phi i32 [ 1, %8 ], [ 0, %2 ]
ret i32 %10
}
OP(dd, f4) {
  illegal_1();
  op_f4();
}


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_1@plt>
mov    $0x0,%al
call   1040 <op_f4@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_1()
%4 = tail call i32 (...) @op_f4()
ret i32 undef
}
void foo676() {}


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

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

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

LLVM IR (-O2):
define void @foo676() {
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int ENOENT;
int NSS_STATUS_UNAVAIL;
enum nss_status _nss_noenum_getpwent_r(struct passwd *pw, char *buffer,
                                       size_t buflen, int *errnop) {
  *errnop = ENOENT;
  return NSS_STATUS_UNAVAIL;
}


x86 assembly (clang, -O0):
<_nss_noenum_getpwent_r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    0x2ebe(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_noenum_getpwent_r>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rcx)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
%struct.passwd = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_UNAVAIL = global i32 0
define i32 @_nss_noenum_getpwent_r(%struct.passwd* %0, i8* %1, i64 %2, i32* %3) {
%5 = alloca %struct.passwd*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
store %struct.passwd* %0, %struct.passwd** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%9 = load i32, i32* @ENOENT
%10 = load i32*, i32** %8
store i32 %9, i32* %10
%11 = load i32, i32* @NSS_STATUS_UNAVAIL
ret i32 %11
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@ENOENT = global i32 0
@NSS_STATUS_UNAVAIL = global i32 0
define i32 @_nss_noenum_getpwent_r(%struct.passwd* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32* nocapture writeonly %3) {
%5 = load i32, i32* @ENOENT
store i32 %5, i32* %3
%6 = load i32, i32* @NSS_STATUS_UNAVAIL
ret i32 %6
}
int big_endian() {
  int a = 0x1234;
  char b = *(char *)&a;
  if (b == 0x12) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1234,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x12,%eax
jne    112a <big_endian+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <big_endian+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @big_endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 4660, i32* %2
%4 = bitcast i32* %2 to i8*
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 18
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @big_endian() {
ret i32 0
}
long read_skip_length(unsigned char *marker) {
  long msb, lsb, retval;
  msb = (long)marker[2];
  lsb = (long)marker[3];
  retval = 256 * msb + lsb + 2;
  return (retval);
}


x86 assembly (clang, -O0):
<read_skip_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x8,%rax
add    -0x18(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_skip_length>:
movzwl 0x2(%rdi),%eax
shl    $0x30,%rax
bswap  %rax
add    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @read_skip_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
store i64 %9, i64* %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 3
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
store i64 %13, i64* %4
%14 = load i64, i64* %3
%15 = mul nsw i64 256, %14
%16 = load i64, i64* %4
%17 = add nsw i64 %15, %16
%18 = add nsw i64 %17, 2
store i64 %18, i64* %5
%19 = load i64, i64* %5
ret i64 %19
}

LLVM IR (-O2):
define i64 @read_skip_length(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 8
%9 = or i64 %8, %7
%10 = add nuw nsw i64 %9, 2
ret i64 %10
}
float mvVecScalarProduct2(const float *a, const float *b) {
  return (a[0] * b[0]) + (a[1] * b[1]);
}


x86 assembly (clang, -O0):
<mvVecScalarProduct2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x10(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvVecScalarProduct2>:
movss  0x4(%rdi),%xmm1
mulss  0x4(%rsi),%xmm1
movss  (%rdi),%xmm0
mulss  (%rsi),%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @mvVecScalarProduct2(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %4
%9 = getelementptr inbounds float, float* %8, i64 0
%10 = load float, float* %9
%11 = load float*, float** %3
%12 = getelementptr inbounds float, float* %11, i64 1
%13 = load float, float* %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 1
%16 = load float, float* %15
%17 = fmul float %13, %16
%18 = call float @llvm.fmuladd.f32(float %7, float %10, float %17)
ret float %18
}

LLVM IR (-O2):
define float @mvVecScalarProduct2(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = load float, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = fmul float %6, %8
%10 = tail call float @llvm.fmuladd.f32(float %3, float %4, float %9)
ret float %10
}
void RandomFunc(unsigned char input[1], unsigned char output[1]) {
  unsigned char state[1];
  {
    state[0UL] = (input[0UL] + 914778474UL) * (unsigned char)22;
    if (state[0UL] & (unsigned char)1) {
      state[0UL] += state[0UL];
    } else {
      state[0UL] += state[0UL];
    }
    output[0UL] = state[0UL] + (unsigned char)231;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x3686696a,%rax
imul   $0x16,%rax,%rax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1142 <RandomFunc+0x42>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
jmp    114f <RandomFunc+0x4f>
movzbl -0x11(%rbp),%ecx
movzbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0xe7,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzbl (%rdi),%eax
imul   $0x2c,%eax,%eax
add    $0x1f,%al
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
%4 = mul i8 %3, 44
%5 = add i8 %4, 31
store i8 %5, i8* %1
ret void
}
double calc_cool_obj(temp, tempcrit)
double temp, tempcrit;
{
  double value;
  value = (temp * temp) / (tempcrit * tempcrit * 7);
  return (value);
}


x86 assembly (clang, -O0):
<calc_cool_obj>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xed6(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_cool_obj>:
mulsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm1
mulsd  0xef0(%rip),%xmm1
divsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @calc_cool_obj(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %3
%8 = fmul double %6, %7
%9 = load double, double* %4
%10 = load double, double* %4
%11 = fmul double %9, %10
%12 = fmul double %11, 7.000000e+00
%13 = fdiv double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @calc_cool_obj(double %0, double %1) {
%3 = fmul double %0, %0
%4 = fmul double %1, %1
%5 = fmul double %4, 7.000000e+00
%6 = fdiv double %3, %5
ret double %6
}
void thread_setup_default_attributes() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ drawPoint(int /*<<< orphan*/, int, int /*<<< orphan*/);
void DrawHorizontalLine(int x, int y, int length, uint8_t color) {
  while (length--)
    drawPoint(x++, y, color);
}


x86 assembly (clang, -O0):
<DrawHorizontalLine>:
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    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1153 <DrawHorizontalLine+0x43>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <drawPoint@plt>
jmp    1124 <DrawHorizontalLine+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DrawHorizontalLine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
je     1145 <DrawHorizontalLine+0x35>
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %esi,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%rdi),%ebx
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <drawPoint@plt>
mov    %ebx,%edi
add    $0xffffffff,%ebp
jne    1130 <DrawHorizontalLine+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @DrawHorizontalLine(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
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* %7
%11 = add nsw i32 %10, -1
store i32 %11, i32* %7
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = call i32 @drawPoint(i32 %14, i32 %16, i32 %17)
br label %9
19: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @DrawHorizontalLine(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, 0
br i1 %5, label %13, label %6
6: ; preds = %4, %6
%7 = phi i32 [ %10, %6 ], [ %0, %4 ]
%8 = phi i32 [ %9, %6 ], [ %2, %4 ]
%9 = add nsw i32 %8, -1
%10 = add nsw i32 %7, 1
%11 = tail call i32 @drawPoint(i32 %7, i32 %1, i32 %3)
%12 = icmp eq i32 %9, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %4
ret void
}
void s2e_enable_forking(void) {
  __asm__ __volatile__(".byte 0x0f, 0x3f\n"
                       ".byte 0x00, 0x09, 0x00, 0x00\n"
                       ".byte 0x00, 0x00, 0x00, 0x00\n");
}


x86 assembly (clang, -O0):
<s2e_enable_forking>:
push   %rbp
mov    %rsp,%rbp
(bad)
add    %cl,(%rcx)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2e_enable_forking>:
(bad)
add    %cl,(%rcx)
add    %al,(%rax)
add    %al,(%rax)
add    %al,(%rax)
ret

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

LLVM IR (-O2):
define void @s2e_enable_forking() {
tail call void asm sideeffect ".byte 0x0f, 0x3f\0A.byte 0x00, 0x09, 0x00, 0x00\0A.byte 0x00, 0x00, 0x00, 0x00\0A", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
double hill(int x, int y, double xc, double yc, double elevation,
            double denivelation) {
  double xp = x - xc;
  double yp = y - yc;
  return elevation / (1.0 + (xp * xp + yp * yp) / denivelation);
}


x86 assembly (clang, -O0):
<hill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
movsd  -0x38(%rbp),%xmm1
mulsd  -0x38(%rbp),%xmm1
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
divsd  -0x28(%rbp),%xmm2
movsd  0xe96(%rip),%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hill>:
cvtsi2sd %edi,%xmm4
subsd  %xmm0,%xmm4
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
subsd  %xmm1,%xmm0
mulsd  %xmm0,%xmm0
mulsd  %xmm4,%xmm4
addsd  %xmm0,%xmm4
divsd  %xmm3,%xmm4
addsd  0xed5(%rip),%xmm4
divsd  %xmm4,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @hill(i32 %0, i32 %1, double %2, double %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%15 = load i32, i32* %7
%16 = sitofp i32 %15 to double
%17 = load double, double* %9
%18 = fsub double %16, %17
store double %18, double* %13
%19 = load i32, i32* %8
%20 = sitofp i32 %19 to double
%21 = load double, double* %10
%22 = fsub double %20, %21
store double %22, double* %14
%23 = load double, double* %11
%24 = load double, double* %13
%25 = load double, double* %13
%26 = load double, double* %14
%27 = load double, double* %14
%28 = fmul double %26, %27
%29 = call double @llvm.fmuladd.f64(double %24, double %25, double %28)
%30 = load double, double* %12
%31 = fdiv double %29, %30
%32 = fadd double 1.000000e+00, %31
%33 = fdiv double %23, %32
ret double %33
}

LLVM IR (-O2):
define double @hill(i32 %0, i32 %1, double %2, double %3, double %4, double %5) {
%7 = sitofp i32 %0 to double
%8 = fsub double %7, %2
%9 = sitofp i32 %1 to double
%10 = fsub double %9, %3
%11 = fmul double %10, %10
%12 = tail call double @llvm.fmuladd.f64(double %8, double %8, double %11)
%13 = fdiv double %12, %5
%14 = fadd double %13, 1.000000e+00
%15 = fdiv double %4, %14
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ alwaysInline();
void use99() { alwaysInline(); }


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

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

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

LLVM IR (-O2):
define void @use99() {
%1 = tail call i32 (...) @alwaysInline()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double get_harris_poll(void) {
  double value = 0.0;
  printf("What is the team's Harris Poll result? ");
  scanf("%lf", &value);
  return value;
}


x86 assembly (clang, -O0):
<get_harris_poll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_harris_poll>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [40 x i8] c"What is the team's Harris Poll result? \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_harris_poll() {
%1 = alloca double
store double 0.000000e+00, double* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%4 = load double, double* %1
ret double %4
}

LLVM IR (-O2):
@.str = [40 x i8] c"What is the team's Harris Poll result? \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @get_harris_poll() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
store double 0.000000e+00, double* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%5 = load double, double* %1
ret double %5
}
int c4_bothtrue(int x, int y) { return (x && y) ? 1 : 0; }


x86 assembly (clang, -O0):
<c4_bothtrue>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1123 <c4_bothtrue+0x23>
cmpl   $0x0,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<c4_bothtrue>:
test   %edi,%edi
setne  %al
test   %esi,%esi
setne  %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @c4_bothtrue(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, 0
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
void msf_frame_to_msf(long frame, int *m, int *s, int *f) {
  *f = frame % 75;
  frame /= 75;
  *s = frame % 60;
  frame /= 60;
  *m = frame;
}


x86 assembly (clang, -O0):
<msf_frame_to_msf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x4b,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x4b,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %edx,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    $0x3c,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<msf_frame_to_msf>:
mov    %rdx,%r8
mov    %rdi,%r9
movabs $0x6d3a06d3a06d3a07,%rdx
06 3a 6d
mov    %rdi,%rax
imul   %rdx
mov    %rdx,%rdi
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x5,%rdi
add    %rax,%rdi
imul   $0x4b,%edi,%eax
mov    %r9d,%edx
sub    %eax,%edx
mov    %edx,(%rcx)
movabs $0x8888888888888889,%rcx
88 88 88
mov    %rdi,%rax
imul   %rcx
add    %rdi,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x5,%rdx
add    %eax,%edx
imul   $0x3c,%edx,%eax
sub    %eax,%edi
mov    %edi,(%r8)
movabs $0x3a4114b5225c6337,%rcx
14 41 3a
mov    %r9,%rax
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0xa,%rdx
add    %eax,%edx
mov    %edx,(%rsi)
ret

LLVM IR (-O0):
define void @msf_frame_to_msf(i64 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i64 %0, i64* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i64, i64* %5
%10 = srem i64 %9, 75
%11 = trunc i64 %10 to i32
%12 = load i32*, i32** %8
store i32 %11, i32* %12
%13 = load i64, i64* %5
%14 = sdiv i64 %13, 75
store i64 %14, i64* %5
%15 = load i64, i64* %5
%16 = srem i64 %15, 60
%17 = trunc i64 %16 to i32
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i64, i64* %5
%20 = sdiv i64 %19, 60
store i64 %20, i64* %5
%21 = load i64, i64* %5
%22 = trunc i64 %21 to i32
%23 = load i32*, i32** %6
store i32 %22, i32* %23
ret void
}

LLVM IR (-O2):
define void @msf_frame_to_msf(i64 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = srem i64 %0, 75
%6 = trunc i64 %5 to i32
store i32 %6, i32* %3
%7 = sdiv i64 %0, 75
%8 = srem i64 %7, 60
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
%10 = sdiv i64 %0, 4500
%11 = trunc i64 %10 to i32
store i32 %11, i32* %1
ret void
}
/* Variables and functions */
char *memutil_alloc(size_t, char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *memutil_strdup(char *str, char *file, int line) {
  size_t size = strlen(str) + 1;
  char *ret;
  ret = memutil_alloc(size, file, line);
  strcpy(ret, str);
  return (ret);
}


x86 assembly (clang, -O0):
<memutil_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <memutil_alloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memutil_strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
call   1050 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <memutil_alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %rbp,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @memutil_strdup(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i8*, i8** %5
%15 = load i32, i32* %6
%16 = call i8* @memutil_alloc(i64 %13, i8* %14, i32 %15)
store i8* %16, i8** %8
%17 = load i8*, i8** %8
%18 = load i8*, i8** %4
%19 = call i32 @strcpy(i8* %17, i8* %18)
%20 = load i8*, i8** %8
ret i8* %20
}

LLVM IR (-O2):
define i8* @memutil_strdup(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = add nsw i32 %4, 1
%6 = sext i32 %5 to i64
%7 = tail call i8* @memutil_alloc(i64 %6, i8* %1, i32 %2)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
ret i8* %7
}
f(a, b, d, e) {
  return 2 * (a * b + 2 * (a - 2 * e) * d + 2 * (b - 2 * e) * d);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%edx
shl    $0x1,%edx
sub    %edx,%ecx
shl    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%edx
shl    $0x1,%edx
sub    %edx,%ecx
shl    $0x1,%ecx
imul   -0xc(%rbp),%ecx
add    %ecx,%eax
shl    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    %esi,%eax
imul   %edi,%eax
shl    $0x2,%ecx
add    %edi,%esi
sub    %ecx,%esi
imul   %edx,%esi
lea    (%rax,%rsi,2),%eax
add    %eax,%eax
ret

LLVM IR (-O0):
define i32 @f(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 = mul nsw i32 %9, %10
%12 = load i32, i32* %5
%13 = load i32, i32* %8
%14 = mul nsw i32 2, %13
%15 = sub nsw i32 %12, %14
%16 = mul nsw i32 2, %15
%17 = load i32, i32* %7
%18 = mul nsw i32 %16, %17
%19 = add nsw i32 %11, %18
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = mul nsw i32 2, %21
%23 = sub nsw i32 %20, %22
%24 = mul nsw i32 2, %23
%25 = load i32, i32* %7
%26 = mul nsw i32 %24, %25
%27 = add nsw i32 %19, %26
%28 = mul nsw i32 2, %27
ret i32 %28
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = mul nsw i32 %1, %0
%6 = mul i32 %3, -4
%7 = add i32 %1, %0
%8 = add i32 %7, %6
%9 = shl i32 %2, 1
%10 = mul i32 %9, %8
%11 = add i32 %10, %5
%12 = shl nsw i32 %11, 1
ret i32 %12
}
int HelpItem97(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem97() {
ret i32 0
}
int main() {
  int a = 0;
  if ((a == 0) && (a == 1))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1132 <main+0x32>
cmpl   $0x1,-0x8(%rbp)
jne    1132 <main+0x32>
movl   $0x0,-0x4(%rbp)
jmp    1139 <main+0x39>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
signed short signedshort_ignoring_signedlonglong(signed short x,
                                                 signed long long y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_signedlonglong>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_signedlonglong(i16 signext %0, i64 %1) {
%3 = alloca i16
%4 = alloca i64
store i16 %0, i16* %3
store i64 %1, i64* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_signedlonglong(i16 returned signext %0, i64 %1) {
ret i16 %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0xb6() {
  Assert_real((ispunct(182) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_ispunct.c",
              915, ("ispunct should be 0 for 0xb6"));
}


x86 assembly (clang, -O0):
<t_ispunct_0xb6>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb6,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x393,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0xb6>:
push   %rax
mov    $0xb6,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x393,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb6\00"
define void @t_ispunct_0xb6() {
%1 = call i64 @ispunct(i32 182)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_ispunct.c\00"
@.str.1 = [29 x i8] c"ispunct should be 0 for 0xb6\00"
define void @t_ispunct_0xb6() {
%1 = tail call i64 @ispunct(i32 182)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 915, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, void *, size_t);
void *realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *x_realloc(void *ptr, size_t size) {
  void *r = realloc(ptr, size);
  if (!r) {
    fprintf(stderr, "Fatal: realloc(%p, %lu) failed\n", ptr, size);
    exit(EXIT_FAILURE);
  }
  return r;
}


x86 assembly (clang, -O0):
<x_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1187 <x_realloc+0x57>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8c(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_realloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <realloc@plt>
test   %rax,%rax
je     114c <x_realloc+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"Fatal: realloc(%p, %lu) failed\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @x_realloc(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i8* @realloc(i8* %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %18, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %3
%14 = load i64, i64* %4
%15 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %13, i64 %14)
%16 = load i32, i32* @EXIT_FAILURE
%17 = call i32 @exit(i32 %16)
unreachable
18: ; preds = %2
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"Fatal: realloc(%p, %lu) failed\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @x_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
float calculateDensity(int vertex_qtt, int edge_qtt) {
  return (edge_qtt << 1) / (vertex_qtt * vertex_qtt - vertex_qtt);
}


x86 assembly (clang, -O0):
<calculateDensity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
imul   -0x4(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateDensity>:
lea    (%rsi,%rsi,1),%eax
mov    %edi,%ecx
imul   %edi,%ecx
sub    %edi,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
define float @calculateDensity(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 1
%7 = load i32, i32* %3
%8 = load i32, i32* %3
%9 = mul nsw i32 %7, %8
%10 = load i32, i32* %3
%11 = sub nsw i32 %9, %10
%12 = sdiv i32 %6, %11
%13 = sitofp i32 %12 to float
ret float %13
}

LLVM IR (-O2):
define float @calculateDensity(i32 %0, i32 %1) {
%3 = shl i32 %1, 1
%4 = mul nsw i32 %0, %0
%5 = sub nsw i32 %4, %0
%6 = sdiv i32 %3, %5
%7 = sitofp i32 %6 to float
ret float %7
}