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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void fun() {
  int64_t number = 600851475143;
  int d = 2;
  while (number > 1) {
    if (0 == (number % d)) {
      number /= d;
    } else {
      ++d;
    }
  }
  printf("%d\n", d);
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xe589eac7,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1160 <fun+0x50>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    1152 <fun+0x42>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    115b <fun+0x4b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <fun+0x16>
mov    -0x8(%rbp),%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    0xee9(%rip),%rdi
mov    $0x2,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @fun() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
ret void
}
void gtk_fixed_put() {}


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

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

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

LLVM IR (-O2):
define void @gtk_fixed_put() {
ret void
}
void console_madness_end() {}


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

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

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

LLVM IR (-O2):
define void @console_madness_end() {
ret void
}
__attribute__((visibility("hidden"))) void tux_usb_exit_module(void) {}


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

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

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

LLVM IR (-O2):
define hidden void @tux_usb_exit_module() {
ret void
}
void alias_OK() {
  int i, j;
  j = i;
  i = ++i;
}


x86 assembly (clang, -O0):
<alias_OK>:
push   %rbp
mov    %rsp,%rbp
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @alias_OK() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
store i32 %3, i32* %2
%4 = load i32, i32* %1
%5 = add nsw i32 %4, 1
store i32 %5, i32* %1
store i32 %5, i32* %1
ret void
}

LLVM IR (-O2):
define void @alias_OK() {
ret void
}
/* Variables and functions */
int abs(int);
int max_dist(int a, int b) {
  int fdi = abs(a % 10 - b % 10);
  int rdi = abs(a / 10 - b / 10);
  return (((rdi) > (fdi)) ? (rdi) : (fdi));
}


x86 assembly (clang, -O0):
<max_dist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
sub    %edx,%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
sub    %eax,%edi
call   1030 <abs@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1179 <max_dist+0x69>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    117f <max_dist+0x6f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<max_dist>:
movslq %esi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%edx
sub    %eax,%edx
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rcx
mov    %rcx,%rdi
shr    $0x3f,%rdi
sar    $0x22,%rcx
add    %edi,%ecx
lea    (%rcx,%rcx,1),%edi
lea    (%rdi,%rdi,4),%edi
sub    %edi,%esi
add    %edx,%esi
mov    %esi,%edx
neg    %edx
cmovs  %esi,%edx
imul   $0xffffffff99999999,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x22,%rsi
add    %eax,%esi
add    %ecx,%esi
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
cmp    %edx,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @max_dist(i32 %0, i32 %1) {
%3 = srem i32 %0, 10
%4 = srem i32 %1, 10
%5 = sub nsw i32 %3, %4
%6 = tail call i32 @llvm.abs.i32(i32 %5, i1 true)
%7 = sdiv i32 %0, 10
%8 = sdiv i32 %1, -10
%9 = add nsw i32 %8, %7
%10 = tail call i32 @llvm.abs.i32(i32 %9, i1 true)
%11 = icmp ugt i32 %10, %6
%12 = select i1 %11, i32 %10, i32 %6
ret i32 %12
}
/* Variables and functions */
unsigned short htons(unsigned short);
int /*<<< orphan*/ memcpy(char *, unsigned short *, int);
void writeShort(unsigned short value, char *out) {
  unsigned short v = htons(value);
  memcpy(out, &v, 2);
}


x86 assembly (clang, -O0):
<writeShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <htons@plt>
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x12(%rbp),%rsi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeShort>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <htons@plt>
mov    %ax,0xe(%rsp)
lea    0xe(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @writeShort(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
%5 = alloca i16
store i16 %0, i16* %3
store i8* %1, i8** %4
%6 = load i16, i16* %3
%7 = call zeroext i16 @htons(i16 zeroext %6)
store i16 %7, i16* %5
%8 = load i8*, i8** %4
%9 = call i32 @memcpy(i8* %8, i16* %5, i32 2)
ret void
}

LLVM IR (-O2):
define void @writeShort(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = bitcast i16* %3 to i8*
%5 = tail call zeroext i16 @htons(i16 zeroext %0)
store i16 %5, i16* %3
%6 = call i32 @memcpy(i8* %1, i16* %3, i32 2)
ret void
}
unsigned xrop3_51_0_0(unsigned char s, unsigned char t) {
  unsigned S = ((unsigned)s << 8) | s;
  unsigned stk1;
  stk1 = ~S;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_51_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_51_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @xrop3_51_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = xor i32 %13, -1
store i32 %14, i32* %6
%15 = load i32, i32* %6
ret i32 %15
}

LLVM IR (-O2):
define i32 @xrop3_51_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = xor i32 %4, -1
ret i32 %5
}
void av_mediacodec_default_free() {}


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

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

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

