xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void badvpn_write_be16(uint16_t x, char *c_ptr) {
  uint8_t *ptr = (uint8_t *)c_ptr;
  ptr[0] = x >> 8;
  ptr[1] = x >> 0;
}


x86 assembly (clang, -O0):
<badvpn_write_be16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<badvpn_write_be16>:
mov    %edi,%eax
sar    $0x8,%eax
mov    %eax,(%rsi)
mov    %edi,0x4(%rsi)
ret

LLVM IR (-O0):
define void @badvpn_write_be16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32, i32* %3
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %3
%13 = ashr i32 %12, 0
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
ret void
}

LLVM IR (-O2):
define void @badvpn_write_be16(i32 %0, i8* nocapture writeonly %1) {
%3 = bitcast i8* %1 to i32*
%4 = ashr i32 %0, 8
store i32 %4, i32* %3
%5 = getelementptr inbounds i8, i8* %1, i64 4
%6 = bitcast i8* %5 to i32*
store i32 %0, i32* %6
ret void
}
float divisao(float a, float b) { return a / b; }


x86 assembly (clang, -O0):
<divisao>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<divisao>:
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @divisao(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fdiv float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @divisao(float %0, float %1) {
%3 = fdiv float %0, %1
ret float %3
}
/* Variables and functions */
long xstrtoll_range(char const *, int, long, long);
__attribute__((always_)) long xstrtol_range(const char *str, int b, long l,
                                            long u) {
  return xstrtoll_range(str, b, l, u);
}


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

x86 assembly (clang, -O2):
<xstrtol_range>:
jmp    1030 <xstrtoll_range@plt>

LLVM IR (-O0):
define i64 @xstrtol_range(i8* %0, i32 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i8* %0, i8** %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = call i64 @xstrtoll_range(i8* %9, i32 %10, i64 %11, i64 %12)
ret i64 %13
}

LLVM IR (-O2):
define i64 @xstrtol_range(i8* %0, i32 %1, i64 %2, i64 %3) {
%5 = tail call i64 @xstrtoll_range(i8* %0, i32 %1, i64 %2, i64 %3)
ret i64 %5
}
void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list) {}


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

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

LLVM IR (-O0):
%struct.device = type opaque
%struct.list_head = type opaque
define void @iommu_dma_get_resv_regions(%struct.device* %0, %struct.list_head* %1) {
%3 = alloca %struct.device*
%4 = alloca %struct.list_head*
store %struct.device* %0, %struct.device** %3
store %struct.list_head* %1, %struct.list_head** %4
ret void
}

LLVM IR (-O2):
%struct.device = type opaque
%struct.list_head = type opaque
define void @iommu_dma_get_resv_regions(%struct.device* nocapture %0, %struct.list_head* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int search(int *, int);
int main() {
  int arr[] = {-1, 2, 3, 1, 5};
  arr[0] = sizeof(arr) / sizeof(arr[0]) - 1;
  int find = 1;
  printf("Position of %d is %d\n", find, search(arr, find));
  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    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x4,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <search@plt>
mov    -0x28(%rbp),%esi
mov    %eax,%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0xedb(%rip),%eax
mov    %eax,0x10(%rsp)
movl   $0x4,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1040 <search@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [5 x i32] [i32 -1, i32 2, i32 3, i32 1, i32 5]
@.str = [22 x i8] c"Position of %d is %d\0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
store i32 4, i32* %3
%4 = call i32 @search(i32* %3, i32 1)
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 1, i32 %4)
ret i32 0
}
void setup_iomux_lcd(void) {}


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

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

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

LLVM IR (-O2):
define void @setup_iomux_lcd() {
ret void
}
int gettimeofday(struct timeval *tv, void *tz) { return 0; }


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

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

