xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ GPIOPadConfigSet(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                    int);
void GPIOPinTypeEthernetLED(uint32_t ui32Port, uint8_t ui8Pins) {
  ;
  GPIODirModeSet(ui32Port, ui8Pins, 0x00000002);
  GPIOPadConfigSet(ui32Port, ui8Pins, 0x00000004, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeEthernetLED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x4,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeEthernetLED>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x4,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeEthernetLED(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @GPIODirModeSet(i32 %5, i32 %6, i32 2)
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 @GPIOPadConfigSet(i32 %8, i32 %9, i32 4, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeEthernetLED(i32 %0, i32 %1) {
%3 = tail call i32 @GPIODirModeSet(i32 %0, i32 %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i32 %0, i32 %1, i32 4, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *);
void sprint_rrc(char *str) { sprintf(str, "RRC   A                         "); }


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

x86 assembly (clang, -O2):
<sprint_rrc>:
movups 0xf09(%rip),%xmm0
movups %xmm0,0x10(%rdi)
movups 0xeee(%rip),%xmm0
movups %xmm0,(%rdi)
movb   $0x0,0x20(%rdi)
ret

LLVM IR (-O0):
@.str = [33 x i8] c"RRC A \00"
define void @sprint_rrc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"RRC A \00"
define void @sprint_rrc(i8* nocapture writeonly %0) {
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(33) %0, i8* align 1 dereferenceable(33) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i64 33, i1 false)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int xlinkat(int olddirfd, const char *oldpath, int newdirfd,
            const char *newpath, int flags) {
  (void)olddirfd;
  (void)oldpath;
  (void)newdirfd;
  (void)newpath;
  (void)flags;
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<xlinkat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
mov    0x2eba(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlinkat>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @xlinkat(i32 %0, i8* %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i32, i32* %10
%16 = load i32, i32* @EINVAL
store i32 %16, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @xlinkat(i32 %0, i8* nocapture readnone %1, i32 %2, i8* nocapture readnone %3, i32 %4) {
%6 = load i32, i32* @EINVAL
store i32 %6, i32* @errno
ret i32 -1
}
long set_sign(long word, int nbytes) {
  static mask_bit[4] = {0x00000080, 0x00008000, 0x00800000, 0x80000000};
  static mask_val[4] = {0x0000007f, 0x00007fff, 0x007fffff, 0x7fffffff};
  long newval;
  newval = word & mask_val[nbytes - 1];
  if ((word & mask_bit[nbytes - 1]) > 0)
    newval = -newval;
  return newval;
}


x86 assembly (clang, -O0):
<set_sign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2f21(%rip),%rcx
movslq (%rcx,%rdx,4),%rcx
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rdx
lea    0x2ef2(%rip),%rcx
movslq (%rcx,%rdx,4),%rcx
and    %rcx,%rax
cmp    $0x0,%rax
jle    1159 <set_sign+0x59>
xor    %eax,%eax
sub    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_sign>:
movslq %esi,%rax
lea    0xf06(%rip),%rcx
movslq -0x4(%rcx,%rax,4),%rcx
and    %rdi,%rcx
lea    0xee7(%rip),%rdx
movslq -0x4(%rdx,%rax,4),%rdx
mov    %rcx,%rax
neg    %rax
test   %rdi,%rdx
cmovle %rcx,%rax
ret

LLVM IR (-O0):
@set_sign.mask_bit = internal global [4 x i32] [i32 128, i32 32768, i32 8388608, i32 -2147483648]
@set_sign.mask_val = internal global [4 x i32] [i32 127, i32 32767, i32 8388607, i32 2147483647]
define i64 @set_sign(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i64 %0, i64* %3
store i32 %1, i32* %4
%6 = load i64, i64* %3
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [4 x i32], [4 x i32]* @set_sign.mask_val, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = and i64 %6, %12
store i64 %13, i64* %5
%14 = load i64, i64* %3
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [4 x i32], [4 x i32]* @set_sign.mask_bit, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = sext i32 %19 to i64
%21 = and i64 %14, %20
%22 = icmp sgt i64 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %2
%24 = load i64, i64* %5
%25 = sub nsw i64 0, %24
store i64 %25, i64* %5
br label %26
26: ; preds = %23, %2
%27 = load i64, i64* %5
ret i64 %27
}

LLVM IR (-O2):
@set_sign.mask_bit = internal unnamed_addr constant [4 x i32] [i32 128, i32 32768, i32 8388608, i32 -2147483648]
@set_sign.mask_val = internal unnamed_addr constant [4 x i32] [i32 127, i32 32767, i32 8388607, i32 2147483647]
define i64 @set_sign(i64 %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @set_sign.mask_val, i64 0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %6 to i64
%8 = and i64 %7, %0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* @set_sign.mask_bit, i64 0, i64 %4
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = and i64 %11, %0
%13 = icmp sgt i64 %12, 0
%14 = sub nsw i64 0, %8
%15 = select i1 %13, i64 %14, i64 %8
ret i64 %15
}
/* Variables and functions */
int /*<<< orphan*/ rankOf(int);
int square(int /*<<< orphan*/, int);
int castleKingTo(int king, int rook) {
  return square(rankOf(king), (rook > king) ? 6 : 2);
}


x86 assembly (clang, -O0):
<castleKingTo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rankOf@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%edx
mov    $0x2,%esi
mov    $0x6,%eax
cmp    %edx,%ecx
cmovg  %eax,%esi
call   1040 <square@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<castleKingTo>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <rankOf@plt>
xor    %ecx,%ecx
cmp    %ebp,%ebx
setg   %cl
lea    0x2(,%rcx,4),%esi
mov    %eax,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <square@plt>

LLVM IR (-O0):
define i32 @castleKingTo(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 = call i32 @rankOf(i32 %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp sgt i32 %7, %8
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 6, i32 2
%12 = call i32 @square(i32 %6, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @castleKingTo(i32 %0, i32 %1) {
%3 = tail call i32 @rankOf(i32 %0)
%4 = icmp sgt i32 %1, %0
%5 = select i1 %4, i32 6, i32 2
%6 = tail call i32 @square(i32 %3, i32 %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open_sysfs(char const *, char const *, int /*<<< orphan*/);
float read_sysfs_float_fd(int, char const *, char const *);
float read_sysfs_float(const char *sys_pfx, const char *node) {
  int fd;
  float val;
  fd = open_sysfs(sys_pfx, node, O_RDONLY);
  val = read_sysfs_float_fd(fd, sys_pfx, node);
  close(fd);
  return val;
}


x86 assembly (clang, -O0):
<read_sysfs_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2e99(%rip),%rax
mov    (%rax),%edx
call   1040 <open_sysfs@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <read_sysfs_float_fd@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <close@plt>
movss  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_sysfs_float>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
call   1040 <open_sysfs@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <read_sysfs_float_fd@plt>
movss  %xmm0,0xc(%rsp)
mov    %ebp,%edi
call   1050 <close@plt>
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
define float @read_sysfs_float(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca float
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = load i32, i32* @O_RDONLY
%10 = call i32 @open_sysfs(i8* %7, i8* %8, i32 %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call float @read_sysfs_float_fd(i32 %11, i8* %12, i8* %13)
store float %14, float* %6
%15 = load i32, i32* %5
%16 = call i32 @close(i32 %15)
%17 = load float, float* %6
ret float %17
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
define float @read_sysfs_float(i8* %0, i8* %1) {
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open_sysfs(i8* %0, i8* %1, i32 %3)
%5 = tail call float @read_sysfs_float_fd(i32 %4, i8* %0, i8* %1)
%6 = tail call i32 @close(i32 %4)
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printProcessorStatus();
void testsuite_printStatus() { printProcessorStatus(); }


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

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

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

LLVM IR (-O2):
define void @testsuite_printStatus() {
%1 = tail call i32 (...) @printProcessorStatus()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void mov_reg16_m16(int reg16, unsigned short *m16) {
  put8(0x66);
  put8(0x8B);
  put8((reg16 << 3) | 5);
  put32((unsigned int)(m16));
}


x86 assembly (clang, -O0):
<mov_reg16_m16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mov_reg16_m16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x66,%edi
call   1030 <put8@plt>
mov    $0x8b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @mov_reg16_m16(i32 %0, i16* %1) {
%3 = alloca i32
%4 = alloca i16*
store i32 %0, i32* %3
store i16* %1, i16** %4
%5 = call i32 @put8(i32 102)
%6 = call i32 @put8(i32 139)
%7 = load i32, i32* %3
%8 = shl i32 %7, 3
%9 = or i32 %8, 5
%10 = call i32 @put8(i32 %9)
%11 = load i16*, i16** %4
%12 = ptrtoint i16* %11 to i32
%13 = call i32 @put32(i32 %12)
ret void
}

LLVM IR (-O2):
define void @mov_reg16_m16(i32 %0, i16* %1) {
%3 = tail call i32 @put8(i32 102)
%4 = tail call i32 @put8(i32 139)
%5 = shl i32 %0, 3
%6 = or i32 %5, 5
%7 = tail call i32 @put8(i32 %6)
%8 = ptrtoint i16* %1 to i64
%9 = trunc i64 %8 to i32
%10 = tail call i32 @put32(i32 %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
void *handler(void *sockv) {
  int sock = *((int *)sockv);
  write(sock, "Hello, World!", 14);
  return sockv;
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xed1(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
lea    0xee3(%rip),%rsi
mov    $0xe,%edx
call   1030 <write@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, World!\00"
define i8* @handler(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @write(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 14)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, World!\00"
define i8* @handler(i8* returned %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @write(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 14)
ret i8* %0
}
void foo() {
  int i;
  int a[100];
  for (i = 0; i <= 99; i += 1) {
    a[i] = a[i] + a[0];
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x63,-0x4(%rbp)
jg     1146 <foo+0x46>
movslq -0x4(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%ecx
add    -0x1a0(%rbp),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x1a0(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1112 <foo+0x12>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x118,%rsp
mov    $0x3,%eax
nopl   0x0(%rax)
mov    -0x80(%rsp),%ecx
add    %ecx,-0x88(%rsp,%rax,4)
mov    -0x80(%rsp),%ecx
add    %ecx,-0x84(%rsp,%rax,4)
mov    -0x80(%rsp),%ecx
add    %ecx,-0x80(%rsp,%rax,4)
add    $0x3,%rax
cmp    $0x66,%rax
jne    1110 <foo+0x10>
add    $0x118,%rsp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca [100 x i32]
store i32 0, i32* %1
br label %3
3: ; preds = %17, %0
%4 = load i32, i32* %1
%5 = icmp sle i32 %4, 99
br i1 %5, label %6, label %20
6: ; preds = %3
%7 = load i32, i32* %1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %6
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %3
20: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
br label %4
4: ; preds = %4, %0
%5 = phi i64 [ 1, %0 ], [ %23, %4 ]
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %5
%7 = load i32, i32* %6
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
%10 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %5
store i32 %9, i32* %10
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %11
store i32 %15, i32* %16
%17 = add nuw nsw i64 %5, 2
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %3
%21 = add nsw i32 %20, %19
%22 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %17
store i32 %21, i32* %22
%23 = add nuw nsw i64 %5, 3
%24 = icmp eq i64 %23, 100
br i1 %24, label %25, label %4
25: ; preds = %4
ret void
}
int ft_tolower(int c) {
  if (c >= (unsigned char)'A' && c <= (unsigned char)'Z')
    return (c + 32);
  return (c);
}


x86 assembly (clang, -O0):
<ft_tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1129 <ft_tolower+0x29>
cmpl   $0x5a,-0x8(%rbp)
jg     1129 <ft_tolower+0x29>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
jmp    112f <ft_tolower+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int rand();
int /*<<< orphan*/ srand(int);
int main() {
  srand(100);
  printf("%d\n", rand());
  printf("%d\n", rand());
  printf("%d\n", rand());
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @srand(i32 100)
%2 = tail call i32 (...) @rand()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (...) @rand()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 (...) @rand()
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sink(void *);
int /*<<< orphan*/ strcpy(void *, char *);
void *usr_alloc2(int, int);
void usr_alloc2_cst_ir_strcpy(int n) {
  void *p = usr_alloc2(1, 5 < n ? 5 : n);
  strcpy(p, "01234");
  sink(p);
  strcpy(p, "0123");
  sink(p);
}


x86 assembly (clang, -O0):
<usr_alloc2_cst_ir_strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x5,%eax
cmp    -0x4(%rbp),%eax
jge    1156 <usr_alloc2_cst_ir_strcpy+0x26>
mov    $0x5,%eax
mov    %eax,-0x14(%rbp)
jmp    115c <usr_alloc2_cst_ir_strcpy+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x1,%edi
call   1040 <usr_alloc2@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe88(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1050 <sink@plt>
mov    -0x10(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rdi
call   1050 <sink@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usr_alloc2_cst_ir_strcpy>:
push   %rbx
cmp    $0x5,%edi
mov    $0x5,%esi
cmovl  %edi,%esi
mov    $0x1,%edi
call   1040 <usr_alloc2@plt>
mov    %rax,%rbx
lea    0xeb0(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1050 <sink@plt>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1050 <sink@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"01234\00"
@.str.1 = [5 x i8] c"0123\00"
define void @usr_alloc2_cst_ir_strcpy(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 5, %4
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %9
9: ; preds = %7, %6
%10 = phi i32 [ 5, %6 ], [ %8, %7 ]
%11 = call i8* @usr_alloc2(i32 1, i32 %10)
store i8* %11, i8** %3
%12 = load i8*, i8** %3
%13 = call i32 @strcpy(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%14 = load i8*, i8** %3
%15 = call i32 @sink(i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @strcpy(i8* %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%18 = load i8*, i8** %3
%19 = call i32 @sink(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"01234\00"
@.str.1 = [5 x i8] c"0123\00"
define void @usr_alloc2_cst_ir_strcpy(i32 %0) {
%2 = icmp slt i32 %0, 5
%3 = select i1 %2, i32 %0, i32 5
%4 = tail call i8* @usr_alloc2(i32 1, i32 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @sink(i8* %4)
%7 = tail call i32 @strcpy(i8* %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @sink(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int);
int main() {
  int c;
  c = sum(5, 10);
  printf("Sum of 5 and 10 is: %d\n", c);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [24 x i8] c"Sum of 5 and 10 is: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 5, i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("The 1500'th ugly number is 859963392.\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"The 1500'th ugly number is 859963392.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"The 1500'th ugly number is 859963392.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
long SIO1keypressed(int key) { return 0; }


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

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

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

LLVM IR (-O2):
define i64 @SIO1keypressed(i32 %0) {
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void test() { printf("Hello World\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define void @test() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
void nullcamera_stop(void *data) {}


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

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

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

LLVM IR (-O2):
define void @nullcamera_stop(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
char *strtoupper(char *psz) {
  int iLen = strlen(psz);
  int iPos;
  for (iPos = 0; iPos < iLen; iPos++)
    psz[iPos] = toupper(psz[iPos]);
  return psz;
}


x86 assembly (clang, -O0):
<strtoupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1177 <strtoupper+0x57>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <strtoupper+0x1f>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtoupper>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
jle    1157 <strtoupper+0x37>
mov    %eax,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1140 <strtoupper+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strtoupper(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1
%5 = zext i32 %2 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call signext i8 @toupper(i8 signext %9)
store i8 %10, i8* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %1
ret i8* %0
}
int cmp_less_fp128(const void *p, const void *q) {
  const long double a = *(const long double *)p;
  const long double b = *(const long double *)q;
  if (a > b)
    return +1;
  if (b > a)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_less_fp128>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
fldt   (%rax)
fstpt  -0x30(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fstpt  -0x40(%rbp)
fldt   -0x30(%rbp)
fldt   -0x40(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1141 <cmp_less_fp128+0x41>
jmp    1135 <cmp_less_fp128+0x35>
movl   $0x1,-0x4(%rbp)
jmp    116b <cmp_less_fp128+0x6b>
fldt   -0x40(%rbp)
fldt   -0x30(%rbp)
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jbe    1164 <cmp_less_fp128+0x64>
jmp    1158 <cmp_less_fp128+0x58>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <cmp_less_fp128+0x6b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_less_fp128>:
fldt   (%rdi)
fldt   (%rsi)
xor    %ecx,%ecx
fucomi %st(1),%st
seta   %cl
neg    %ecx
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_less_fp128(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca x86_fp80
%7 = alloca x86_fp80
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to x86_fp80*
%10 = load x86_fp80, x86_fp80* %9
store x86_fp80 %10, x86_fp80* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to x86_fp80*
%13 = load x86_fp80, x86_fp80* %12
store x86_fp80 %13, x86_fp80* %7
%14 = load x86_fp80, x86_fp80* %6
%15 = load x86_fp80, x86_fp80* %7
%16 = fcmp ogt x86_fp80 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 1, i32* %3
br label %24
18: ; preds = %2
%19 = load x86_fp80, x86_fp80* %7
%20 = load x86_fp80, x86_fp80* %6
%21 = fcmp ogt x86_fp80 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 -1, i32* %3
br label %24
23: ; preds = %18
store i32 0, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @cmp_less_fp128(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to x86_fp80*
%4 = load x86_fp80, x86_fp80* %3
%5 = bitcast i8* %1 to x86_fp80*
%6 = load x86_fp80, x86_fp80* %5
%7 = fcmp ogt x86_fp80 %4, %6
%8 = fcmp ogt x86_fp80 %6, %4
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
double s_high(int);
double s_low(double a) { return 1 - s_high(1 - a); }


x86 assembly (clang, -O0):
<s_low>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <s_high@plt>
movaps %xmm0,%xmm1
movsd  0xec2(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_low>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <s_high@plt>
movsd  0xed2(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @s_low(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call double @s_high(i32 %5)
%7 = fsub double 1.000000e+00, %6
ret double %7
}

LLVM IR (-O2):
define double @s_low(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call double @s_high(i32 %3)
%5 = fsub double 1.000000e+00, %4
ret double %5
}
/* Type definitions */
struct i8x_object {
  int dummy;
};
struct i8x_chunk {
  int dummy;
};

/* Variables and functions */
scalar_t__ i8x_ob_unref(struct i8x_object *);
struct i8x_chunk *__attribute__((always_))
i8x_chunk_unref(struct i8x_chunk *x) {
  return (struct i8x_chunk *)i8x_ob_unref((struct i8x_object *)x);
}


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

x86 assembly (clang, -O2):
<i8x_chunk_unref>:
jmp    1030 <i8x_ob_unref@plt>

LLVM IR (-O0):
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_chunk* @i8x_chunk_unref(%struct.i8x_chunk* %0) {
%2 = alloca %struct.i8x_chunk*
store %struct.i8x_chunk* %0, %struct.i8x_chunk** %2
%3 = load %struct.i8x_chunk*, %struct.i8x_chunk** %2
%4 = bitcast %struct.i8x_chunk* %3 to %struct.i8x_object*
%5 = call i64 @i8x_ob_unref(%struct.i8x_object* %4)
%6 = inttoptr i64 %5 to %struct.i8x_chunk*
ret %struct.i8x_chunk* %6
}

LLVM IR (-O2):
%struct.i8x_chunk = type { i32 }
%struct.i8x_object = type { i32 }
define %struct.i8x_chunk* @i8x_chunk_unref(%struct.i8x_chunk* %0) {
%2 = bitcast %struct.i8x_chunk* %0 to %struct.i8x_object*
%3 = tail call i64 @i8x_ob_unref(%struct.i8x_object* %2)
%4 = inttoptr i64 %3 to %struct.i8x_chunk*
ret %struct.i8x_chunk* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ __off_t;

/* Variables and functions */
int /*<<< orphan*/ dll_lseek(int, int /*<<< orphan*/, int);
__off_t __wrap_lseek(int filedes, __off_t offset, int whence) {
  return dll_lseek(filedes, offset, whence);
}


x86 assembly (clang, -O0):
<__wrap_lseek>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <dll_lseek@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wrap_lseek>:
jmp    1030 <dll_lseek@plt>

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

LLVM IR (-O2):
define i32 @__wrap_lseek(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @dll_lseek(i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ printf(char *);
void foo(void) {
  char *s;
  printf("malloc: start, calling malloc ...\n");
  s = malloc(10);
  printf("malloc: called malloc, calling free ...\n");
  free(s);
  printf("malloc: called free, returning ...\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
lea    0xede(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xed1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
lea    0xee5(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"malloc: start, calling malloc ...\0A\00"
@.str.1 = [41 x i8] c"malloc: called malloc, calling free ...\0A\00"
@.str.2 = [36 x i8] c"malloc: called free, returning ...\0A\00"
define void @foo() {
%1 = alloca i8*
%2 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%3 = call i8* @malloc(i32 10)
store i8* %3, i8** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%5 = load i8*, i8** %1
%6 = call i32 @free(i8* %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"malloc: start, calling malloc ...\00"
@str.3 = [40 x i8] c"malloc: called malloc, calling free ...\00"
@str.4 = [35 x i8] c"malloc: called free, returning ...\00"
define void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(10) i8* @malloc(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.3, i64 0, i64 0))
%4 = tail call i32 @free(i8* %2)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DMA_ERROR_DriverIRQHandler();
__attribute__((weak)) void DMA_ERROR_IRQHandler(void) {
  DMA_ERROR_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @DMA_ERROR_IRQHandler() {
%1 = call i32 (...) @DMA_ERROR_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @DMA_ERROR_IRQHandler() {
%1 = tail call i32 (...) @DMA_ERROR_DriverIRQHandler()
ret void
}
/* Variables and functions */
unsigned long long _bzhi_u64(unsigned long long, int /*<<< orphan*/);
unsigned long long f22(unsigned long long x) { return _bzhi_u64(x, 0); }


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

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

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

LLVM IR (-O2):
define i64 @f22(i64 %0) {
%2 = tail call i64 @_bzhi_u64(i64 %0, i32 0)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int binarySearch(int *, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int array[] = {5, 6, 7, 8, 9, 10};
  int n, key;
  n = sizeof(array) / sizeof(array[0]);
  key = 10;
  printf("Index: %d\n", binarySearch(array, 0, n, key));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x6,-0x24(%rbp)
movl   $0xa,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
xor    %esi,%esi
call   1040 <binarySearch@plt>
mov    %eax,%esi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x6,%edx
mov    $0xa,%ecx
call   1040 <binarySearch@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.array = [6 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9, i32 10]
@.str = [11 x i8] c"Index: %d\0A\00"
define i32 @main() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @binarySearch(i32* %3, i32 0, i32 6, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
FILE *UTIL_fopenR(char *filename) {
  FILE *filePtr = fopen(filename, "r");
  if (filePtr)
    return filePtr;
  printf("Error : cannot open input file %s\n", filename);
  exit(1);
}


x86 assembly (clang, -O0):
<UTIL_fopenR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1165 <UTIL_fopenR+0x35>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<UTIL_fopenR>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1147 <UTIL_fopenR+0x17>
pop    %rbx
ret
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [35 x i8] c"Error : cannot open input file %s\0A\00"
define i32* @UTIL_fopenR(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i32*, i32** %3
ret i32* %9
10: ; preds = %1
%11 = load i8*, i8** %2
%12 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [35 x i8] c"Error : cannot open input file %s\0A\00"
define noalias i32* @UTIL_fopenR(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i32* %2
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%7 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
size_t ZBUFF_recommendedCInSize() { return (128 * 1024); }


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

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

LLVM IR (-O0):
define i64 @ZBUFF_recommendedCInSize() {
ret i64 131072
}

LLVM IR (-O2):
define i64 @ZBUFF_recommendedCInSize() {
ret i64 131072
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ syscall_exit(int /*<<< orphan*/);
int main() {
  char *data1;
  char *data3;
  data1 = (char *)malloc(1);
  data1[0] = '1';
  data3 = (char *)malloc(3);
  data3[0] = '3';
  data3[1] = '4';
  data3[2] = '5';
  free(data3);
  free(data1);
  syscall_exit(0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x31,(%rax)
mov    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movb   $0x33,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x34,0x1(%rax)
mov    -0x18(%rbp),%rax
movb   $0x35,0x2(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1040 <syscall_exit@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movb   $0x31,(%rax)
mov    $0x3,%edi
call   1050 <malloc@plt>
movw   $0x3433,(%rax)
movb   $0x35,0x2(%rax)
mov    %rax,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1040 <syscall_exit@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
%4 = call i64 @malloc(i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
store i8 49, i8* %7
%8 = call i64 @malloc(i32 3)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %3
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
store i8 51, i8* %11
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8 52, i8* %13
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 2
store i8 53, i8* %15
%16 = load i8*, i8** %3
%17 = call i32 @free(i8* %16)
%18 = load i8*, i8** %2
%19 = call i32 @free(i8* %18)
%20 = call i32 @syscall_exit(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 1)
%2 = inttoptr i64 %1 to i8*
store i8 49, i8* %2
%3 = tail call i64 @malloc(i32 3)
%4 = inttoptr i64 %3 to i8*
store i8 51, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8 52, i8* %5
%6 = getelementptr inbounds i8, i8* %4, i64 2
store i8 53, i8* %6
%7 = tail call i32 @free(i8* %4)
%8 = tail call i32 @free(i8* %2)
%9 = tail call i32 @syscall_exit(i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fun(int);
int /*<<< orphan*/ fun1(int);
int main() {
  fun(0);
  fun(1);
  fun1(0);
  fun1(1);
  fun1(2);
  fun1(242);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <fun@plt>
mov    $0x1,%edi
call   1030 <fun@plt>
xor    %edi,%edi
call   1040 <fun1@plt>
mov    $0x1,%edi
call   1040 <fun1@plt>
mov    $0x2,%edi
call   1040 <fun1@plt>
mov    $0xf2,%edi
call   1040 <fun1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <fun@plt>
mov    $0x1,%edi
call   1030 <fun@plt>
xor    %edi,%edi
call   1040 <fun1@plt>
mov    $0x1,%edi
call   1040 <fun1@plt>
mov    $0x2,%edi
call   1040 <fun1@plt>
mov    $0xf2,%edi
call   1040 <fun1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fun(i32 0)
%3 = call i32 @fun(i32 1)
%4 = call i32 @fun1(i32 0)
%5 = call i32 @fun1(i32 1)
%6 = call i32 @fun1(i32 2)
%7 = call i32 @fun1(i32 242)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fun(i32 0)
%2 = tail call i32 @fun(i32 1)
%3 = tail call i32 @fun1(i32 0)
%4 = tail call i32 @fun1(i32 1)
%5 = tail call i32 @fun1(i32 2)
%6 = tail call i32 @fun1(i32 242)
ret i32 0
}