LLVM IR (-O2):
define void @av_mediacodec_default_free() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void hello(void) {
  int my_rank = 0;
  int thread_count = 1;
  printf("Hello from thread %d of %d\n", my_rank, thread_count);
}


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

x86 assembly (clang, -O2):
<hello>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"Hello from thread %d of %d\0A\00"
define void @hello() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Hello from thread %d of %d\0A\00"
define void @hello() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
ret void
}
/* Variables and functions */
int obtenlinea();
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ voltea();
int main(void) {
  int longitud;
  extern int max;
  extern char linea_max[1000];
  max = 0;
  while ((longitud = obtenlinea()) > 0) {
    voltea();
    printf("%s", linea_max);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e92(%rip),%rax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <obtenlinea@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    117e <main+0x4e>
mov    $0x0,%al
call   1050 <voltea@plt>
lea    0xe93(%rip),%rdi
mov    0x2e6c(%rip),%rsi
call   1040 <printf@plt>
jmp    114c <main+0x1c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e9d(%rip),%rax
movl   $0x0,(%rax)
xor    %eax,%eax
call   1030 <obtenlinea@plt>
test   %eax,%eax
jle    117d <main+0x4d>
lea    0xead(%rip),%r14
mov    0x2e86(%rip),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <voltea@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <obtenlinea@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@max = external global i32
@.str = [3 x i8] c"%s\00"
@linea_max = external global [1000 x i8]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* @max
br label %3
3: ; preds = %6, %0
%4 = call i32 (...) @obtenlinea()
store i32 %4, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = call i32 (...) @voltea()
%8 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
br label %3
9: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@max = external global i32
@.str = [3 x i8] c"%s\00"
@linea_max = external global [1000 x i8]
define i32 @main() {
store i32 0, i32* @max
%1 = tail call i32 (...) @obtenlinea()
%2 = icmp sgt i32 %1, 0
br i1 %2, label %3, label %8
3: ; preds = %0, %3
%4 = tail call i32 (...) @voltea()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1000 x i8], [1000 x i8]* @linea_max, i64 0, i64 0))
%6 = tail call i32 (...) @obtenlinea()
%7 = icmp sgt i32 %6, 0
br i1 %7, label %3, label %8
8: ; preds = %3, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void gen_lohi_caps(FILE *outfile, int lohi) {
  if (lohi == 0) {
    fprintf(outfile, "LO");
  } else {
    fprintf(outfile, "HI");
  }
}