LLVM IR (-O0):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type opaque
define i32 @gettimeofday(%struct.timeval* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
void slab_heapinfo_deinit(void) {}


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

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

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

LLVM IR (-O2):
define void @slab_heapinfo_deinit() {
ret void
}
/* Variables and functions */
scalar_t__ SD_sendCommand(int, unsigned long);
scalar_t__ receive_DataBlock(unsigned char *, int);
unsigned char SD_readSingleBlock(unsigned char *buff,
                                 unsigned long startBlock) {
  if (SD_sendCommand((0x40 + 17), startBlock << 9))
    return 1;
  if (receive_DataBlock(buff, 512))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<SD_readSingleBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
shl    $0x9,%rsi
mov    $0x51,%edi
call   1030 <SD_sendCommand@plt>
cmp    $0x0,%rax
je     1155 <SD_readSingleBlock+0x35>
movb   $0x1,-0x1(%rbp)
jmp    117a <SD_readSingleBlock+0x5a>
mov    -0x10(%rbp),%rdi
mov    $0x200,%esi
call   1040 <receive_DataBlock@plt>
cmp    $0x0,%rax
je     1176 <SD_readSingleBlock+0x56>
movb   $0x1,-0x1(%rbp)
jmp    117a <SD_readSingleBlock+0x5a>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SD_readSingleBlock>:
push   %rbx
mov    %rdi,%rbx
shl    $0x9,%rsi
mov    $0x51,%edi
call   1030 <SD_sendCommand@plt>
mov    %rax,%rcx
mov    $0x1,%al
test   %rcx,%rcx
je     113e <SD_readSingleBlock+0x1e>
pop    %rbx
ret
mov    %rbx,%rdi
mov    $0x200,%esi
call   1040 <receive_DataBlock@plt>
test   %rax,%rax
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @SD_readSingleBlock(i8* %0, i64 %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = shl i64 %6, 9
%8 = call i64 @SD_sendCommand(i32 81, i64 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i8 1, i8* %3
br label %17
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = call i64 @receive_DataBlock(i8* %12, i32 512)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %11
store i8 1, i8* %3
br label %17
16: ; preds = %11
store i8 0, i8* %3
br label %17
17: ; preds = %16, %15, %10
%18 = load i8, i8* %3
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @SD_readSingleBlock(i8* %0, i64 %1) {
%3 = shl i64 %1, 9
%4 = tail call i64 @SD_sendCommand(i32 81, i64 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @receive_DataBlock(i8* %0, i32 512)
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i8
br label %10
10: ; preds = %6, %2
%11 = phi i8 [ 1, %2 ], [ %9, %6 ]
ret i8 %11
}
/* Variables and functions */
int /*<<< orphan*/ nocall(char *);
void initpass(void) { nocall("initpass"); }


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"initpass\00"
define void @initpass() {
%1 = call i32 @nocall(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"initpass\00"
define void @initpass() {
%1 = tail call i32 @nocall(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo_2_2_2_1_1_1_1_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_1_1_1_1_2() {
ret void
}
/* Variables and functions */
int countDigits(int);
int getDigit(int n, int num) {
  int counter;
  int numcnt = countDigits(n) - num;
  do {
    counter = n % 10;
    n /= 10;
    numcnt--;
  } while (numcnt > 0);
  return counter;
}


x86 assembly (clang, -O0):
<getDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <countDigits@plt>
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jg     112c <getDigit+0x1c>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDigit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <countDigits@plt>
sub    %ebp,%eax
add    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebx,%ecx
movslq %ebx,%rdx
imul   $0x66666667,%rdx,%rbx
mov    %rbx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rbx
add    %edx,%ebx
add    $0xffffffff,%eax
cmp    $0x1,%eax
jg     1130 <getDigit+0x20>
add    %ebx,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%ecx
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getDigit(i32 %0, i32 %1) {
%3 = tail call i32 @countDigits(i32 %0)
%4 = sub nsw i32 %3, %1
br label %5
5: ; preds = %5, %2
%6 = phi i32 [ %0, %2 ], [ %8, %5 ]
%7 = phi i32 [ %4, %2 ], [ %10, %5 ]
%8 = sdiv i32 %6, 10
%9 = srem i32 %6, 10
%10 = add nsw i32 %7, -1
%11 = icmp sgt i32 %7, 1
br i1 %11, label %5, label %12
12: ; preds = %5
ret i32 %9
}
int dict_long_cmp(const void *k1, const void *k2) {
  const long a = *(const long *)k1;
  const long b = *(const long *)k2;
  return (a > b) - (a < b);
}


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

x86 assembly (clang, -O2):
<dict_long_cmp>:
mov    (%rdi),%rcx
xor    %eax,%eax
xor    %edx,%edx
cmp    (%rsi),%rcx
setg   %al
setl   %dl
sub    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @dict_long_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp slt i64 %4, %6
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
extern int f1(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @f1() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int bdb_index_next(int a, void *b) {
  printf("you shouldn't be using this outside of the bastard!!!\n");
  return (0);
}


x86 assembly (clang, -O0):
<bdb_index_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bdb_index_next>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"you shouldn't be using this outside of the bastard!!!\0A\00"
define i32 @bdb_index_next(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [54 x i8] c"you shouldn't be using this outside of the bastard!!!\00"
define i32 @bdb_index_next(i32 %0, i8* nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __print_int(int);
int main() {
  int i;
  int a = 0;
  int b = 3;
  int c = 0;
  int d = 4;
  for (i = 0; i < 5; i++) {
    a = 5 * b / (2 - b) + d * 2;
    c = i * 2;
  }
  __print_int(a);
  __print_int(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    117d <main+0x6d>
imul   $0x5,-0x10(%rbp),%eax
mov    $0x2,%ecx
sub    -0x10(%rbp),%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1142 <main+0x32>
mov    -0xc(%rbp),%edi
call   1030 <__print_int@plt>
mov    -0x14(%rbp),%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffff9,%edi
call   1030 <__print_int@plt>
mov    $0x8,%edi
call   1030 <__print_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__print_int(i32 -7)
%2 = tail call i32 @__print_int(i32 8)
ret i32 0
}
void vector_subtract3(double a[3], double b[3], double m[3]) {
  for (int i = 0; i < 3; ++i) {
    m[i] = a[i] - b[i];
  }
}


x86 assembly (clang, -O0):
<vector_subtract3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x3,-0x1c(%rbp)
jge    1156 <vector_subtract3+0x56>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1117 <vector_subtract3+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_subtract3>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
movsd  %xmm0,(%rdx)
movsd  0x8(%rdi),%xmm0
subsd  0x8(%rsi),%xmm0
movsd  %xmm0,0x8(%rdx)
movsd  0x10(%rdi),%xmm0
subsd  0x10(%rsi),%xmm0
movsd  %xmm0,0x10(%rdx)
ret

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

LLVM IR (-O2):
define void @vector_subtract3(double* nocapture %0, double* nocapture %1, double* nocapture writeonly %2) {
%4 = load double, double* %0
%5 = load double, double* %1
%6 = fsub double %4, %5
store double %6, double* %2
%7 = getelementptr inbounds double, double* %0, i64 1
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %1, i64 1
%10 = load double, double* %9
%11 = fsub double %8, %10
%12 = getelementptr inbounds double, double* %2, i64 1
store double %11, double* %12
%13 = getelementptr inbounds double, double* %0, i64 2
%14 = load double, double* %13
%15 = getelementptr inbounds double, double* %1, i64 2
%16 = load double, double* %15
%17 = fsub double %14, %16
%18 = getelementptr inbounds double, double* %2, i64 2
store double %17, double* %18
ret void
}
/* Type definitions */
struct hostent {
  int dummy;
};

/* Variables and functions */
int compat_gethostbyname_r(const char *name, struct hostent *hp, char *buf,
                           size_t buflen, struct hostent **hpp, int *herr) {
  return 0;
}


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

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

LLVM IR (-O0):
%struct.hostent = type { i32 }
define i32 @compat_gethostbyname_r(i8* %0, %struct.hostent* %1, i8* %2, i64 %3, %struct.hostent** %4, i32* %5) {
%7 = alloca i8*
%8 = alloca %struct.hostent*
%9 = alloca i8*
%10 = alloca i64
%11 = alloca %struct.hostent**
%12 = alloca i32*
store i8* %0, i8** %7
store %struct.hostent* %1, %struct.hostent** %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store %struct.hostent** %4, %struct.hostent*** %11
store i32* %5, i32** %12
ret i32 0
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
define i32 @compat_gethostbyname_r(i8* nocapture readnone %0, %struct.hostent* nocapture readnone %1, i8* nocapture readnone %2, i64 %3, %struct.hostent** nocapture readnone %4, i32* nocapture readnone %5) {
ret i32 0
}
void do_pre_final(void) { return; }


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

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

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

LLVM IR (-O2):
define void @do_pre_final() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_malloc_init();
int /*<<< orphan*/ ENGINE_load_builtin_engines();
int /*<<< orphan*/ ERR_load_crypto_strings();
int /*<<< orphan*/ OpenSSL_add_all_algorithms();
int /*<<< orphan*/ SIGPIPE;
int /*<<< orphan*/ SIG_IGN;
int /*<<< orphan*/ setup_ui_method();
int /*<<< orphan*/ signal(int /*<<< orphan*/, int /*<<< orphan*/);
void openssl_startup(void) {
  signal(SIGPIPE, SIG_IGN);
  CRYPTO_malloc_init();
  ERR_load_crypto_strings();
  OpenSSL_add_all_algorithms();
  ENGINE_load_builtin_engines();
  setup_ui_method();
}


x86 assembly (clang, -O0):
<openssl_startup>:
push   %rbp
mov    %rsp,%rbp
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
mov    $0x0,%al
call   1070 <CRYPTO_malloc_init@plt>
mov    $0x0,%al
call   1050 <ERR_load_crypto_strings@plt>
mov    $0x0,%al
call   1040 <OpenSSL_add_all_algorithms@plt>
mov    $0x0,%al
call   1060 <ENGINE_load_builtin_engines@plt>
mov    $0x0,%al
call   1080 <setup_ui_method@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<openssl_startup>:
push   %rax
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1030 <signal@plt>
xor    %eax,%eax
call   1070 <CRYPTO_malloc_init@plt>
xor    %eax,%eax
call   1050 <ERR_load_crypto_strings@plt>
xor    %eax,%eax
call   1040 <OpenSSL_add_all_algorithms@plt>
xor    %eax,%eax
call   1060 <ENGINE_load_builtin_engines@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <setup_ui_method@plt>

LLVM IR (-O0):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @openssl_startup() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = call i32 @signal(i32 %1, i32 %2)
%4 = call i32 (...) @CRYPTO_malloc_init()
%5 = call i32 (...) @ERR_load_crypto_strings()
%6 = call i32 (...) @OpenSSL_add_all_algorithms()
%7 = call i32 (...) @ENGINE_load_builtin_engines()
%8 = call i32 (...) @setup_ui_method()
ret void
}

LLVM IR (-O2):
@SIGPIPE = global i32 0
@SIG_IGN = global i32 0
define void @openssl_startup() {
%1 = load i32, i32* @SIGPIPE
%2 = load i32, i32* @SIG_IGN
%3 = tail call i32 @signal(i32 %1, i32 %2)
%4 = tail call i32 (...) @CRYPTO_malloc_init()
%5 = tail call i32 (...) @ERR_load_crypto_strings()
%6 = tail call i32 (...) @OpenSSL_add_all_algorithms()
%7 = tail call i32 (...) @ENGINE_load_builtin_engines()
%8 = tail call i32 (...) @setup_ui_method()
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t cp_GetPiece(uint8_t cp) {
  cp &= 0x0f;
  return cp;
}


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

x86 assembly (clang, -O2):
<cp_GetPiece>:
mov    %edi,%eax
and    $0xf,%eax
ret

LLVM IR (-O0):
define i32 @cp_GetPiece(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 15
store i32 %4, i32* %2
%5 = load i32, i32* %2
ret i32 %5
}

LLVM IR (-O2):
define i32 @cp_GetPiece(i32 %0) {
%2 = and i32 %0, 15
ret i32 %2
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stdout;
void __shrink_str_1_pp_print(void *cc, void *k, void *v) {
  fprintf(stdout, "(%s,%u)\n", (char *)*(void **)k, *(uint32_t *)*(void **)v);
}


x86 assembly (clang, -O0):
<__shrink_str_1_pp_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%ecx
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__shrink_str_1_pp_print>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rax
mov    (%rdx),%rcx
mov    (%rcx),%ecx
lea    0xed8(%rip),%rsi
mov    %rax,%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [9 x i8] c"(%s,%u)\0A\00"
define void @__shrink_str_1_pp_print(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* @stdout
%8 = load i8*, i8** %5
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = load i8*, i8** %6
%12 = bitcast i8* %11 to i8**
%13 = load i8*, i8** %12
%14 = bitcast i8* %13 to i32*
%15 = load i32, i32* %14
%16 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %15)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [9 x i8] c"(%s,%u)\0A\00"
define void @__shrink_str_1_pp_print(i8* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = load i32, i32* @stdout
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = bitcast i8* %2 to i32**
%8 = load i32*, i32** %7
%9 = load i32, i32* %8
%10 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %9)
ret void
}
int compare_int(const void *first, const void *second) {
  int a = *((int *)first);
  int b = *((int *)second);
  if (a == b)
    return 0;
  else if (a < b)
    return -1;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compare_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1136 <compare_int+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compare_int+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    114e <compare_int+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compare_int+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_int>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_int(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp eq i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 0, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp slt i32 %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 1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int CheckAddr(addr)
long addr;
{
  if (addr <= 0)
    return -4;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckAddr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jg     111f <CheckAddr+0x1f>
movl   $0xfffffffc,-0x4(%rbp)
jmp    1126 <CheckAddr+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckAddr>:
xor    %eax,%eax
test   %rdi,%rdi
setg   %al
lea    -0x4(,%rax,4),%eax
ret

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

LLVM IR (-O2):
define i32 @CheckAddr(i64 %0) {
%2 = icmp slt i64 %0, 1
%3 = select i1 %2, i32 -4, i32 0
ret i32 %3
}
/* Variables and functions */
int snprintf(char *str, size_t size, const char *format, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @snprintf(i8* nocapture readnone %0, i64 %1, i8* nocapture readnone %2, ...) {
ret i32 0
}
/* Variables and functions */
double distance(double, double, double, double);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x1 = 1.0, y1 = 1.0;
  double x2 = 6.0, y2 = 6.0;
  printf("Distance between 1,1 and 6,6 = %.2f\n", distance(x1, x2, y1, y2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xec4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeaf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea2(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm3
call   1040 <distance@plt>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
movaps %xmm0,%xmm2
movaps %xmm1,%xmm3
call   1040 <distance@plt>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Distance between 1,1 and 6,6 = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 1.000000e+00, double* %2
store double 1.000000e+00, double* %3
store double 6.000000e+00, double* %4
store double 6.000000e+00, double* %5
%6 = load double, double* %2
%7 = load double, double* %4
%8 = load double, double* %3
%9 = load double, double* %5
%10 = call double @distance(double %6, double %7, double %8, double %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"Distance between 1,1 and 6,6 = %.2f\0A\00"
define i32 @main() {
%1 = tail call double @distance(double 1.000000e+00, double 6.000000e+00, double 1.000000e+00, double 6.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), double %1)
ret i32 0
}
void func7(int a, int *b, char c) {
  int *var3 = 12 + b;
  *var3 = 600;
}


x86 assembly (clang, -O0):
<func7>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
add    $0x30,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x258,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<func7>:
movl   $0x258,0x30(%rsi)
ret

LLVM IR (-O0):
define void @func7(i32 %0, i32* %1, i8 signext %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i8
%7 = alloca i32*
store i32 %0, i32* %4
store i32* %1, i32** %5
store i8 %2, i8* %6
%8 = load i32*, i32** %5
%9 = getelementptr inbounds i32, i32* %8, i64 12
store i32* %9, i32** %7
%10 = load i32*, i32** %7
store i32 600, i32* %10
ret void
}

LLVM IR (-O2):
define void @func7(i32 %0, i32* nocapture writeonly %1, i8 signext %2) {
%4 = getelementptr inbounds i32, i32* %1, i64 12
store i32 600, i32* %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SIGFPE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ signal(int /*<<< orphan*/, void (*)());
int /*<<< orphan*/ stderr;
void handler_sigfpe() {
  signal(SIGFPE, handler_sigfpe);
  fprintf(stderr, "-->  I have received a SIGFPE!\n");
  return;
}


x86 assembly (clang, -O0):
<handler_sigfpe>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xeb7(%rip),%rsi
call   1040 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler_sigfpe>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    0x2eb7(%rip),%rsi
call   1030 <signal@plt>
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
pop    %rax
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@SIGFPE = global i32 0
@stderr = global i32 0
@.str = [32 x i8] c"--> I have received a SIGFPE!\0A\00"
define void @handler_sigfpe() {
%1 = load i32, i32* @SIGFPE
%2 = call i32 @signal(i32 %1, void (...)* bitcast (void ()* @handler_sigfpe to void (...)*))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SIGFPE = global i32 0
@stderr = global i32 0
@.str = [32 x i8] c"--> I have received a SIGFPE!\0A\00"
define void @handler_sigfpe() {
%1 = load i32, i32* @SIGFPE
%2 = tail call i32 @signal(i32 %1, void (...)* bitcast (void ()* @handler_sigfpe to void (...)*))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ write_nl();
void latex_heading1(void) { write_nl(); }


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

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

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

LLVM IR (-O2):
define void @latex_heading1() {
%1 = tail call i32 (...) @write_nl()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EVP_aes_256_ofb();
int do_test_bio_cipher(int /*<<< orphan*/, int);
int test_bio_enc_aes_256_ofb(int idx) {
  return do_test_bio_cipher(EVP_aes_256_ofb(), idx);
}


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

x86 assembly (clang, -O2):
<test_bio_enc_aes_256_ofb>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <EVP_aes_256_ofb@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <do_test_bio_cipher@plt>

LLVM IR (-O0):
define i32 @test_bio_enc_aes_256_ofb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @EVP_aes_256_ofb()
%4 = load i32, i32* %2
%5 = call i32 @do_test_bio_cipher(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @test_bio_enc_aes_256_ofb(i32 %0) {
%2 = tail call i32 (...) @EVP_aes_256_ofb()
%3 = tail call i32 @do_test_bio_cipher(i32 %2, i32 %0)
ret i32 %3
}
int xmlLinkCompare(const void *data0, const void *data1) {
  if (data0 < data1)
    return (-1);
  else if (data0 == data1)
    return (0);
  return (1);
}


x86 assembly (clang, -O0):
<xmlLinkCompare>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1126 <xmlLinkCompare+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    114c <xmlLinkCompare+0x4c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    1140 <xmlLinkCompare+0x40>
movl   $0x0,-0x4(%rbp)
jmp    114c <xmlLinkCompare+0x4c>
jmp    1145 <xmlLinkCompare+0x45>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlLinkCompare>:
xor    %ecx,%ecx
cmp    %rsi,%rdi
setne  %cl
mov    $0xffffffff,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xmlLinkCompare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ult i8* %0, %1
%4 = icmp ne i8* %0, %1
%5 = zext i1 %4 to i32
%6 = select i1 %3, i32 -1, i32 %5
ret i32 %6
}
/* Type definitions */
struct battery {
  int dummy;
};

/* Variables and functions */
int ENODEV;
int default_capacity_mAh(struct battery *b) { return -ENODEV; }


x86 assembly (clang, -O0):
<default_capacity_mAh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
mov    0x2ecf(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_capacity_mAh>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.battery = type { i32 }
@ENODEV = global i32 0
define i32 @default_capacity_mAh(%struct.battery* %0) {
%2 = alloca %struct.battery*
store %struct.battery* %0, %struct.battery** %2
%3 = load i32, i32* @ENODEV
%4 = sub nsw i32 0, %3
ret i32 %4
}

LLVM IR (-O2):
%struct.battery = type { i32 }
@ENODEV = global i32 0
define i32 @default_capacity_mAh(%struct.battery* nocapture readnone %0) {
%2 = load i32, i32* @ENODEV
%3 = sub nsw i32 0, %2
ret i32 %3
}
int rl_insert_completions(ignore, invoking_key)
int ignore __attribute__((unused)), invoking_key __attribute__((unused));
{ return (rl_complete_internal('*')); }


x86 assembly (clang, -O0):
<rl_insert_completions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x2a,%edi
mov    $0x0,%al
call   1030 <rl_complete_internal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_insert_completions>:
mov    $0x2a,%edi
xor    %eax,%eax
jmp    1030 <rl_complete_internal@plt>

LLVM IR (-O0):
define i32 @rl_insert_completions(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (i32, ...) bitcast (i32 (...)* @rl_complete_internal to i32 (i32, ...)*)(i32 42)
ret i32 %5
}

LLVM IR (-O2):
define i32 @rl_insert_completions(i32 %0, i32 %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @rl_complete_internal to i32 (i32, ...)*)(i32 42)
ret i32 %3
}
void dmat_dtutumx(double **a, double **b, double **c, long n) {}


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

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

LLVM IR (-O0):
define void @dmat_dtutumx(double** %0, double** %1, double** %2, i64 %3) {
%5 = alloca double**
%6 = alloca double**
%7 = alloca double**
%8 = alloca i64
store double** %0, double*** %5
store double** %1, double*** %6
store double** %2, double*** %7
store i64 %3, i64* %8
ret void
}

LLVM IR (-O2):
define void @dmat_dtutumx(double** nocapture %0, double** nocapture %1, double** nocapture %2, i64 %3) {
ret void
}
/* Variables and functions */
unsigned long atom_size();
unsigned long bond_size();
scalar_t__ error();
int /*<<< orphan*/ init_object(int, unsigned long);
void define_mol() {
  unsigned long size;
  size = atom_size();
  init_object(6, size);
  if (error())
    return;
  size = bond_size();
  init_object(40, size);
  if (error())
    return;
}


x86 assembly (clang, -O0):
<define_mol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <atom_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x6,%edi
call   1050 <init_object@plt>
mov    $0x0,%al
call   1060 <error@plt>
cmp    $0x0,%rax
je     1177 <define_mol+0x37>
jmp    11a6 <define_mol+0x66>
mov    $0x0,%al
call   1040 <bond_size@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x28,%edi
call   1050 <init_object@plt>
mov    $0x0,%al
call   1060 <error@plt>
cmp    $0x0,%rax
je     11a6 <define_mol+0x66>
jmp    11a6 <define_mol+0x66>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<define_mol>:
push   %rax
xor    %eax,%eax
call   1030 <atom_size@plt>
mov    $0x6,%edi
mov    %rax,%rsi
call   1050 <init_object@plt>
xor    %eax,%eax
call   1060 <error@plt>
test   %rax,%rax
je     1163 <define_mol+0x23>
pop    %rax
ret
xor    %eax,%eax
call   1040 <bond_size@plt>
mov    $0x28,%edi
mov    %rax,%rsi
call   1050 <init_object@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <error@plt>

LLVM IR (-O0):
define void @define_mol() {
%1 = alloca i64
%2 = call i64 (...) @atom_size()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = call i32 @init_object(i32 6, i64 %3)
%5 = call i64 (...) @error()
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
br label %15
8: ; preds = %0
%9 = call i64 (...) @bond_size()
store i64 %9, i64* %1
%10 = load i64, i64* %1
%11 = call i32 @init_object(i32 40, i64 %10)
%12 = call i64 (...) @error()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
br label %15
15: ; preds = %7, %14, %8
ret void
}

LLVM IR (-O2):
define void @define_mol() {
%1 = tail call i64 (...) @atom_size()
%2 = tail call i32 @init_object(i32 6, i64 %1)
%3 = tail call i64 (...) @error()
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = tail call i64 (...) @bond_size()
%7 = tail call i32 @init_object(i32 40, i64 %6)
%8 = tail call i64 (...) @error()
br label %9
9: ; preds = %5, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(float const *);
float nm2km(const float *ptrNauticalMiles) {
  assert(ptrNauticalMiles);
  return (*ptrNauticalMiles) * 1.852;
}


x86 assembly (clang, -O0):
<nm2km>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nm2km>:
push   %rbx
mov    %rdi,%rbx
call   1030 <assert@plt>
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xed7(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbx
ret

LLVM IR (-O0):
define float @nm2km(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = call i32 @assert(float* %3)
%5 = load float*, float** %2
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = fmul double %7, 1.852000e+00
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @nm2km(float* %0) {
%2 = tail call i32 @assert(float* %0)
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = fmul double %4, 1.852000e+00
%6 = fptrunc double %5 to float
ret float %6
}
/* Type definitions */
struct group {
  int dummy;
};

/* Variables and functions */
struct group *getgrgid(int);
struct group *posix___new_Group_from_gid___impl(int gid) {
  return getgrgid(gid);
}


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

x86 assembly (clang, -O2):
<posix___new_Group_from_gid___impl>:
jmp    1030 <getgrgid@plt>

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

LLVM IR (-O2):
%struct.group = type { i32 }
define %struct.group* @posix___new_Group_from_gid___impl(i32 %0) {
%2 = tail call %struct.group* @getgrgid(i32 %0)
ret %struct.group* %2
}
/* Variables and functions */
scalar_t__ setExceptionCode(int);
void validateAnnexIsNull(const char *pAnnex) {
  if (pAnnex)
    return ((void)setExceptionCode(4));
}


x86 assembly (clang, -O0):
<validateAnnexIsNull>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1131 <validateAnnexIsNull+0x21>
mov    $0x4,%edi
call   1030 <setExceptionCode@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<validateAnnexIsNull>:
test   %rdi,%rdi
je     111f <validateAnnexIsNull+0xf>
mov    $0x4,%edi
jmp    1030 <setExceptionCode@plt>
ret

LLVM IR (-O0):
define void @validateAnnexIsNull(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i64 @setExceptionCode(i32 4)
br label %7
7: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @validateAnnexIsNull(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i64 @setExceptionCode(i32 4)
br label %5
5: ; preds = %3, %1
ret void
}