xunge/DecIR huggingface dataset:
/* Variables and functions */
float atanf(float);
float futrts_atan32(float x) { return atanf(x); }


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

x86 assembly (clang, -O2):
<futrts_atan32>:
jmp    1030 <atanf@plt>

LLVM IR (-O0):
define float @futrts_atan32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @atanf(float %3)
ret float %4
}

LLVM IR (-O2):
define float @futrts_atan32(float %0) {
%2 = tail call float @atanf(float %0)
ret float %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
void tlib_update_instruction_counter(int32_t value) {}


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

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

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

LLVM IR (-O2):
define void @tlib_update_instruction_counter(i32 %0) {
ret void
}
/* Variables and functions */
bool isValueInArray(int val, int *arr, int size) {
  int i;
  for (i = 0; i < size; i++) {
    if (arr[i] == val)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<isValueInArray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1154 <isValueInArray+0x54>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x8(%rbp),%eax
jne    1141 <isValueInArray+0x41>
movl   $0x1,-0x4(%rbp)
jmp    115b <isValueInArray+0x5b>
jmp    1146 <isValueInArray+0x46>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <isValueInArray+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValueInArray>:
test   %edx,%edx
jle    111e <isValueInArray+0x1e>
mov    %edx,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cmp    %edi,(%rsi,%rcx,4)
je     1121 <isValueInArray+0x21>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1110 <isValueInArray+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isValueInArray(i32 %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %15
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %14, %6
br i1 %8, label %15, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %14, %7 ]
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = load i32, i32* %11
%13 = icmp eq i32 %12, %0
%14 = add nuw nsw i64 %10, 1
br i1 %13, label %15, label %7
15: ; preds = %9, %7, %3
%16 = phi i32 [ 0, %3 ], [ 0, %7 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, char const *);
void each_tag(const char *key, const char *value, void *user_data) {
  printf("%s: \"%s\"\n", key, value);
}


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"%s: \22%s\22\0A\00"
define void @each_tag(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 i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%s: \22%s\22\0A\00"
define void @each_tag(i8* %0, i8* %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ write_word_data(int, int, int /*<<< orphan*/);
void io_invert_bus(uint16_t polarity) { write_word_data(0x20, 0x02, polarity); }


x86 assembly (clang, -O0):
<io_invert_bus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x20,%edi
mov    $0x2,%esi
call   1030 <write_word_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_invert_bus>:
mov    %edi,%edx
mov    $0x20,%edi
mov    $0x2,%esi
jmp    1030 <write_word_data@plt>

LLVM IR (-O0):
define void @io_invert_bus(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @write_word_data(i32 32, i32 2, i32 %3)
ret void
}

LLVM IR (-O2):
define void @io_invert_bus(i32 %0) {
%2 = tail call i32 @write_word_data(i32 32, i32 2, i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_cvolume_set_balance() {
  printf("NOT IMPLEMENTED:"
         "pa_cvolume_set_balance"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"NOT IMPLEMENTED:pa_cvolume_set_balance\0A\00"
define i32 @pa_cvolume_set_balance() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_cvolume_set_balance\00"
define i32 @pa_cvolume_set_balance() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float const *, int);
void mlPointCopy(const float *a, float *result) {
  memcpy(result, a, 3 * sizeof(float));
}


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

x86 assembly (clang, -O2):
<mlPointCopy>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0xc,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @mlPointCopy(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %4
%6 = load float*, float** %3
%7 = call i32 @memcpy(float* %5, float* %6, i32 12)
ret void
}

LLVM IR (-O2):
define void @mlPointCopy(float* %0, float* %1) {
%3 = tail call i32 @memcpy(float* %1, float* %0, i32 12)
ret void
}
/* Variables and functions */
#define AF_INET 128
int /*<<< orphan*/ EAFNOSUPPORT;
int /*<<< orphan*/ errno;
int inet_pton4(char const *, void *);
int inet_pton(int af, const char *src, void *dst) {
  switch (af) {
  case AF_INET:
    return (inet_pton4(src, dst));
  default:
    errno = EAFNOSUPPORT;
    return (-1);
  }
}


x86 assembly (clang, -O0):
<inet_pton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
jne    114b <inet_pton+0x3b>
jmp    1136 <inet_pton+0x26>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <inet_pton4@plt>
mov    %eax,-0x4(%rbp)
jmp    1164 <inet_pton+0x54>
mov    0x2e86(%rip),%rax
mov    (%rax),%ecx
mov    0x2e85(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inet_pton>:
cmp    $0x80,%edi
jne    1123 <inet_pton+0x13>
mov    %rsi,%rdi
mov    %rdx,%rsi
jmp    1030 <inet_pton4@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    0x2ead(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = load i32, i32* %5
switch i32 %8, label %13 [
i32 128, label %9
]
9: ; preds = %3
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = call i32 @inet_pton4(i8* %10, i8* %11)
store i32 %12, i32* %4
br label %15
13: ; preds = %3
%14 = load i32, i32* @EAFNOSUPPORT
store i32 %14, i32* @errno
store i32 -1, i32* %4
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
@EAFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @inet_pton(i32 %0, i8* %1, i8* %2) {
%4 = icmp eq i32 %0, 128
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @inet_pton4(i8* %1, i8* %2)
br label %9
7: ; preds = %3
%8 = load i32, i32* @EAFNOSUPPORT
store i32 %8, i32* @errno
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ -1, %7 ]
ret i32 %10
}
unsigned ds1743_int_to_bcd(unsigned val) {
  if (val >= 100) {
    val %= 100;
  }
  return ((val % 10) + 16 * (val / 10));
}


x86 assembly (clang, -O0):
<ds1743_int_to_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jb     1120 <ds1743_int_to_bcd+0x20>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x4,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ds1743_int_to_bcd>:
cmp    $0x64,%edi
jb     1117 <ds1743_int_to_bcd+0x17>
mov    %edi,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
sub    %eax,%edi
movzbl %dil,%ecx
imul   $0xcd,%ecx,%eax
shr    $0xb,%eax
lea    (%rax,%rax,1),%edx
lea    (%rdx,%rdx,4),%edx
sub    %dl,%cl
movzbl %cl,%ecx
shl    $0x4,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ds1743_int_to_bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp uge i32 %3, 100
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = urem i32 %6, 100
store i32 %7, i32* %2
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = urem i32 %9, 10
%11 = load i32, i32* %2
%12 = udiv i32 %11, 10
%13 = mul i32 16, %12
%14 = add i32 %10, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @ds1743_int_to_bcd(i32 %0) {
%2 = icmp ugt i32 %0, 99
%3 = urem i32 %0, 100
%4 = select i1 %2, i32 %3, i32 %0
%5 = trunc i32 %4 to i8
%6 = urem i8 %5, 10
%7 = zext i8 %6 to i32
%8 = udiv i8 %5, 10
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 4
%11 = or i32 %10, %7
ret i32 %11
}
/* Variables and functions */
int myfunction(int);
int main(void) {
  int a;
  a = myfunction(a);
here:
  return a;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* %2
%4 = call i32 @myfunction(i32 %3)
store i32 %4, i32* %2
br label %5
5: ; preds = %0
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @myfunction(i32 undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ gen(char *);
void cgneg(void) { gen("negq\t%rax"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"negq\09%rax\00"
define void @cgneg() {
%1 = call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"negq\09%rax\00"
define void @cgneg() {
%1 = tail call i32 @gen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ floor(double);
int floor_int(double x) { return (int)floor(x); }


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

x86 assembly (clang, -O2):
<floor_int>:
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @floor_int(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @floor(double %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @floor_int(double %0) {
%2 = tail call i64 @floor(double %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
scalar_t__ isupper(char);
char tolower(char);
void strlower(char *str) {
  while (*str) {
    if (isupper(*str))
      *str = tolower(*str);
    str++;
  }
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1174 <strlower+0x54>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1163 <strlower+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112c <strlower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <strlower+0x35>
mov    %rdi,%rbx
jmp    113c <strlower+0x1c>
nopl   0x0(%rax)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     1155 <strlower+0x35>
movsbl %al,%edi
call   1040 <isupper@plt>
test   %rax,%rax
je     1130 <strlower+0x10>
movsbl (%rbx),%edi
call   1030 <tolower@plt>
mov    %al,(%rbx)
jmp    1130 <strlower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strlower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = tail call i64 @isupper(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = load i8, i8* %6
%11 = tail call signext i8 @tolower(i8 signext %10)
store i8 %11, i8* %6
br label %12
12: ; preds = %9, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
void get_random_bytes(void *buf, int nbytes) { return; }


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

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

LLVM IR (-O0):
define void @get_random_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
define void @get_random_bytes(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int socket_tcp_senddata(int, char const *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strlen(char const *);
int smtp_quit(int s) {
  const char *data = "QUIT\r\n\r\n";
  int ret = socket_tcp_senddata(s, data, strlen(data), 1);
  if (ret > 0)
    ret = 1;
  return ret;
}


x86 assembly (clang, -O0):
<smtp_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%ecx
call   1030 <socket_tcp_senddata@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1174 <smtp_quit+0x54>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smtp_quit>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
lea    0xed3(%rip),%r14
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    $0x1,%ebp
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
mov    $0x1,%ecx
call   1030 <socket_tcp_senddata@plt>
test   %eax,%eax
cmovg  %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"QUIT\0D\0A\0D\0A\00"
define i32 @smtp_quit(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %3
%5 = load i32, i32* %2
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @socket_tcp_senddata(i32 %5, i8* %6, i32 %8, i32 1)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 1, i32* %4
br label %13
13: ; preds = %12, %1
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
@.str = [9 x i8] c"QUIT\0D\0A\0D\0A\00"
define i32 @smtp_quit(i32 %0) {
%2 = tail call i32 @strlen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @socket_tcp_senddata(i32 %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 1)
%4 = icmp slt i32 %3, 1
%5 = select i1 %4, i32 %3, i32 1
ret i32 %5
}
_Bool ne_float_cr(float _Complex a, float b) { return a != b; }


x86 assembly (clang, -O0):
<ne_float_cr>:
push   %rbp
mov    %rsp,%rbp
movlpd %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm1
setne  %al
setp   %cl
or     %cl,%al
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setne  %cl
setp   %dl
or     %dl,%cl
or     %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ne_float_cr>:
ucomiss %xmm1,%xmm0
shufps $0x55,%xmm0,%xmm0
setp   %al
setne  %cl
or     %al,%cl
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
setp   %dl
setne  %al
or     %dl,%al
or     %cl,%al
ret

LLVM IR (-O0):
define zeroext i1 @ne_float_cr(<2 x float> %0, float %1) {
%3 = alloca { float, float }
%4 = alloca float
%5 = bitcast { float, float }* %3 to <2 x float>*
store <2 x float> %0, <2 x float>* %5
store float %1, float* %4
%6 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%7 = load float, float* %6
%8 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
%9 = load float, float* %8
%10 = load float, float* %4
%11 = fcmp une float %7, %10
%12 = fcmp une float %9, 0.000000e+00
%13 = or i1 %11, %12
ret i1 %13
}

LLVM IR (-O2):
define zeroext i1 @ne_float_cr(<2 x float> %0, float %1) {
%3 = extractelement <2 x float> %0, i64 0
%4 = extractelement <2 x float> %0, i64 1
%5 = fcmp une float %3, %1
%6 = fcmp une float %4, 0.000000e+00
%7 = or i1 %5, %6
ret i1 %7
}
int xmlUCSIsIPAExtensions(int code) {
  return (((code >= 0x0250) && (code <= 0x02AF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsIPAExtensions>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x250,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsIPAExtensions+0x26>
cmpl   $0x2af,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsIPAExtensions>:
add    $0xfffffdb0,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsIPAExtensions(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 592
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 687
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @xmlUCSIsIPAExtensions(i32 %0) {
%2 = add i32 %0, -592
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Monitor();
int main() {
  Monitor();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <Monitor@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <Monitor@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @Monitor()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @Monitor()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ xvprintf2(char *, char const *, int /*<<< orphan*/);
void xsprintf2(char *buff, const char *fmt, va_list arp) {
  xvprintf2(buff, fmt, arp);
}


x86 assembly (clang, -O0):
<xsprintf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <xvprintf2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsprintf2>:
jmp    1030 <xvprintf2@plt>

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

LLVM IR (-O2):
define void @xsprintf2(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @xvprintf2(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_data_imm_op();
int /*<<< orphan*/ arm_logic_tst(int /*<<< orphan*/);
void arm_tst_imm() { arm_logic_tst(arm_data_imm_op()); }


x86 assembly (clang, -O0):
<arm_tst_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
call   1040 <arm_logic_tst@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_tst_imm>:
push   %rax
xor    %eax,%eax
call   1030 <arm_data_imm_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <arm_logic_tst@plt>

LLVM IR (-O0):
define void @arm_tst_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_logic_tst(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_tst_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_logic_tst(i32 %1)
ret void
}
void rop3_255_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  stk1 = 255;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_255_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movb   $0xff,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_255_0_1>:
not    %dl
or     %sil,%dl
or     %dl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_255_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i8 -1, i8* %7
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = and i32 %9, %11
%13 = load i8, i8* %7
%14 = zext i8 %13 to i32
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = xor i32 %16, -1
%18 = and i32 %14, %17
%19 = or i32 %12, %18
%20 = load i8, i8* %6
%21 = zext i8 %20 to i32
%22 = load i8, i8* %5
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = load i8*, i8** %4
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %25, %28
%30 = or i32 %19, %29
%31 = trunc i32 %30 to i8
%32 = load i8*, i8** %4
store i8 %31, i8* %32
ret void
}

LLVM IR (-O2):
define void @rop3_255_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %2, -1
%5 = or i8 %4, %1
%6 = load i8, i8* %0
%7 = or i8 %5, %6
store i8 %7, i8* %0
ret void
}
int main() {
  for (int i = 0; i < 1000000000; i++) {
    int a = 131 % 4;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3b9aca00,-0x8(%rbp)
jge    1134 <main+0x34>
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void av_rescale_rnd() {}


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

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

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

LLVM IR (-O2):
define void @av_rescale_rnd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void oscap_aligned_free(void *memblock) { free(memblock); }


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

x86 assembly (clang, -O2):
<oscap_aligned_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @oscap_aligned_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reverse_range(char *, char *);
char *reverse_char(char *start) {
  char *end = start;
  while ((end[1] & 0xc0) == 0x80) {
    end++;
  }
  reverse_range(start, end);
  return (end + 1);
}


x86 assembly (clang, -O0):
<reverse_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
jne    114d <reverse_char+0x3d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <reverse_char+0x14>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <reverse_range@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_char>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
and    $0xc0,%al
cmp    $0x80,%al
je     1120 <reverse_char+0x10>
lea    -0x1(%rbx),%rsi
call   1030 <reverse_range@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @reverse_char(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %12, %1
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = and i32 %9, 192
%11 = icmp eq i32 %10, 128
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
br label %5
15: ; preds = %5
%16 = load i8*, i8** %2
%17 = load i8*, i8** %3
%18 = call i32 @reverse_range(i8* %16, i8* %17)
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i64 1
ret i8* %20
}

LLVM IR (-O2):
define i8* @reverse_char(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %4, %2 ]
%4 = getelementptr inbounds i8, i8* %3, i64 1
%5 = load i8, i8* %4
%6 = and i8 %5, -64
%7 = icmp eq i8 %6, -128
br i1 %7, label %2, label %8
8: ; preds = %2
%9 = tail call i32 @reverse_range(i8* %0, i8* %3)
ret i8* %4
}
void print_adjacent_vertices_of(int n) {}


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

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

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

LLVM IR (-O2):
define void @print_adjacent_vertices_of(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char ind2ch(int i) {
  if (i < 26)
    return 'a' + i;
  if (i < 52)
    return 'A' + i - 26;
  if (i < 62)
    return '0' + i - 52;
  assert(0);
}


x86 assembly (clang, -O0):
<ind2ch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1a,-0x8(%rbp)
jge    1133 <ind2ch+0x23>
mov    -0x8(%rbp),%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
jmp    1170 <ind2ch+0x60>
cmpl   $0x34,-0x8(%rbp)
jge    114e <ind2ch+0x3e>
mov    -0x8(%rbp),%eax
add    $0x41,%eax
sub    $0x1a,%eax
mov    %al,-0x1(%rbp)
jmp    1170 <ind2ch+0x60>
cmpl   $0x3e,-0x8(%rbp)
jge    1169 <ind2ch+0x59>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
sub    $0x34,%eax
mov    %al,-0x1(%rbp)
jmp    1170 <ind2ch+0x60>
xor    %edi,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ind2ch>:
mov    %edi,%eax
cmp    $0x19,%edi
jg     111a <ind2ch+0xa>
add    $0x61,%al
ret
cmp    $0x33,%eax
ja     1122 <ind2ch+0x12>
add    $0x27,%al
ret
cmp    $0x3d,%eax
ja     112a <ind2ch+0x1a>
add    $0xfc,%al
ret
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define signext i8 @ind2ch(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 26
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 97, %7
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %28
10: ; preds = %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 52
br i1 %12, label %13, label %18
13: ; preds = %10
%14 = load i32, i32* %3
%15 = add nsw i32 65, %14
%16 = sub nsw i32 %15, 26
%17 = trunc i32 %16 to i8
store i8 %17, i8* %2
br label %28
18: ; preds = %10
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 62
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i32, i32* %3
%23 = add nsw i32 48, %22
%24 = sub nsw i32 %23, 52
%25 = trunc i32 %24 to i8
store i8 %25, i8* %2
br label %28
26: ; preds = %18
%27 = call i32 @assert(i32 0)
br label %28
28: ; preds = %26, %21, %13, %6
%29 = load i8, i8* %2
ret i8 %29
}

LLVM IR (-O2):
define signext i8 @ind2ch(i32 %0) {
%2 = icmp slt i32 %0, 26
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = add i8 %4, 97
br label %18
6: ; preds = %1
%7 = icmp ult i32 %0, 52
br i1 %7, label %8, label %11
8: ; preds = %6
%9 = trunc i32 %0 to i8
%10 = add nuw nsw i8 %9, 39
br label %18
11: ; preds = %6
%12 = icmp ult i32 %0, 62
br i1 %12, label %13, label %16
13: ; preds = %11
%14 = trunc i32 %0 to i8
%15 = add nsw i8 %14, -4
br label %18
16: ; preds = %11
%17 = tail call i32 @assert(i32 0)
br label %18
18: ; preds = %16, %13, %8, %3
%19 = phi i8 [ %5, %3 ], [ %10, %8 ], [ %15, %13 ], [ undef, %16 ]
ret i8 %19
}
unsigned int f91(unsigned int x, int y __attribute__((unused))) {
  return (x << (8 * sizeof(unsigned int) - 1)) + (x >> 1);
}


x86 assembly (clang, -O0):
<f91>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f91(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 = shl i32 %5, 31
%7 = load i32, i32* %3
%8 = lshr i32 %7, 1
%9 = add i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @f91(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 31)
ret i32 %3
}
void gtk_socket_get_id() {}


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

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

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

LLVM IR (-O2):
define void @gtk_socket_get_id() {
ret void
}
/* Variables and functions */
int timeoutread(int, int, int, int);
int saferead(int fd, int buf, int len) {
  int r;
  r = timeoutread(1200, fd, buf, len);
  return r;
}


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

x86 assembly (clang, -O2):
<saferead>:
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
mov    $0x4b0,%edi
jmp    1030 <timeoutread@plt>

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

LLVM IR (-O2):
define i32 @saferead(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @timeoutread(i32 1200, i32 %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
double sphere_volume(double);
double form_volume(double radius) { return sphere_volume(radius); }


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

x86 assembly (clang, -O2):
<form_volume>:
jmp    1030 <sphere_volume@plt>

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

LLVM IR (-O2):
define double @form_volume(double %0) {
%2 = tail call double @sphere_volume(double %0)
ret double %2
}
void gk20a_volt_dvfs_cdev_unregister(struct gk20a_volt_priv *priv) {}


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

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

LLVM IR (-O0):
%struct.gk20a_volt_priv = type opaque
define void @gk20a_volt_dvfs_cdev_unregister(%struct.gk20a_volt_priv* %0) {
%2 = alloca %struct.gk20a_volt_priv*
store %struct.gk20a_volt_priv* %0, %struct.gk20a_volt_priv** %2
ret void
}

LLVM IR (-O2):
%struct.gk20a_volt_priv = type opaque
define void @gk20a_volt_dvfs_cdev_unregister(%struct.gk20a_volt_priv* nocapture %0) {
ret void
}
int compare_thresholds(const void *v1, const void *v2) {
  double diff = (*(double *)v1) - (*(double *)v2);
  if (diff == 0)
    return 0;
  else if (diff < 0)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<compare_thresholds>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1145 <compare_thresholds+0x45>
jp     1145 <compare_thresholds+0x45>
movl   $0x0,-0x4(%rbp)
jmp    116b <compare_thresholds+0x6b>
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    115f <compare_thresholds+0x5f>
movl   $0xffffffff,-0x4(%rbp)
jmp    116b <compare_thresholds+0x6b>
jmp    1164 <compare_thresholds+0x64>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_thresholds>:
movsd  (%rdi),%xmm0
subsd  (%rsi),%xmm0
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_thresholds(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fsub double %4, %6
%8 = fcmp oeq double %7, 0.000000e+00
%9 = fcmp olt double %7, 0.000000e+00
%10 = select i1 %9, i32 -1, i32 1
%11 = select i1 %8, i32 0, i32 %10
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpge_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpge_pd(__m128d A, __m128d B) { return _mm_cmpge_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpge_pd>:
jmp    1030 <_mm_cmpge_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpge_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpge_pd(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ PingLost();
void PingLostSig(int n) { PingLost(); }


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

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

LLVM IR (-O0):
define void @PingLostSig(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @PingLost()
ret void
}

LLVM IR (-O2):
define void @PingLostSig(i32 %0) {
%2 = tail call i32 (...) @PingLost()
ret void
}
struct heart_proto *get_heart_pro(struct P4 *p4) {
  return (struct heart_proto *)p4;
}


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

x86 assembly (clang, -O2):
<get_heart_pro>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.heart_proto = type opaque
%struct.P4 = type opaque
define %struct.heart_proto* @get_heart_pro(%struct.P4* %0) {
%2 = alloca %struct.P4*
store %struct.P4* %0, %struct.P4** %2
%3 = load %struct.P4*, %struct.P4** %2
%4 = bitcast %struct.P4* %3 to %struct.heart_proto*
ret %struct.heart_proto* %4
}

LLVM IR (-O2):
%struct.heart_proto = type opaque
%struct.P4 = type opaque
define %struct.heart_proto* @get_heart_pro(%struct.P4* readnone %0) {
%2 = bitcast %struct.P4* %0 to %struct.heart_proto*
ret %struct.heart_proto* %2
}
void array(void) {
  unsigned x[2];
  unsigned *y;
  x[0] = 1;
  y = &(x[0]);
  x[0] = *y;
}


x86 assembly (clang, -O0):
<array>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @array() {
%1 = alloca [2 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 1, i32* %3
%4 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = load i32, i32* %5
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 %6, i32* %7
ret void
}

LLVM IR (-O2):
define void @array() {
ret void
}
int fun623() { return 623; }


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

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

LLVM IR (-O0):
define i32 @fun623() {
ret i32 623
}

LLVM IR (-O2):
define i32 @fun623() {
ret i32 623
}
/* Variables and functions */
int /*<<< orphan*/ putMessage(unsigned char *, int);
void nrf_powerdown() {
  unsigned char cmd;
  cmd = 0x10;
  putMessage(&cmd, 1);
}


x86 assembly (clang, -O0):
<nrf_powerdown>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x10,-0x1(%rbp)
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <putMessage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_powerdown>:
push   %rax
movb   $0x10,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <putMessage@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @nrf_powerdown() {
%1 = alloca i8
store i8 16, i8* %1
%2 = call i32 @putMessage(i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
define void @nrf_powerdown() {
%1 = alloca i8
store i8 16, i8* %1
%2 = call i32 @putMessage(i8* %1, i32 1)
ret void
}
void nextBinaryNumber(int *bits, int numBits) {
  for (int i = numBits - 1; i >= 0; i--) {
    if (bits[i] == 0) {
      bits[i] = 1;
      return;
    }
    bits[i] = 0;
  }
}


x86 assembly (clang, -O0):
<nextBinaryNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1161 <nextBinaryNumber+0x61>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1144 <nextBinaryNumber+0x44>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
jmp    1161 <nextBinaryNumber+0x61>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1114 <nextBinaryNumber+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextBinaryNumber>:
test   %esi,%esi
jle    112a <nextBinaryNumber+0x2a>
mov    %esi,%eax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rax),%ecx
cmpl   $0x0,(%rdi,%rcx,4)
je     112b <nextBinaryNumber+0x2b>
movl   $0x0,(%rdi,%rcx,4)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1110 <nextBinaryNumber+0x10>
ret
movl   $0x1,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define void @nextBinaryNumber(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %14
%7 = phi i64 [ %5, %4 ], [ %8, %14 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %6
store i32 1, i32* %10
br label %16
14: ; preds = %6
store i32 0, i32* %10
%15 = icmp ugt i64 %7, 1
br i1 %15, label %6, label %16
16: ; preds = %14, %2, %13
ret void
}