xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ cut_beginning();
int /*<<< orphan*/ mf_write_midi_event(int, int, char *, int);
void copy_pressure(int chan, int c1, int c2) {
  char data[2];
  if (cut_beginning())
    return;
  data[0] = (char)c1;
  data[1] = (char)c2;
  mf_write_midi_event(0xa0, chan, data, 2);
}


x86 assembly (clang, -O0):
<copy_pressure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <cut_beginning@plt>
cmp    $0x0,%rax
je     1147 <copy_pressure+0x27>
jmp    1169 <copy_pressure+0x49>
mov    -0x8(%rbp),%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,-0xd(%rbp)
mov    -0x4(%rbp),%esi
lea    -0xe(%rbp),%rdx
mov    $0xa0,%edi
mov    $0x2,%ecx
call   1030 <mf_write_midi_event@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_pressure>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %esi,%ebx
mov    %edi,%r14d
xor    %eax,%eax
call   1040 <cut_beginning@plt>
test   %rax,%rax
jne    115b <copy_pressure+0x3b>
mov    %bl,0xe(%rsp)
mov    %bpl,0xf(%rsp)
lea    0xe(%rsp),%rdx
mov    $0xa0,%edi
mov    %r14d,%esi
mov    $0x2,%ecx
call   1030 <mf_write_midi_event@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @copy_pressure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [2 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i64 (...) @cut_beginning()
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %21
11: ; preds = %3
%12 = load i32, i32* %5
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
store i8 %13, i8* %14
%15 = load i32, i32* %6
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
store i8 %16, i8* %17
%18 = load i32, i32* %4
%19 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%20 = call i32 @mf_write_midi_event(i32 160, i32 %18, i8* %19, i32 2)
br label %21
21: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
define void @copy_pressure(i32 %0, i32 %1, i32 %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = tail call i64 (...) @cut_beginning()
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = trunc i32 %1 to i8
store i8 %9, i8* %5
%10 = trunc i32 %2 to i8
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 %10, i8* %11
%12 = call i32 @mf_write_midi_event(i32 160, i32 %0, i8* %5, i32 2)
br label %13
13: ; preds = %3, %8
ret void
}
/* Variables and functions */
int random_integer(int /*<<< orphan*/, size_t);
size_t strlen(char *);
char random_choice_char(char str[]) {
  size_t len = strlen(str);
  if (len == 0)
    return '\0';
  int index = random_integer(0, len - 1);
  return str[index];
}


x86 assembly (clang, -O0):
<random_choice_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114d <random_choice_char+0x2d>
movb   $0x0,-0x1(%rbp)
jmp    116d <random_choice_char+0x4d>
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
xor    %edi,%edi
call   1040 <random_integer@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_choice_char>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     1143 <random_choice_char+0x23>
add    $0xffffffffffffffff,%rax
xor    %edi,%edi
mov    %rax,%rsi
call   1040 <random_integer@plt>
cltq
mov    (%rbx,%rax,1),%al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @random_choice_char(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = add i64 %2, -1
%6 = tail call i32 @random_integer(i32 0, i64 %5)
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
br label %10
10: ; preds = %1, %4
%11 = phi i8 [ %9, %4 ], [ 0, %1 ]
ret i8 %11
}
void foo() { 1; }


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

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

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

LLVM IR (-O2):
define void @foo() {
ret void
}
double sum3(double a, double b, double c) { return a + b + c; }


x86 assembly (clang, -O0):
<sum3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum3>:
addsd  %xmm1,%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @sum3(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = fadd double %7, %8
%10 = load double, double* %6
%11 = fadd double %9, %10
ret double %11
}

LLVM IR (-O2):
define double @sum3(double %0, double %1, double %2) {
%4 = fadd double %0, %1
%5 = fadd double %4, %2
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ memmove(int *, int *, int);
void array_rol(int *a, int size) {
  int t;
  t = *a;
  memmove(a, a + 1, (size - 1) * sizeof(int));
  *(a + size - 1) = t;
}


x86 assembly (clang, -O0):
<array_rol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x4,%rsi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,-0x4(%rax,%rcx,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_rol>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    (%rdi),%ebp
lea    0x4(%rdi),%rsi
lea    -0x4(,%r14,4),%edx
ff
call   1030 <memmove@plt>
movslq %r14d,%rax
mov    %ebp,-0x4(%rbx,%rax,4)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @array_rol(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %4
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call i32 @memmove(i32* %8, i32* %10, i32 %15)
%17 = load i32, i32* %5
%18 = load i32*, i32** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = getelementptr inbounds i32, i32* %21, i64 -1
store i32 %17, i32* %22
ret void
}

LLVM IR (-O2):
define void @array_rol(i32* %0, i32 %1) {
%3 = load i32, i32* %0
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = shl i32 %1, 2
%6 = add i32 %5, -4
%7 = tail call i32 @memmove(i32* %0, i32* %4, i32 %6)
%8 = sext i32 %1 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 -1
store i32 %3, i32* %10
ret void
}
void PutLongNum(numb, h, v) long numb;
int h, v;
{
  char temp[255];
  sprintf((char *)temp, "%ld", numb);
  moveTo(h, v);
  drawString(h, v, temp);
}


x86 assembly (clang, -O0):
<PutLongNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xea9(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1050 <moveTo@plt>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
lea    -0x110(%rbp),%rdx
mov    $0x0,%al
call   1030 <drawString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutLongNum>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%rdx
lea    0xeb7(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <moveTo@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <drawString@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
define void @PutLongNum(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
%7 = alloca [255 x i8]
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%9 = load i64, i64* %4
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%17 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @drawString to i32 (i32, i32, i8*, ...)*)(i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
define void @PutLongNum(i64 %0, i32 %1, i32 %2) {
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %1, i32 %2)
%8 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @drawString to i32 (i32, i32, i8*, ...)*)(i32 %1, i32 %2, i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t first(uint32_t x, uint32_t y) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @first(i32 returned %0, i32 %1) {
ret i32 %0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ bits_per_rgb;
};
typedef TYPE_1__ XVisualInfo;

/* Variables and functions */
int get_XVisualInfo_bits_per_rgb(void *_p) {
  return (int)((XVisualInfo *)_p)->bits_per_rgb;
}


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

x86 assembly (clang, -O2):
<get_XVisualInfo_bits_per_rgb>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XVisualInfo_bits_per_rgb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XVisualInfo_bits_per_rgb(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void default_mus_error(int ignore, char *msg) { fprintf(stderr, "%s", msg); }


x86 assembly (clang, -O0):
<default_mus_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_mus_error>:
mov    %rsi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"%s\00"
define void @default_mus_error(i32 %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
void swap(char *a, char *b) {
  if (a == NULL || b == NULL) {
    return;
  }
  char temp = *a;
  *a = *b;
  *b = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1122 <swap+0x22>
cmpq   $0x0,-0x10(%rbp)
jne    1127 <swap+0x27>
jmp    1145 <swap+0x45>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
test   %rdi,%rdi
je     1112 <swap+0x12>
test   %rsi,%rsi
je     1112 <swap+0x12>
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

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

LLVM IR (-O2):
define void @swap(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
%4 = icmp eq i8* %1, null
%5 = or i1 %3, %4
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = load i8, i8* %1
store i8 %8, i8* %0
store i8 %7, i8* %1
br label %9
9: ; preds = %2, %6
ret void
}
/* Type definitions */
typedef int uint_least8_t;

/* Variables and functions */
bool SHAREMIND_MAP_KEY_COPY_uint_least8_t(uint_least8_t *const dest,
                                          uint_least8_t const src) {
  return (((*dest) = src), true);
}


x86 assembly (clang, -O0):
<SHAREMIND_MAP_KEY_COPY_uint_least8_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @SHAREMIND_MAP_KEY_COPY_uint_least8_t(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ f1(unsigned int, unsigned int);
int /*<<< orphan*/ f2(unsigned long, unsigned long);
main() {
  f1((~(unsigned int)0 >> 1) - 12, ~(~(unsigned int)0 >> 1) + 1);
  f2((~(unsigned long int)0 >> 1) - 12, ~(~(unsigned long int)0 >> 1) + 1);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7ffffff3,%edi
mov    $0x80000001,%esi
call   1040 <f1@plt>
movabs $0x7ffffffffffffff3,%rdi
ff ff 7f
movabs $0x8000000000000001,%rsi
call   1030 <f2@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7ffffff3,%edi
mov    $0x80000001,%esi
call   1040 <f1@plt>
movabs $0x7ffffffffffffff3,%rdi
ff ff 7f
lea    0xe(%rdi),%rsi
call   1030 <f2@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @f1(i32 2147483635, i32 -2147483647)
%3 = call i32 @f2(i64 9223372036854775795, i64 -9223372036854775807)
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f1(i32 2147483635, i32 -2147483647)
%2 = tail call i32 @f2(i64 9223372036854775795, i64 -9223372036854775807)
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ malloc(int);
void leak_memory() {
  int *const temporary = (int *)malloc(sizeof(int));
  *temporary = 0;
}


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

x86 assembly (clang, -O2):
<leak_memory>:
push   %rax
mov    $0x4,%edi
call   1030 <malloc@plt>
movl   $0x0,(%rax)
pop    %rax
ret

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

LLVM IR (-O2):
define void @leak_memory() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
store i32 0, i32* %2
ret void
}
int test_imm_D7int8_mem(signed char *val) {
  return ((*val) & (-0xD7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_D7int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff29,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_D7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -215
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
float TMP_Celsius(float voltage) { return ((voltage - 0.5) * 100); }


x86 assembly (clang, -O0):
<TMP_Celsius>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeee(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xeda(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<TMP_Celsius>:
cvtss2sd %xmm0,%xmm0
addsd  0xef4(%rip),%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @TMP_Celsius(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fsub double %4, 5.000000e-01
%6 = fmul double %5, 1.000000e+02
%7 = fptrunc double %6 to float
ret float %7
}

LLVM IR (-O2):
define float @TMP_Celsius(float %0) {
%2 = fpext float %0 to double
%3 = fadd double %2, -5.000000e-01
%4 = fmul double %3, 1.000000e+02
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
size_t size_max(const size_t x, const size_t y) { return (x > y) ? x : y; }


x86 assembly (clang, -O0):
<size_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    1127 <size_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <size_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<size_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmova  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @size_max(i64 %0, i64 %1) {
%3 = icmp ugt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
float gluefloat(short low, short high) {
  float value;
  ((short *)&value)[0] = low;
  ((short *)&value)[1] = high;
  return value;
}


x86 assembly (clang, -O0):
<gluefloat>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x8(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x6(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<gluefloat>:
movzwl %di,%eax
shl    $0x10,%esi
or     %eax,%esi
movd   %esi,%xmm0
ret

LLVM IR (-O0):
define float @gluefloat(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
%5 = alloca float
store i16 %0, i16* %3
store i16 %1, i16* %4
%6 = load i16, i16* %3
%7 = bitcast float* %5 to i16*
%8 = getelementptr inbounds i16, i16* %7, i64 0
store i16 %6, i16* %8
%9 = load i16, i16* %4
%10 = bitcast float* %5 to i16*
%11 = getelementptr inbounds i16, i16* %10, i64 1
store i16 %9, i16* %11
%12 = load float, float* %5
ret float %12
}

LLVM IR (-O2):
define float @gluefloat(i16 signext %0, i16 signext %1) {
%3 = zext i16 %0 to i32
%4 = zext i16 %1 to i32
%5 = shl nuw i32 %4, 16
%6 = or i32 %5, %3
%7 = bitcast i32 %6 to float
ret float %7
}
int main() {
  int a, b, c;
  a = c;
  b = 2;
  c = b;
  a = 3;
  c = a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
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
%4 = alloca i32
store i32 0, i32* %1
%5 = load i32, i32* %4
store i32 %5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %3
store i32 %6, i32* %4
store i32 3, i32* %2
%7 = load i32, i32* %2
store i32 %7, i32* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ROR_();
int /*<<< orphan*/ c64_memAbsoluteAddr();
void ROR_abs(void) {
  c64_memAbsoluteAddr();
  ROR_();
}


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

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

LLVM IR (-O0):
define void @ROR_abs() {
%1 = call i32 (...) @c64_memAbsoluteAddr()
%2 = call i32 (...) @ROR_()
ret void
}

LLVM IR (-O2):
define void @ROR_abs() {
%1 = tail call i32 (...) @c64_memAbsoluteAddr()
%2 = tail call i32 (...) @ROR_()
ret void
}
void PECIBypassEnable(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000800;
}


x86 assembly (clang, -O0):
<PECIBypassEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x800,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PECIBypassEnable>:
orq    $0x800,(%rdi)
ret

LLVM IR (-O0):
define void @PECIBypassEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 0
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 2048
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @PECIBypassEnable(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 2048
store volatile i64 %4, i64* %2
ret void
}
void psp_vdp1_draw_end(void) {}


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

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

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

LLVM IR (-O2):
define void @psp_vdp1_draw_end() {
ret void
}
void deterministic_seed(const void *buf, int num) { return; }


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

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

LLVM IR (-O0):
define void @deterministic_seed(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 @deterministic_seed(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ tarefa(int);
int main(int argc, char *argv[]) {
  int x;
  scanf("%d", &x);
  for (int j = 1; j <= x; j++)
    tarefa(j);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     116f <main+0x4f>
mov    -0x18(%rbp),%edi
call   1030 <tarefa@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <main+0x2d>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    1150 <main+0x30>
xor    %ebx,%ebx
nop
add    $0x1,%ebx
mov    %ebx,%edi
call   1030 <tarefa@plt>
cmp    0xc(%rsp),%ebx
jl     1140 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 1, i32* %7
br label %9
9: ; preds = %16, %2
%10 = load i32, i32* %7
%11 = load i32, i32* %6
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i32, i32* %7
%15 = call i32 @tarefa(i32 %14)
br label %16
16: ; preds = %13
%17 = load i32, i32* %7
%18 = add nsw i32 %17, 1
store i32 %18, i32* %7
br label %9
19: ; preds = %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %9
8: ; preds = %9, %2
ret i32 0
9: ; preds = %2, %9
%10 = phi i32 [ %12, %9 ], [ 1, %2 ]
%11 = call i32 @tarefa(i32 %10)
%12 = add nuw nsw i32 %10, 1
%13 = load i32, i32* %3
%14 = icmp slt i32 %10, %13
br i1 %14, label %9, label %8
}
int test_imm_A6int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xA6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A6int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 10878976
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int main(int ac, char *av[]) {
  (void)ac;
  (void)av;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
int cairo_code_draw_envPeakrmsLabel_get_height() { return 156; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envPeakrmsLabel_get_height() {
ret i32 156
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envPeakrmsLabel_get_height() {
ret i32 156
}
/* Variables and functions */
int string_length(char *);
int arch_main() { return string_length("kernel"); }


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

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

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

LLVM IR (-O2):
@.str = [7 x i8] c"kernel\00"
define i32 @arch_main() {
%1 = tail call i32 @string_length(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int stringEndsWith(char const *, char *);
bool parameterIsArray(const char *parameterType) {
  return stringEndsWith(parameterType, " []");
}


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

x86 assembly (clang, -O2):
<parameterIsArray>:
lea    0xee9(%rip),%rsi
jmp    1030 <stringEndsWith@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c" []\00"
define i32 @parameterIsArray(i8* %0) {
%2 = tail call i32 @stringEndsWith(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void adc_driver_init(void) {
  system("modprobe mcp3422");
  system("echo mcp3424 0x68 > /sys/bus/i2c/devices/i2c-1/new_device");
  system("echo mcp3424 0x69 > /sys/bus/i2c/devices/i2c-1/new_device");
}


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

x86 assembly (clang, -O2):
<adc_driver_init>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <system@plt>
lea    0xeed(%rip),%rdi
call   1030 <system@plt>
lea    0xf1b(%rip),%rdi
pop    %rax
jmp    1030 <system@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"modprobe mcp3422\00"
@.str.1 = [58 x i8] c"echo mcp3424 0x68 > /sys/bus/i2c/devices/i2c-1/new_device\00"
@.str.2 = [58 x i8] c"echo mcp3424 0x69 > /sys/bus/i2c/devices/i2c-1/new_device\00"
define void @adc_driver_init() {
%1 = call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"modprobe mcp3422\00"
@.str.1 = [58 x i8] c"echo mcp3424 0x68 > /sys/bus/i2c/devices/i2c-1/new_device\00"
@.str.2 = [58 x i8] c"echo mcp3424 0x69 > /sys/bus/i2c/devices/i2c-1/new_device\00"
define void @adc_driver_init() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0))
ret void
}
float frexpf(float x, int *exp) { return __builtin_frexpf(x, exp); }


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

x86 assembly (clang, -O2):
<frexpf>:
jmp    1100 <frexpf>

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

LLVM IR (-O2):
define float @frexpf(float %0, i32* nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
void av_reduce() {}


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

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

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

LLVM IR (-O2):
define void @av_reduce() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int (*fp)();
  char buffer[64];
  fp = 0;
  printf("You win this game if you are able to call the function win.'\n");
  gets(buffer);
  if (fp) {
    printf("calling function pointer, jumping to %p\n", fp);
    fp();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rdi
call   1040 <gets@plt>
cmpq   $0x0,-0x18(%rbp)
je     1177 <main+0x57>
mov    -0x18(%rbp),%rsi
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   *-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1040 <gets@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"You win this game if you are able to call the function win.'\0A\00"
@.str.1 = [41 x i8] c"calling function pointer, jumping to %p\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32 (...)*
%7 = alloca [64 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 (...)* null, i32 (...)** %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%10 = call i32 @gets(i8* %9)
%11 = load i32 (...)*, i32 (...)** %6
%12 = icmp ne i32 (...)* %11, null
br i1 %12, label %13, label %18
13: ; preds = %2
%14 = load i32 (...)*, i32 (...)** %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0), i32 (...)* %14)
%16 = load i32 (...)*, i32 (...)** %6
%17 = call i32 (...) %16()
br label %18
18: ; preds = %13, %2
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@str = [61 x i8] c"You win this game if you are able to call the function win.'\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [64 x i8]
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%6 = call i32 @gets(i8* %4)
ret i32 0
}
int fun1290() { return 1290; }


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

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

LLVM IR (-O0):
define i32 @fun1290() {
ret i32 1290
}

LLVM IR (-O2):
define i32 @fun1290() {
ret i32 1290
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int ts_packet_is_pusi(uint8_t *ts_packet) {
  return (ts_packet[1] & ~0xbf) >> 6;
}


x86 assembly (clang, -O0):
<ts_packet_is_pusi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0xffffff40,%eax
sar    $0x6,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_packet_is_pusi>:
mov    0x4(%rdi),%eax
sar    $0x6,%eax
and    $0xfffffffd,%eax
ret

LLVM IR (-O0):
define i32 @ts_packet_is_pusi(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, -192
%7 = ashr i32 %6, 6
ret i32 %7
}

LLVM IR (-O2):
define i32 @ts_packet_is_pusi(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = ashr i32 %3, 6
%5 = and i32 %4, -3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int main(void) {
  struct date {
    int month;
    int day;
    int year;
  };
  struct date today, *datePtr;
  datePtr = &today;
  datePtr->month = 9;
  datePtr->day = 25;
  datePtr->year = 2015;
  printf("Today's date is: %i/%i/%.2i.\n", datePtr->month, datePtr->day,
         datePtr->year % 100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x9,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x19,0x4(%rax)
mov    -0x18(%rbp),%rax
movl   $0x7df,0x8(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
mov    -0x1c(%rbp),%edx
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.date = type { i32, i32, i32 }
@.str = [30 x i8] c"Today's date is: %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.date
%3 = alloca %struct.date*
store i32 0, i32* %1
store %struct.date* %2, %struct.date** %3
%4 = load %struct.date*, %struct.date** %3
%5 = getelementptr inbounds %struct.date, %struct.date* %4, i32 0, i32 0
store i32 9, i32* %5
%6 = load %struct.date*, %struct.date** %3
%7 = getelementptr inbounds %struct.date, %struct.date* %6, i32 0, i32 1
store i32 25, i32* %7
%8 = load %struct.date*, %struct.date** %3
%9 = getelementptr inbounds %struct.date, %struct.date* %8, i32 0, i32 2
store i32 2015, i32* %9
%10 = load %struct.date*, %struct.date** %3
%11 = getelementptr inbounds %struct.date, %struct.date* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load %struct.date*, %struct.date** %3
%14 = getelementptr inbounds %struct.date, %struct.date* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = load %struct.date*, %struct.date** %3
%17 = getelementptr inbounds %struct.date, %struct.date* %16, i32 0, i32 2
%18 = load i32, i32* %17
%19 = srem i32 %18, 100
%20 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %15, i32 %19)
ret i32 0
}

LLVM IR (-O2):
%struct.date = type { i32, i32, i32 }
@.str = [30 x i8] c"Today's date is: %i/%i/%.2i.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 9, i32 25, i32 15)
ret i32 0
}
void PRMJ_NowShutdown() {}


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

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

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

LLVM IR (-O2):
define void @PRMJ_NowShutdown() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
short ishortminus(short x, short y) {
  x -= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<ishortminus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
sub    $0x18,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1145 <ishortminus+0x35>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishortminus>:
push   %rbx
mov    %edi,%ebx
add    $0xffe8,%bx
jne    1120 <ishortminus+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @ishortminus(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = sub nsw i32 %6, 24
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %3
%10 = icmp ne i16 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @foo(i8* null)
br label %13
13: ; preds = %11, %2
%14 = load i16, i16* %3
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @ishortminus(i16 signext %0, i16 signext %1) {
%3 = add i16 %0, -24
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
int test_imm_6Cuint8_mem(unsigned char *val) {
  return ((*val) & (-0x6C << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_6Cuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -108
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ n_properties;
};
typedef TYPE_1__ XFontStruct;

/* Variables and functions */
int get_XFontStruct_n_properties(void *_p) {
  return (int)((XFontStruct *)_p)->n_properties;
}


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

x86 assembly (clang, -O2):
<get_XFontStruct_n_properties>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XFontStruct_n_properties(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XFontStruct_n_properties(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
long int longint_ignoring_unsignedlonglong(long int x, unsigned long long y) {
  return x;
}


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

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

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

LLVM IR (-O2):
define i64 @longint_ignoring_unsignedlonglong(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, int, int, int, int);
void say_fun_a_b_c_d(const char *fun, int a, int b, int c, int d) {
  printf("<%s> a=%d b=%d c=%d d=%d\n", fun, a, b, c, d);
}


x86 assembly (clang, -O0):
<say_fun_a_b_c_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<say_fun_a_b_c_d>:
mov    %r8d,%r9d
mov    %ecx,%r8d
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xedc(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"<%s> a=%d b=%d c=%d d=%d\0A\00"
define void @say_fun_a_b_c_d(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %8
%14 = load i32, i32* %9
%15 = load i32, i32* %10
%16 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12, i32 %13, i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"<%s> a=%d b=%d c=%d d=%d\0A\00"
define void @say_fun_a_b_c_d(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %2, i32 %3, i32 %4)
ret void
}
double onetick_duration(int tempo, int div) {
  double duration;
  duration = (double)tempo / (double)div;
  duration /= 1000.0;
  return duration;
}


x86 assembly (clang, -O0):
<onetick_duration>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<onetick_duration>:
cvtsi2sd %edi,%xmm0
cvtsi2sd %esi,%xmm1
divsd  %xmm1,%xmm0
divsd  0xeec(%rip),%xmm0
ret

LLVM IR (-O0):
define double @onetick_duration(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = fdiv double %11, 1.000000e+03
store double %12, double* %5
%13 = load double, double* %5
ret double %13
}

LLVM IR (-O2):
define double @onetick_duration(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fdiv double %3, %4
%6 = fdiv double %5, 1.000000e+03
ret double %6
}