xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int);
main() {
  int i_array[10];
  char c_array[10];
  int *ip;
  ip = i_array;
  printf("i_array: %p; *ip = %d", i_array, *ip);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x30(%rbp),%rsi
mov    -0x48(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@.str = [22 x i8] c"i_array: %p; *ip = %d\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32* %3, i32 undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, char *, int);
void fvin_get_optname(char *buf, int buflen) { strncpy(buf, "myfvin", buflen); }


x86 assembly (clang, -O0):
<fvin_get_optname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <strncpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fvin_get_optname>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <strncpy@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"myfvin\00"
define void @fvin_get_optname(i8* %0, i32 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int highlightRegion_GpmScreen(int left, int right, int top, int bottom) {
  return 0;
}


x86 assembly (clang, -O0):
<highlightRegion_GpmScreen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @highlightRegion_GpmScreen(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
ret i32 0
}

LLVM IR (-O2):
define i32 @highlightRegion_GpmScreen(i32 %0, i32 %1, i32 %2, i32 %3) {
ret i32 0
}
/* Type definitions */
struct lconv {
  int dummy;
};

/* Variables and functions */
struct lconv *localeconv();
struct lconv *__aeabi_localeconv(void) {
  return localeconv();
}


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

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

LLVM IR (-O0):
%struct.lconv = type { i32 }
define %struct.lconv* @__aeabi_localeconv() {
%1 = call %struct.lconv* (...) @localeconv()
ret %struct.lconv* %1
}

LLVM IR (-O2):
%struct.lconv = type { i32 }
define %struct.lconv* @__aeabi_localeconv() {
%1 = tail call %struct.lconv* (...) @localeconv()
ret %struct.lconv* %1
}
/* Type definitions */
struct tcb {
  int dummy;
};

/* Variables and functions */
int decode_chmod(struct tcb *, int /*<<< orphan*/);
int sys_chmod(struct tcb *tcp) { return decode_chmod(tcp, 0); }


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

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

LLVM IR (-O0):
%struct.tcb = type { i32 }
define i32 @sys_chmod(%struct.tcb* %0) {
%2 = alloca %struct.tcb*
store %struct.tcb* %0, %struct.tcb** %2
%3 = load %struct.tcb*, %struct.tcb** %2
%4 = call i32 @decode_chmod(%struct.tcb* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.tcb = type { i32 }
define i32 @sys_chmod(%struct.tcb* %0) {
%2 = tail call i32 @decode_chmod(%struct.tcb* %0, i32 0)
ret i32 %2
}
int os2_netflui(void) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @os2_netflui() {
ret i32 -1
}
void handler2(int signo __attribute__((unused))) {}


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

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

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

LLVM IR (-O2):
define void @handler2(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int maxDistance(int **, int, int *);
int main() {
  int **grid = (int **)malloc(sizeof(int *) * 2);
  int arr[2] = {0, 1};
  int arr1[2] = {0, 1};
  grid[0] = arr;
  grid[1] = arr1;
  int size = 2;
  int max = maxDistance(grid, size, &size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x10,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    0xebc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb1(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
lea    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,0x8(%rax)
movl   $0x2,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
lea    -0x24(%rbp),%rdx
call   1040 <maxDistance@plt>
mov    %eax,-0x28(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    $0x10,%edi
call   1030 <malloc@plt>
movabs $0x100000000,%rcx
mov    %rcx,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%rcx
mov    %rcx,(%rax)
lea    0x8(%rsp),%rcx
mov    %rcx,0x8(%rax)
movl   $0x2,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
mov    $0x2,%esi
call   1040 <maxDistance@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [2 x i32] [i32 0, i32 1]
@__const.main.arr1 = [2 x i32] [i32 0, i32 1]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i64 @malloc(i32 16)
%8 = inttoptr i64 %7 to i32**
store i32** %8, i32*** %2
%9 = bitcast [2 x i32]* %3 to i8*
%10 = bitcast [2 x i32]* %4 to i8*
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%12 = load i32**, i32*** %2
%13 = getelementptr inbounds i32*, i32** %12, i64 0
store i32* %11, i32** %13
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%15 = load i32**, i32*** %2
%16 = getelementptr inbounds i32*, i32** %15, i64 1
store i32* %14, i32** %16
store i32 2, i32* %5
%17 = load i32**, i32*** %2
%18 = load i32, i32* %5
%19 = call i32 @maxDistance(i32** %17, i32 %18, i32* %5)
store i32 %19, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i32
%4 = tail call i64 @malloc(i32 16)
%5 = inttoptr i64 %4 to i32**
%6 = bitcast i64* %1 to i8*
store i64 4294967296, i64* %1
%7 = bitcast i64* %2 to i8*
store i64 4294967296, i64* %2
%8 = inttoptr i64 %4 to i64**
store i64* %1, i64** %8
%9 = getelementptr inbounds i32*, i32** %5, i64 1
%10 = bitcast i32** %9 to i64**
store i64* %2, i64** %10
%11 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%12 = call i32 @maxDistance(i32** %5, i32 2, i32* %3)
ret i32 0
}
int find_sdr_by_snum(unsigned char *psdr, unsigned char *pcache,
                     unsigned char snum, unsigned char sa) {
  return (-1);
}


x86 assembly (clang, -O0):
<find_sdr_by_snum>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @find_sdr_by_snum(i8* %0, i8* %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
ret i32 -1
}

LLVM IR (-O2):
define i32 @find_sdr_by_snum(i8* nocapture readnone %0, i8* nocapture readnone %1, i8 zeroext %2, i8 zeroext %3) {
ret i32 -1
}
void cw_set_ssl_options(int sslverify, const char *sslcafile,
                        const char *sslcapath, const char *sslciphers,
                        const char *sslpeer) {}


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

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

LLVM IR (-O0):
define void @cw_set_ssl_options(i32 %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
ret void
}

LLVM IR (-O2):
define void @cw_set_ssl_options(i32 %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3, i8* nocapture %4) {
ret void
}
/* Type definitions */
struct flock {
  int l_type;
  int l_whence;
  void *l_len;
  void *l_start;
};
typedef void *off_t;

/* Variables and functions */
int fcntl(int, int, struct flock *);
int lock_reg(int fd, int cmd, int type, off_t offset, int whence, off_t len) {
  struct flock lock;
  lock.l_type = type;
  lock.l_start = offset;
  lock.l_whence = whence;
  lock.l_len = len;
  return (fcntl(fd, cmd, &lock));
}


x86 assembly (clang, -O0):
<lock_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x40(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lock_reg>:
sub    $0x18,%rsp
mov    %edx,(%rsp)
mov    %rcx,0x10(%rsp)
mov    %r8d,0x4(%rsp)
mov    %r9,0x8(%rsp)
mov    %rsp,%rdx
call   1030 <fcntl@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca %struct.flock
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%14 = load i32, i32* %9
%15 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 0
store i32 %14, i32* %15
%16 = load i8*, i8** %10
%17 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 3
store i8* %16, i8** %17
%18 = load i32, i32* %11
%19 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 1
store i32 %18, i32* %19
%20 = load i8*, i8** %12
%21 = getelementptr inbounds %struct.flock, %struct.flock* %13, i32 0, i32 2
store i8* %20, i8** %21
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @fcntl(i32 %22, i32 %23, %struct.flock* %13)
ret i32 %24
}

LLVM IR (-O2):
%struct.flock = type { i32, i32, i8*, i8* }
define i32 @lock_reg(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4, i8* %5) {
%7 = alloca %struct.flock
%8 = bitcast %struct.flock* %7 to i8*
%9 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 0
store i32 %2, i32* %9
%10 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 3
store i8* %3, i8** %10
%11 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 1
store i32 %4, i32* %11
%12 = getelementptr inbounds %struct.flock, %struct.flock* %7, i64 0, i32 2
store i8* %5, i8** %12
%13 = call i32 @fcntl(i32 %0, i32 %1, %struct.flock* %7)
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *string();
int /*<<< orphan*/ strprint(int *);
int main() {
  int *x = string();
  int *y = string();
  *(y - 1) = 5;
  strprint(x);
  free(x);
  free(y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <string@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <string@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,-0x4(%rax)
mov    -0x8(%rbp),%rdi
call   1050 <strprint@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <string@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <string@plt>
mov    %rax,%rbx
movl   $0x5,-0x4(%rax)
mov    %r14,%rdi
call   1050 <strprint@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* (...) @string()
store i32* %3, i32** %1
%4 = call i32* (...) @string()
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 -1
store i32 5, i32* %6
%7 = load i32*, i32** %1
%8 = call i32 @strprint(i32* %7)
%9 = load i32*, i32** %1
%10 = call i32 @free(i32* %9)
%11 = load i32*, i32** %2
%12 = call i32 @free(i32* %11)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @string()
%2 = tail call i32* (...) @string()
%3 = getelementptr inbounds i32, i32* %2, i64 -1
store i32 5, i32* %3
%4 = tail call i32 @strprint(i32* %1)
%5 = tail call i32 @free(i32* %1)
%6 = tail call i32 @free(i32* %2)
ret i32 0
}
/* Variables and functions */
double cos(int);
double Cos(int a) { return cos(a * 180.0 / 3.1415926535); }


x86 assembly (clang, -O0):
<Cos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xecc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <cos@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cos>:
cvtsi2sd %edi,%xmm0
mulsd  0xee4(%rip),%xmm0
divsd  0xee4(%rip),%xmm0
cvttsd2si %xmm0,%edi
jmp    1030 <cos@plt>

LLVM IR (-O0):
define double @Cos(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 1.800000e+02
%6 = fdiv double %5, 0x400921FB54411744
%7 = fptosi double %6 to i32
%8 = call double @cos(i32 %7)
ret double %8
}

LLVM IR (-O2):
define double @Cos(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 1.800000e+02
%4 = fdiv double %3, 0x400921FB54411744
%5 = fptosi double %4 to i32
%6 = tail call double @cos(i32 %5)
ret double %6
}
int HelpItem153(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem153() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ search_replace_character(char *, char, char);
int /*<<< orphan*/ strcpy(char *, char *);
char toupper(char);
char *format_first_initial_capital(char *destination, char *string) {
  strcpy(destination, string);
  *destination = toupper(*destination);
  search_replace_character(destination, '_', ' ');
  return destination;
}


x86 assembly (clang, -O0):
<format_first_initial_capital>:
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 <strcpy@plt>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <toupper@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x5f,%esi
mov    $0x20,%edx
call   1050 <search_replace_character@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_first_initial_capital>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strcpy@plt>
movsbl (%rbx),%edi
call   1040 <toupper@plt>
mov    %al,(%rbx)
mov    %rbx,%rdi
mov    $0x5f,%esi
mov    $0x20,%edx
call   1050 <search_replace_character@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @format_first_initial_capital(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = load i8*, i8** %3
%9 = load i8, i8* %8
%10 = call signext i8 @toupper(i8 signext %9)
%11 = load i8*, i8** %3
store i8 %10, i8* %11
%12 = load i8*, i8** %3
%13 = call i32 @search_replace_character(i8* %12, i8 signext 95, i8 signext 32)
%14 = load i8*, i8** %3
ret i8* %14
}

LLVM IR (-O2):
define i8* @format_first_initial_capital(i8* returned %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = load i8, i8* %0
%5 = tail call signext i8 @toupper(i8 signext %4)
store i8 %5, i8* %0
%6 = tail call i32 @search_replace_character(i8* %0, i8 signext 95, i8 signext 32)
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = 1050;
  printf("%d", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1050)
ret i32 0
}
/* Variables and functions */
int fuzzyMatch(int, int, int);
int durationsMatch(int durationA, int durationB) {
  if ((durationA * durationB) == 0)
    return ((durationA + durationB) == 0);
  return fuzzyMatch(durationA, durationB, 100);
}


x86 assembly (clang, -O0):
<durationsMatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    $0x0,%eax
jne    1147 <durationsMatch+0x37>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    115a <durationsMatch+0x4a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x64,%edx
call   1030 <fuzzyMatch@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<durationsMatch>:
mov    %esi,%eax
imul   %edi,%eax
test   %eax,%eax
je     1123 <durationsMatch+0x13>
mov    $0x64,%edx
jmp    1030 <fuzzyMatch@plt>
xor    %eax,%eax
add    %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @durationsMatch(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = mul nsw i32 %6, %7
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
store i32 %15, i32* %3
br label %20
16: ; preds = %2
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = call i32 @fuzzyMatch(i32 %17, i32 %18, i32 100)
store i32 %19, i32* %3
br label %20
20: ; preds = %16, %10
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @durationsMatch(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = sub i32 0, %1
%7 = icmp eq i32 %6, %0
%8 = zext i1 %7 to i32
br label %11
9: ; preds = %2
%10 = tail call i32 @fuzzyMatch(i32 %0, i32 %1, i32 100)
br label %11
11: ; preds = %9, %5
%12 = phi i32 [ %8, %5 ], [ %10, %9 ]
ret i32 %12
}
int test_imm_8Duint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x8D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Duint64_lowword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
and    $0x8d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Duint64_lowword_mem>:
testb  $0x8d,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Duint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 141
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int workqueue_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @workqueue_init() {
ret i32 0
}
int add(int a, int b) {
  int c;
  c = a + b;
  return c;
}


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  float b;
  scanf("%3d", &a);
  printf("%d\n", a);
  scanf("%3d", &a);
  printf("%d\n", a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%r15
lea    0xc(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xeb9(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%3d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}
void cpu_relax(void) { __asm volatile("rep; nop" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @cpu_relax() {
tail call void asm sideeffect "rep; nop", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int CHAR_BIT;
size_t ULONG_MAX;
int __builtin_clzl(unsigned long);
int /*<<< orphan*/ assert(int);
size_t small_lb(size_t size) {
  assert(size <= ULONG_MAX);
  return sizeof(unsigned long) * CHAR_BIT -
         __builtin_clzl((unsigned long)size) - 1;
}


x86 assembly (clang, -O0):
<small_lb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2ea9(%rip),%rcx
cmp    (%rcx),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    0x2ea2(%rip),%rax
movslq (%rax),%rax
shl    $0x3,%rax
mov    -0x8(%rbp),%rcx
bsr    %rcx,%rcx
xor    $0x3f,%rcx
movslq %ecx,%rcx
sub    %rcx,%rax
sub    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<small_lb>:
push   %rbx
mov    %rdi,%rbx
mov    0x2eb5(%rip),%rax
xor    %edi,%edi
cmp    %rbx,(%rax)
setae  %dil
call   1030 <assert@plt>
mov    0x2eb0(%rip),%rax
movslq (%rax),%rax
bsr    %rbx,%rcx
xor    $0xffffffffffffffc0,%rcx
lea    (%rcx,%rax,8),%rax
pop    %rbx
ret

LLVM IR (-O0):
@ULONG_MAX = global i64 0
@CHAR_BIT = global i32 0
define i64 @small_lb(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @ULONG_MAX
%5 = icmp ule i64 %3, %4
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i32, i32* @CHAR_BIT
%9 = sext i32 %8 to i64
%10 = mul i64 8, %9
%11 = load i64, i64* %2
%12 = call i64 @llvm.ctlz.i64(i64 %11, i1 true)
%13 = trunc i64 %12 to i32
%14 = sext i32 %13 to i64
%15 = sub i64 %10, %14
%16 = sub i64 %15, 1
ret i64 %16
}

LLVM IR (-O2):
@ULONG_MAX = global i64 0
@CHAR_BIT = global i32 0
define i64 @small_lb(i64 %0) {
%2 = load i64, i64* @ULONG_MAX
%3 = icmp uge i64 %2, %0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = load i32, i32* @CHAR_BIT
%7 = sext i32 %6 to i64
%8 = shl nsw i64 %7, 3
%9 = tail call i64 @llvm.ctlz.i64(i64 %0, i1 true)
%10 = xor i64 %9, -1
%11 = add nsw i64 %8, %10
ret i64 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void putst_uart(uint8_t *str) { printf("%s", (char *)str); }


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

x86 assembly (clang, -O2):
<putst_uart>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @putst_uart(i32* %0) {
%2 = bitcast i32* %0 to i8*
%3 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
void *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(void *, char const *);
scalar_t__ strlen(char const *);
void *xstrdup(const char *s) {
  void *ret = malloc(strlen(s) + 1);
  assert(ret);
  strcpy(ret, s);
  return ret;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = call i32 @assert(i8* %8)
%10 = load i8*, i8** %3
%11 = load i8*, i8** %2
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @assert(i8* %4)
%6 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
struct ulz {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fork();
struct ulz *ulz_new(int /*<<< orphan*/ *);
void ulz_emo_cut(struct ulz *u) {
  struct ulz *uptr;
  if (!u) {
    uptr = ulz_new(NULL);
  } else {
    uptr = u;
  }
  do {
    fork();
  } while (1);
}


x86 assembly (clang, -O0):
<ulz_emo_cut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1149 <ulz_emo_cut+0x29>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <ulz_new@plt>
mov    %rax,-0x10(%rbp)
jmp    1151 <ulz_emo_cut+0x31>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1156 <ulz_emo_cut+0x36>
mov    $0x0,%al
call   1040 <fork@plt>
mov    $0x1,%al
test   $0x1,%al
jne    1156 <ulz_emo_cut+0x36>
jmp    116c <ulz_emo_cut+0x4c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulz_emo_cut>:
push   %rax
test   %rdi,%rdi
jne    1130 <ulz_emo_cut+0x10>
xor    %edi,%edi
call   1030 <ulz_new@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <fork@plt>
jmp    1130 <ulz_emo_cut+0x10>

LLVM IR (-O0):
%struct.ulz = type { i32 }
define void @ulz_emo_cut(%struct.ulz* %0) {
%2 = alloca %struct.ulz*
%3 = alloca %struct.ulz*
store %struct.ulz* %0, %struct.ulz** %2
%4 = load %struct.ulz*, %struct.ulz** %2
%5 = icmp ne %struct.ulz* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call %struct.ulz* @ulz_new(i32* null)
store %struct.ulz* %7, %struct.ulz** %3
br label %10
8: ; preds = %1
%9 = load %struct.ulz*, %struct.ulz** %2
store %struct.ulz* %9, %struct.ulz** %3
br label %10
10: ; preds = %8, %6
br label %11
11: ; preds = %13, %10
%12 = call i32 (...) @fork()
br label %13
13: ; preds = %11
br i1 true, label %11, label %14
14: ; preds = %13
ret void
}

LLVM IR (-O2):
%struct.ulz = type { i32 }
define void @ulz_emo_cut(%struct.ulz* readnone %0) {
%2 = icmp eq %struct.ulz* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call %struct.ulz* @ulz_new(i32* null)
br label %5
5: ; preds = %1, %3
br label %6
6: ; preds = %5, %6
%7 = tail call i32 (...) @fork()
br label %6
}
unsigned int log2pad(unsigned int v, int roundup) {
  unsigned int x = 1;
  while (x < v)
    x <<= 1;
  if (roundup == 0) {
    if (x > v) {
      x >>= 1;
    }
  }
  return x;
}


x86 assembly (clang, -O0):
<log2pad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    112b <log2pad+0x2b>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <log2pad+0x11>
cmpl   $0x0,-0x8(%rbp)
jne    114f <log2pad+0x4f>
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jbe    114a <log2pad+0x4a>
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <log2pad+0x4f>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<log2pad>:
mov    $0x1,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ecx,%eax
lea    (%rax,%rax,1),%ecx
cmp    %edi,%eax
jb     1110 <log2pad+0x10>
test   %esi,%esi
sete   %dl
cmp    %edi,%eax
seta   %cl
and    %dl,%cl
shr    %cl,%eax
ret

LLVM IR (-O0):
define i32 @log2pad(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 1, i32* %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %3
%9 = icmp ult i32 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* %5
%12 = shl i32 %11, 1
store i32 %12, i32* %5
br label %6
13: ; preds = %6
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %13
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = icmp ugt i32 %17, %18
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* %5
%22 = lshr i32 %21, 1
store i32 %22, i32* %5
br label %23
23: ; preds = %20, %16
br label %24
24: ; preds = %23, %13
%25 = load i32, i32* %5
ret i32 %25
}

LLVM IR (-O2):
define i32 @log2pad(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 1, %2 ], [ %6, %3 ]
%5 = icmp ult i32 %4, %0
%6 = shl i32 %4, 1
br i1 %5, label %3, label %7
7: ; preds = %3
%8 = icmp eq i32 %1, 0
%9 = icmp ugt i32 %4, %0
%10 = select i1 %8, i1 %9, i1 false
%11 = zext i1 %10 to i32
%12 = lshr i32 %4, %11
ret i32 %12
}
void gs_set_cursor_location(long display, long x, long y) {}


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

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

LLVM IR (-O0):
define void @gs_set_cursor_location(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
ret void
}

LLVM IR (-O2):
define void @gs_set_cursor_location(i64 %0, i64 %1, i64 %2) {
ret void
}
/* Variables and functions */
double acos(double);
double acos_wrapper(double *arg_list) { return (acos(arg_list[0])); }


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

x86 assembly (clang, -O2):
<acos_wrapper>:
movsd  (%rdi),%xmm0
jmp    1030 <acos@plt>

LLVM IR (-O0):
define double @acos_wrapper(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = call double @acos(double %5)
ret double %6
}

LLVM IR (-O2):
define double @acos_wrapper(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @acos(double %2)
ret double %3
}
/* Variables and functions */
scalar_t__ malloc(int);
void malloc_out_parameter_local_mutation_bad(int **x) {
  *x = (int *)malloc(sizeof(int));
  *x = NULL;
}


x86 assembly (clang, -O0):
<malloc_out_parameter_local_mutation_bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_out_parameter_local_mutation_bad>:
push   %rbx
mov    %rdi,%rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @malloc_out_parameter_local_mutation_bad(i32** %0) {
%2 = alloca i32**
store i32** %0, i32*** %2
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
%5 = load i32**, i32*** %2
store i32* %4, i32** %5
%6 = load i32**, i32*** %2
store i32* null, i32** %6
ret void
}

LLVM IR (-O2):
define void @malloc_out_parameter_local_mutation_bad(i32** nocapture writeonly %0) {
%2 = tail call i64 @malloc(i32 4)
store i32* null, i32** %0
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ usleep(int);
void nap(int t) { usleep(10000 + rand() % t); }


x86 assembly (clang, -O0):
<nap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
mov    %edx,%edi
add    $0x2710,%edi
call   1040 <usleep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nap>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x2710(%rdx),%edi
pop    %rbx
jmp    1040 <usleep@plt>

LLVM IR (-O0):
define void @nap(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @rand()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
%6 = add nsw i32 10000, %5
%7 = call i32 @usleep(i32 %6)
ret void
}

LLVM IR (-O2):
define void @nap(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 10000
%5 = tail call i32 @usleep(i32 %4)
ret void
}
double d1(double d) { return -d; }


x86 assembly (clang, -O0):
<d1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<d1>:
xorps  0xef9(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @d1(double %0) {
%2 = fneg double %0
ret double %2
}
/* Variables and functions */
int INT_MAX;
int factorial(int n) {
  int i;
  for (i = 0; i <= INT_MAX; i++)
    ;
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    0x2ed0(%rip),%rcx
cmp    (%rcx),%eax
jg     1133 <factorial+0x33>
jmp    1125 <factorial+0x25>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <factorial+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @factorial(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %10, %1
%6 = load i32, i32* %4
%7 = load i32, i32* @INT_MAX
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
store i32 %12, i32* %4
br label %5
13: ; preds = %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @factorial(i32 %0) {
ret i32 undef
}
/* Type definitions */
typedef long clock_t;

/* Variables and functions */
int CLOCKS_PER_SEC;
long clock();
void delay(int milliseconds) {
  long pause;
  clock_t now, then;
  pause = milliseconds * (CLOCKS_PER_SEC / 1000);
  now = then = clock();
  while ((now - then) < pause)
    now = clock();
  return;
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
imul   %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x20(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1171 <delay+0x61>
mov    $0x0,%al
call   1030 <clock@plt>
mov    %rax,-0x18(%rbp)
jmp    114f <delay+0x3f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
push   %r15
push   %r14
push   %rbx
mov    0x2ecc(%rip),%rax
movslq (%rax),%rax
imul   $0x10624dd3,%rax,%r14
mov    %r14,%rax
shr    $0x3f,%rax
sar    $0x26,%r14
add    %eax,%r14d
imul   %edi,%r14d
xor    %eax,%eax
call   1030 <clock@plt>
test   %r14d,%r14d
jle    115f <delay+0x4f>
mov    %rax,%r15
movslq %r14d,%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <clock@plt>
sub    %r15,%rax
cmp    %rbx,%rax
jl     1150 <delay+0x40>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* @CLOCKS_PER_SEC
%8 = sdiv i32 %7, 1000
%9 = mul nsw i32 %6, %8
%10 = sext i32 %9 to i64
store i64 %10, i64* %3
%11 = call i64 (...) @clock()
store i64 %11, i64* %5
store i64 %11, i64* %4
br label %12
12: ; preds = %18, %1
%13 = load i64, i64* %4
%14 = load i64, i64* %5
%15 = sub nsw i64 %13, %14
%16 = load i64, i64* %3
%17 = icmp slt i64 %15, %16
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = call i64 (...) @clock()
store i64 %19, i64* %4
br label %12
20: ; preds = %12
ret void
}

LLVM IR (-O2):
@CLOCKS_PER_SEC = global i32 0
define void @delay(i32 %0) {
%2 = load i32, i32* @CLOCKS_PER_SEC
%3 = sdiv i32 %2, 1000
%4 = mul nsw i32 %3, %0
%5 = sext i32 %4 to i64
%6 = tail call i64 (...) @clock()
%7 = icmp sgt i32 %4, 0
br i1 %7, label %8, label %12
8: ; preds = %1, %8
%9 = tail call i64 (...) @clock()
%10 = sub nsw i64 %9, %6
%11 = icmp slt i64 %10, %5
br i1 %11, label %8, label %12
12: ; preds = %8, %1
ret void
}
/* Type definitions */
struct Table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TableDeinit(struct Table *);
void HashTableDeinit(struct Table *table) { TableDeinit(table); }


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

x86 assembly (clang, -O2):
<HashTableDeinit>:
jmp    1030 <TableDeinit@plt>

LLVM IR (-O0):
%struct.Table = type { i32 }
define void @HashTableDeinit(%struct.Table* %0) {
%2 = alloca %struct.Table*
store %struct.Table* %0, %struct.Table** %2
%3 = load %struct.Table*, %struct.Table** %2
%4 = call i32 @TableDeinit(%struct.Table* %3)
ret void
}

LLVM IR (-O2):
%struct.Table = type { i32 }
define void @HashTableDeinit(%struct.Table* %0) {
%2 = tail call i32 @TableDeinit(%struct.Table* %0)
ret void
}
int f(char c, char *d) {
  typedef int muf;
  muf nia = 0;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i8 signext %0, i8* nocapture readnone %1) {
ret i32 undef
}
/* Type definitions */
typedef scalar_t__ pMem;

/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeShare(void *pMem) {
  if (--*(int *)((char *)(pMem)-4) == 0)
    free((char *)(pMem)-4);
}


x86 assembly (clang, -O0):
<FreeShare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x4(%rcx),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rcx)
cmp    $0x0,%eax
jne    113f <FreeShare+0x2f>
mov    -0x8(%rbp),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FreeShare>:
addl   $0xffffffff,-0x4(%rdi)
je     1117 <FreeShare+0x7>
ret
add    $0xfffffffffffffffc,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeShare(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 -4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
%7 = add nsw i32 %6, -1
store i32 %7, i32* %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 -4
%12 = call i32 @free(i8* %11)
br label %13
13: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
define void @FreeShare(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 -4
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, -1
store i32 %5, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @free(i8* %2)
br label %9
9: ; preds = %7, %1
ret void
}
unsigned long long int atoll(char *s) {
  char *ss = s;
  unsigned long long int num = 0;
  while (*ss) {
    num = num * 10;
    num = num + (int)(*ss - '0');
    ss++;
  }
  return num;
}


x86 assembly (clang, -O0):
<atoll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <atoll+0x57>
imul   $0xa,-0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <atoll+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoll>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <atoll+0x2c>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%rax
movsbq %cl,%rcx
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoll+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @atoll(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = mul i64 %6, 10
%9 = sext i8 %5 to i64
%10 = add i64 %8, -48
%11 = add i64 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 0, %1 ], [ %11, %4 ]
ret i64 %16
}