x86 assembly (clang, -O0):
<gen_lohi_caps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <gen_lohi_caps+0x2e>
mov    -0x8(%rbp),%rdi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
jmp    114e <gen_lohi_caps+0x3e>
mov    -0x8(%rbp),%rdi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_lohi_caps>:
mov    %rdi,%rcx
test   %esi,%esi
lea    0xee4(%rip),%rax
lea    0xee0(%rip),%rdi
cmove  %rax,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"LO\00"
@.str.1 = [3 x i8] c"HI\00"
define void @gen_lohi_caps(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 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %13
10: ; preds = %2
%11 = load i32*, i32** %3
%12 = call i32 @fprintf(i32* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"LO\00"
@.str.1 = [3 x i8] c"HI\00"
define void @gen_lohi_caps(i32* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i64 @fwrite(i8* %4, i64 2, i64 1, i32* %0)
ret void
}
/* Variables and functions */
char *_create_filename(char const *, char *, char);
char *sparkey_create_log_filename(const char *index_filename) {
  return _create_filename(index_filename, ".spi", 'l');
}


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

x86 assembly (clang, -O2):
<sparkey_create_log_filename>:
lea    0xee9(%rip),%rsi
mov    $0x6c,%edx
jmp    1030 <_create_filename@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c".spi\00"
define i8* @sparkey_create_log_filename(i8* %0) {
%2 = tail call i8* @_create_filename(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 108)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ arch_accel(int /*<<< orphan*/);
uint32_t mpeg2_detect_accel(uint32_t accel) {
  accel = arch_accel(accel);
  return accel;
}


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

x86 assembly (clang, -O2):
<mpeg2_detect_accel>:
jmp    1030 <arch_accel@plt>

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

LLVM IR (-O2):
define i32 @mpeg2_detect_accel(i32 %0) {
%2 = tail call i32 @arch_accel(i32 %0)
ret i32 %2
}
long _unswitching() {
  long EV_a;
  long EV_b;
  EV_a = 1;
  EV_b = 2;
  while ((EV_a < 1000000)) {
    if ((EV_b == 2)) {
      EV_a = (EV_a + 1);
    } else {
      EV_a = (EV_a + 2);
    }
  }
  return EV_a;
}


x86 assembly (clang, -O0):
<_unswitching>:
push   %rbp
mov    %rsp,%rbp
movq   $0x1,-0x8(%rbp)
movq   $0x2,-0x10(%rbp)
cmpq   $0xf4240,-0x8(%rbp)
jge    114f <_unswitching+0x4f>
cmpq   $0x2,-0x10(%rbp)
jne    113e <_unswitching+0x3e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114a <_unswitching+0x4a>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <_unswitching+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @_unswitching() {
ret i64 1000000
}
/* Type definitions */
struct ioctl_entry {
  int dummy;
};
struct ioctl_args {
  int dummy;
};

/* Variables and functions */
int do_set_ioctl_int(struct ioctl_args *, struct ioctl_entry *);
int set_delta(struct ioctl_args *args, struct ioctl_entry *entry) {
  return do_set_ioctl_int(args, entry);
}


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

x86 assembly (clang, -O2):
<set_delta>:
jmp    1030 <do_set_ioctl_int@plt>

LLVM IR (-O0):
%struct.ioctl_args = type { i32 }
%struct.ioctl_entry = type { i32 }
define i32 @set_delta(%struct.ioctl_args* %0, %struct.ioctl_entry* %1) {
%3 = alloca %struct.ioctl_args*
%4 = alloca %struct.ioctl_entry*
store %struct.ioctl_args* %0, %struct.ioctl_args** %3
store %struct.ioctl_entry* %1, %struct.ioctl_entry** %4
%5 = load %struct.ioctl_args*, %struct.ioctl_args** %3
%6 = load %struct.ioctl_entry*, %struct.ioctl_entry** %4
%7 = call i32 @do_set_ioctl_int(%struct.ioctl_args* %5, %struct.ioctl_entry* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.ioctl_args = type { i32 }
%struct.ioctl_entry = type { i32 }
define i32 @set_delta(%struct.ioctl_args* %0, %struct.ioctl_entry* %1) {
%3 = tail call i32 @do_set_ioctl_int(%struct.ioctl_args* %0, %struct.ioctl_entry* %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ xfree(void *);
void yy_flex_free(void *ptr) { xfree(ptr); }


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

x86 assembly (clang, -O2):
<yy_flex_free>:
jmp    1030 <xfree@plt>

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

LLVM IR (-O2):
define void @yy_flex_free(i8* %0) {
%2 = tail call i32 @xfree(i8* %0)
ret void
}
int cmp(const void *a, const void *b) {
  const int *A = a;
  const int *B = b;
  return (*A > *B) - (*A < *B);
}


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @calculate_sum_dice(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int a[], int n) {
  for (int i = n / 2 - 1; i >= 0; --i)
    max_heapify(a, n, i);
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     1157 <build_max_heap+0x47>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_max_heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_max_heap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
lea    -0x2(%rbx),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(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 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %4
%15 = load i32, i32* %5
%16 = call i32 @max_heapify(i32* %13, i32 %14, i32 %15)
br label %17
17: ; preds = %12
%18 = load i32, i32* %5
%19 = add nsw i32 %18, -1
store i32 %19, i32* %5
br label %9
20: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = lshr i32 %1, 1
br label %7
6: ; preds = %7, %2
ret void
7: ; preds = %4, %7
%8 = phi i32 [ %9, %7 ], [ %5, %4 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @max_heapify(i32* %0, i32 %1, i32 %9)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %6
}
void to_upper(str) char *str;
{
  while ((*str = (toupper(*str))) != '\0')
    str++;
}


x86 assembly (clang, -O0):
<to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    -0x8(%rbp),%rcx
mov    %al,(%rcx)
movsbl %al,%eax
cmp    $0x0,%eax
je     114b <to_upper+0x3b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <to_upper+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_upper>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
add    $0x1,%rbx
test   %al,%al
jne    1120 <to_upper+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @to_upper(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %12, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = call i32 @toupper(i32 %6)
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %2
store i8 %8, i8* %9
%10 = sext i8 %8 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %3
15: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @to_upper(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %10, %2 ]
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = tail call i32 @toupper(i32 %5)
%7 = trunc i32 %6 to i8
store i8 %7, i8* %3
%8 = and i32 %6, 255
%9 = icmp eq i32 %8, 0
%10 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %9, label %11, label %2
11: ; preds = %2
ret void
}
/* Variables and functions */
scalar_t__ Day(double);
int pmod(scalar_t__, int);
int WeekDay(double t) { return pmod(Day(t) + 4, 7); }


x86 assembly (clang, -O0):
<WeekDay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <Day@plt>
mov    %rax,%rdi
add    $0x4,%rdi
mov    $0x7,%esi
call   1040 <pmod@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<WeekDay>:
push   %rax
call   1030 <Day@plt>
lea    0x4(%rax),%rdi
mov    $0x7,%esi
pop    %rax
jmp    1040 <pmod@plt>

LLVM IR (-O0):
define i32 @WeekDay(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @Day(double %3)
%5 = add nsw i64 %4, 4
%6 = call i32 @pmod(i64 %5, i32 7)
ret i32 %6
}

LLVM IR (-O2):
define i32 @WeekDay(double %0) {
%2 = tail call i64 @Day(double %0)
%3 = add nsw i64 %2, 4
%4 = tail call i32 @pmod(i64 %3, i32 7)
ret i32 %4
}
/* Variables and functions */
char *_y4m_alloc(int);
char *y4m_new_xtag() { return _y4m_alloc(32 * sizeof(char)); }


x86 assembly (clang, -O0):
<y4m_new_xtag>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
call   1030 <_y4m_alloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<y4m_new_xtag>:
mov    $0x20,%edi
jmp    1030 <_y4m_alloc@plt>

LLVM IR (-O0):
define i8* @y4m_new_xtag() {
%1 = call i8* @_y4m_alloc(i32 32)
ret i8* %1
}

LLVM IR (-O2):
define i8* @y4m_new_xtag() {
%1 = tail call i8* @_y4m_alloc(i32 32)
ret i8* %1
}
unsigned int set_bit_on(int reg, int pos) {
  int mask, output;
  mask = 1 << pos;
  output = reg | mask;
  return output;
}


x86 assembly (clang, -O0):
<set_bit_on>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @set_bit_on(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = shl i32 1, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %5
%11 = or i32 %9, %10
store i32 %11, i32* %6
%12 = load i32, i32* %6
ret i32 %12
}

LLVM IR (-O2):
define i32 @set_bit_on(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sumByReference(int *, int *);
int sumByValue(int, int);
void runSum() {
  int a = 10, b = 20;
  int *pa, *pb;
  pa = &a;
  pb = &b;
  printf("The total sum is %d \n", sumByValue(a, b));
  printf("The total sum is %d \n", sumByReference(pa, pb));
}


x86 assembly (clang, -O0):
<runSum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <sumByValue@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <sumByReference@plt>
mov    %eax,%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<runSum>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
mov    $0xa,%edi
mov    $0x14,%esi
call   1040 <sumByValue@plt>
lea    0xea5(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1050 <sumByReference@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"The total sum is %d \0A\00"
define void @runSum() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 10, i32* %1
store i32 20, i32* %2
store i32* %1, i32** %3
store i32* %2, i32** %4
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @sumByValue(i32 %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = call i32 @sumByReference(i32* %9, i32* %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"The total sum is %d \0A\00"
define void @runSum() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @sumByValue(i32 10, i32 20)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @sumByReference(i32* %1, i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *num_buf(int n) {
  static char buf[32];
  sprintf(buf, "%d", n);
  return buf;
}


x86 assembly (clang, -O0):
<num_buf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_buf>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@num_buf.buf = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @num_buf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @num_buf.buf, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @num_buf.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@num_buf.buf = internal global [32 x i8] zeroinitializer
@.str = [3 x i8] c"%d\00"
define i8* @num_buf(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @num_buf.buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @num_buf.buf, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ off_t;

/* Variables and functions */
off_t tar_endrd(void) { return ((off_t)(2 * 512)); }


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

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

LLVM IR (-O0):
define i32 @tar_endrd() {
ret i32 1024
}

LLVM IR (-O2):
define i32 @tar_endrd() {
ret i32 1024
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char l;
  int n, p;
  scanf("%c", &l);
  n = l - 96;
  p = 27 - n;
  printf("%c", p + 96);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = sub nsw i32 %7, 96
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = sub nsw i32 27, %9
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 96
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
%5 = sub nsw i32 219, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int calc_posicao_fifo_m(int *vetor_alloc, int numero_de_quadros) {
  int cont_alloc = 0;
  while (vetor_alloc[cont_alloc] == 1) {
    vetor_alloc[cont_alloc] = 0;
    cont_alloc = cont_alloc + 1;
    if (cont_alloc > numero_de_quadros) {
      cont_alloc = 0;
      break;
    }
    cont_alloc = cont_alloc + 1;
  }
  return cont_alloc;
}


x86 assembly (clang, -O0):
<calc_posicao_fifo_m>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1162 <calc_posicao_fifo_m+0x62>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1154 <calc_posicao_fifo_m+0x54>
movl   $0x0,-0x10(%rbp)
jmp    1162 <calc_posicao_fifo_m+0x62>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <calc_posicao_fifo_m+0x12>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_posicao_fifo_m>:
xor    %eax,%eax
cmpl   $0x1,(%rdi)
jne    112c <calc_posicao_fifo_m+0x2c>
movslq %esi,%rcx
xor    %eax,%eax
xor    %edx,%edx
xchg   %ax,%ax
movl   $0x0,(%rdi,%rdx,4)
cmp    %rcx,%rdx
jge    112c <calc_posicao_fifo_m+0x2c>
lea    0x2(%rdx),%rsi
cmpl   $0x1,0x8(%rdi,%rdx,4)
mov    %rsi,%rdx
je     1110 <calc_posicao_fifo_m+0x10>
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_posicao_fifo_m(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %18
5: ; preds = %2
%6 = sext i32 %1 to i64
br label %7
7: ; preds = %5, %11
%8 = phi i64 [ 0, %5 ], [ %12, %11 ]
%9 = phi i32* [ %0, %5 ], [ %13, %11 ]
store i32 0, i32* %9
%10 = icmp slt i64 %8, %6
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = add nuw i64 %8, 2
%13 = getelementptr inbounds i32, i32* %0, i64 %12
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 1
br i1 %15, label %7, label %16
16: ; preds = %11
%17 = trunc i64 %12 to i32
br label %18
18: ; preds = %7, %16, %2
%19 = phi i32 [ 0, %2 ], [ %17, %16 ], [ 0, %7 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ malloc(size_t);
void *xalloc(size_t sz) {
  void *p;
  assert(sz > 0);
  p = (void *)malloc(sz);
  assert(p != NULL);
  return (p);
}


x86 assembly (clang, -O0):
<xalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xalloc>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1030 <assert@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load i64, i64* %2
%9 = call i64 @malloc(i64 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = icmp ne i8* %11, null
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @xalloc(i64 %0) {
%2 = icmp ne i64 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @malloc(i64 %0)
%6 = inttoptr i64 %5 to i8*
%7 = icmp ne i64 %5, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
ret i8* %6
}
int findIndex(int *fdlist) {
  int i = 0;
  while (fdlist[i] != -1) {
    i++;
  };
  if (i < 10) {
    return i;
  } else {
    return -1;
  }
}


x86 assembly (clang, -O0):
<findIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     112f <findIndex+0x2f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <findIndex+0xf>
cmpl   $0xa,-0x14(%rbp)
jge    1144 <findIndex+0x44>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <findIndex+0x4b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findIndex>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
cmpl   $0xffffffff,(%rdi)
lea    0x4(%rdi),%rdi
jne    1110 <findIndex+0x10>
cmp    $0xa,%ecx
mov    $0xffffffff,%eax
cmovb  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @findIndex(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -1
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = icmp ult i32 %9, 10
%11 = select i1 %10, i32 %9, i32 -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ QSort(int *, int /*<<< orphan*/, int);
void QuickSort(int a[], int len) { QSort(a, 0, len - 1); }


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

x86 assembly (clang, -O2):
<QuickSort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <QSort@plt>

LLVM IR (-O0):
define void @QuickSort(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 = sub nsw i32 %6, 1
%8 = call i32 @QSort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @QuickSort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @QSort(i32* %0, i32 0, i32 %3)
ret void
}
unsigned long check_ulong() { return 0; }


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

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

LLVM IR (-O0):
define i64 @check_ulong() {
ret i64 0
}

LLVM IR (-O2):
define i64 @check_ulong() {
ret i64 0
}
long mat_modulo_l(const long a, const long b) {
  long c;
  c = a % b;
  if (c < 0) {
    c += b;
  }
  return c;
}


x86 assembly (clang, -O0):
<mat_modulo_l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jge    1131 <mat_modulo_l+0x31>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat_modulo_l>:
mov    %rdi,%rax
mov    %rdi,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     1116 <mat_modulo_l+0x16>
cqto
idiv   %rsi
jmp    111a <mat_modulo_l+0x1a>
xor    %edx,%edx
div    %esi
mov    %rdx,%rax
sar    $0x3f,%rax
and    %rsi,%rax
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @mat_modulo_l(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = srem i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = load i64, i64* %4
%13 = load i64, i64* %5
%14 = add nsw i64 %13, %12
store i64 %14, i64* %5
br label %15
15: ; preds = %11, %2
%16 = load i64, i64* %5
ret i64 %16
}

LLVM IR (-O2):
define i64 @mat_modulo_l(i64 %0, i64 %1) {
%3 = srem i64 %0, %1
%4 = icmp slt i64 %3, 0
%5 = select i1 %4, i64 %1, i64 0
%6 = add nsw i64 %5, %3
ret i64 %6
}
unsigned int pcnt_get(void) {
  unsigned int val;
  val = 0;
  return val;
}


x86 assembly (clang, -O0):
<pcnt_get>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @pcnt_get() {
ret i32 0
}
int intlog2(int i) {
  float x = i;
  return (*(int *)&x >> 23) - 127;
}


x86 assembly (clang, -O0):
<intlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x17,%eax
sub    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlog2>:
cvtsi2ss %edi,%xmm0
movd   %xmm0,%eax
sar    $0x17,%eax
add    $0xffffff81,%eax
ret

LLVM IR (-O0):
define i32 @intlog2(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
store float %5, float* %3
%6 = bitcast float* %3 to i32*
%7 = load i32, i32* %6
%8 = ashr i32 %7, 23
%9 = sub nsw i32 %8, 127
ret i32 %9
}

LLVM IR (-O2):
define i32 @intlog2(i32 %0) {
%2 = sitofp i32 %0 to float
%3 = bitcast float %2 to i32
%4 = ashr i32 %3, 23
%5 = add nsw i32 %4, -127
ret i32 %5
}
/* Variables and functions */
double PMPI_Wtime();
double MPI_Wtime(void) {
  ;
  return PMPI_Wtime();
}


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

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

LLVM IR (-O0):
define double @MPI_Wtime() {
%1 = call double (...) @PMPI_Wtime()
ret double %1
}

LLVM IR (-O2):
define double @MPI_Wtime() {
%1 = tail call double (...) @PMPI_Wtime()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *ft_itoa_base(long, int, char *);
int /*<<< orphan*/ ft_putstr(char *);
void ft_putnbr(long n) {
  char *number;
  number = ft_itoa_base(n, 10, "0123456789");
  ft_putstr(number);
  free(number);
}


x86 assembly (clang, -O0):
<ft_putnbr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
lea    0xeb4(%rip),%rdx
call   1040 <ft_itoa_base@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <ft_putstr@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putnbr>:
push   %rbx
lea    0xec8(%rip),%rdx
mov    $0xa,%esi
call   1040 <ft_itoa_base@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <ft_putstr@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"0123456789\00"
define void @ft_putnbr(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @ft_itoa_base(i64 %4, i32 10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @ft_putstr(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"0123456789\00"
define void @ft_putnbr(i64 %0) {
%2 = tail call i8* @ft_itoa_base(i64 %0, i32 10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @ft_putstr(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret void
}