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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
scalar_t__ fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char GCMGetSystemID(FILE *ifile) {
  if (!ifile) {
    return 0;
  }
  fseek(ifile, 0x0000 + 0x0000, SEEK_SET);
  return (char)fgetc(ifile);
}


x86 assembly (clang, -O0):
<GCMGetSystemID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1140 <GCMGetSystemID+0x20>
movb   $0x0,-0x1(%rbp)
jmp    1160 <GCMGetSystemID+0x40>
mov    -0x10(%rbp),%rdi
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCMGetSystemID>:
test   %rdi,%rdi
je     1143 <GCMGetSystemID+0x23>
push   %rbx
mov    %rdi,%rbx
mov    0x2eb0(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <fseek@plt>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
define signext i8 @GCMGetSystemID(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = icmp ne i32* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i8 0, i8* %2
br label %14
7: ; preds = %1
%8 = load i32*, i32** %3
%9 = load i32, i32* @SEEK_SET
%10 = call i32 @fseek(i32* %8, i32 0, i32 %9)
%11 = load i32*, i32** %3
%12 = call i64 @fgetc(i32* %11)
%13 = trunc i64 %12 to i8
store i8 %13, i8* %2
br label %14
14: ; preds = %7, %6
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define signext i8 @GCMGetSystemID(i32* %0) {
%2 = icmp eq i32* %0, null
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = load i32, i32* @SEEK_SET
%5 = tail call i32 @fseek(i32* %0, i32 0, i32 %4)
%6 = tail call i64 @fgetc(i32* %0)
%7 = trunc i64 %6 to i8
br label %8
8: ; preds = %1, %3
%9 = phi i8 [ %7, %3 ], [ 0, %1 ]
ret i8 %9
}
float get_framerate(long long secs, long long usecs) {
  static long long timestamp_old = 0;
  long long timestamp;
  long long rate;
  timestamp = usecs + secs * 1000000;
  rate = timestamp - timestamp_old;
  if (rate == 0 || timestamp_old == 0) {
    timestamp_old = timestamp;
    return 0.0;
  }
  timestamp_old = timestamp;
  return 1000000 / (float)rate;
}


x86 assembly (clang, -O0):
<get_framerate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
imul   $0xf4240,-0x10(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    0x2efe(%rip),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1147 <get_framerate+0x47>
cmpq   $0x0,0x2ee7(%rip)
jne    115f <get_framerate+0x5f>
mov    -0x20(%rbp),%rax
mov    %rax,0x2ed6(%rip)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1181 <get_framerate+0x81>
mov    -0x20(%rbp),%rax
mov    %rax,0x2ebe(%rip)
cvtsi2ssq -0x28(%rbp),%xmm1
movss  0xe88(%rip),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_framerate>:
imul   $0xf4240,%rdi,%rax
add    %rsi,%rax
mov    0x2f17(%rip),%rcx
mov    %rax,0x2f10(%rip)
xorps  %xmm0,%xmm0
test   %rcx,%rcx
je     1136 <get_framerate+0x36>
sub    %rcx,%rax
je     1136 <get_framerate+0x36>
cvtsi2ss %rax,%xmm1
movss  0xece(%rip),%xmm0
divss  %xmm1,%xmm0
ret

LLVM IR (-O0):
@get_framerate.timestamp_old = internal global i64 0
define float @get_framerate(i64 %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = mul nsw i64 %9, 1000000
%11 = add nsw i64 %8, %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = load i64, i64* @get_framerate.timestamp_old
%14 = sub nsw i64 %12, %13
store i64 %14, i64* %7
%15 = load i64, i64* %7
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %2
%18 = load i64, i64* @get_framerate.timestamp_old
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17, %2
%21 = load i64, i64* %6
store i64 %21, i64* @get_framerate.timestamp_old
store float 0.000000e+00, float* %3
br label %27
22: ; preds = %17
%23 = load i64, i64* %6
store i64 %23, i64* @get_framerate.timestamp_old
%24 = load i64, i64* %7
%25 = sitofp i64 %24 to float
%26 = fdiv float 1.000000e+06, %25
store float %26, float* %3
br label %27
27: ; preds = %22, %20
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
@get_framerate.timestamp_old = internal unnamed_addr global i64 0
define float @get_framerate(i64 %0, i64 %1) {
%3 = mul nsw i64 %0, 1000000
%4 = add nsw i64 %3, %1
%5 = load i64, i64* @get_framerate.timestamp_old
%6 = sub nsw i64 %4, %5
%7 = icmp eq i64 %6, 0
%8 = icmp eq i64 %5, 0
%9 = or i1 %8, %7
store i64 %4, i64* @get_framerate.timestamp_old
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = sitofp i64 %6 to float
%12 = fdiv float 1.000000e+06, %11
br label %13
13: ; preds = %2, %10
%14 = phi float [ %12, %10 ], [ 0.000000e+00, %2 ]
ret float %14
}
/* Variables and functions */
int /*<<< orphan*/ ARRAY_SIZE(int *);
int /*<<< orphan*/ array_print(int *, int /*<<< orphan*/);
int /*<<< orphan*/ cycle_count_from_2_regular(int *, int, int *);
void print_2_regular_cycle_count(int *edges, int n) {
  int cycle_count[n - 1];
  cycle_count_from_2_regular(edges, n, cycle_count);
  array_print(cycle_count, ARRAY_SIZE(cycle_count));
}


x86 assembly (clang, -O0):
<print_2_regular_cycle_count>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x28(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <cycle_count_from_2_regular@plt>
mov    -0x28(%rbp),%rdi
call   1040 <ARRAY_SIZE@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1030 <array_print@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_2_regular_cycle_count>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
lea    -0x1(%rsi),%eax
mov    %rsp,%rbx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
mov    %rbx,%rdx
call   1050 <cycle_count_from_2_regular@plt>
mov    %rbx,%rdi
call   1040 <ARRAY_SIZE@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <array_print@plt>
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @print_2_regular_cycle_count(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = sub nsw i32 %7, 1
%9 = zext i32 %8 to i64
%10 = call i8* @llvm.stacksave()
store i8* %10, i8** %5
%11 = alloca i32, i64 %9
store i64 %9, i64* %6
%12 = load i32*, i32** %3
%13 = load i32, i32* %4
%14 = call i32 @cycle_count_from_2_regular(i32* %12, i32 %13, i32* %11)
%15 = call i32 @ARRAY_SIZE(i32* %11)
%16 = call i32 @array_print(i32* %11, i32 %15)
%17 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @print_2_regular_cycle_count(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = zext i32 %3 to i64
%5 = alloca i32, i64 %4
%6 = call i32 @cycle_count_from_2_regular(i32* %0, i32 %1, i32* %5)
%7 = call i32 @ARRAY_SIZE(i32* %5)
%8 = call i32 @array_print(i32* %5, i32 %7)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int celcon_solve_standard_start_system(int k, int *mv) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(102, &k, mv, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<celcon_solve_standard_start_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x66,%edi
lea    -0x4(%rbp),%rsi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celcon_solve_standard_start_system>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x66,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @celcon_solve_standard_start_system(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32* %1, i32** %4
%7 = load i32*, i32** %4
%8 = load double*, double** %6
%9 = call i32 @_ada_use_c2phc4c(i32 102, i32* %3, i32* %7, double* %8, i32 0)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @celcon_solve_standard_start_system(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc4c(i32 102, i32* %3, i32* %1, double* undef, i32 0)
ret i32 %4
}
/* Type definitions */
struct t_list {
  int dummy;
};

/* Variables and functions */
struct t_list *add_front(struct t_list *, void *, int);
struct t_list *push(struct t_list *plist, void *val, int size) {
  return add_front(plist, val, size);
}


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

x86 assembly (clang, -O2):
<push>:
jmp    1030 <add_front@plt>

LLVM IR (-O0):
%struct.t_list = type { i32 }
define %struct.t_list* @push(%struct.t_list* %0, i8* %1, i32 %2) {
%4 = alloca %struct.t_list*
%5 = alloca i8*
%6 = alloca i32
store %struct.t_list* %0, %struct.t_list** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.t_list*, %struct.t_list** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call %struct.t_list* @add_front(%struct.t_list* %7, i8* %8, i32 %9)
ret %struct.t_list* %10
}

LLVM IR (-O2):
%struct.t_list = type { i32 }
define %struct.t_list* @push(%struct.t_list* %0, i8* %1, i32 %2) {
%4 = tail call %struct.t_list* @add_front(%struct.t_list* %0, i8* %1, i32 %2)
ret %struct.t_list* %4
}
/* Variables and functions */
int rand();
void populate(int a[], const size_t len) {
  for (size_t i = 0; i < len; i++) {
    a[i] = rand();
  }
}


x86 assembly (clang, -O0):
<populate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    115b <populate+0x4b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <populate+0x18>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<populate>:
push   %r15
push   %r14
push   %rbx
test   %rsi,%rsi
je     1144 <populate+0x34>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <rand@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <populate+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @populate(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
br label %6
6: ; preds = %15, %2
%7 = load i64, i64* %5
%8 = load i64, i64* %4
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = call i32 (...) @rand()
%12 = load i32*, i32** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32 %11, i32* %14
br label %15
15: ; preds = %10
%16 = load i64, i64* %5
%17 = add i64 %16, 1
store i64 %17, i64* %5
br label %6
18: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @populate(i32* nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %9, %5 ], [ 0, %2 ]
%7 = tail call i32 (...) @rand()
%8 = getelementptr inbounds i32, i32* %0, i64 %6
store i32 %7, i32* %8
%9 = add nuw i64 %6, 1
%10 = icmp eq i64 %9, %1
br i1 %10, label %4, label %5
}
/* Type definitions */
typedef int /*<<< orphan*/ rtn;
typedef int int64_t;

/* Variables and functions */
scalar_t__ lgetxattr(char const *, char const *, int *, int);
int fsfr_lgetxattr_int(const char *fpath, const char *name) {
  int64_t rtn = -1;
  if (lgetxattr(fpath, name, &rtn, sizeof(rtn)) > 0)
    return (int)rtn;
  return -1;
}


x86 assembly (clang, -O0):
<fsfr_lgetxattr_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <lgetxattr@plt>
cmp    $0x0,%rax
jle    1152 <fsfr_lgetxattr_int+0x42>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <fsfr_lgetxattr_int+0x49>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsfr_lgetxattr_int>:
push   %rax
movl   $0xffffffff,0x4(%rsp)
ff
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <lgetxattr@plt>
mov    %rax,%rcx
mov    $0xffffffff,%eax
test   %rcx,%rcx
jle    1139 <fsfr_lgetxattr_int+0x29>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fsfr_lgetxattr_int(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 -1, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = call i64 @lgetxattr(i8* %7, i8* %8, i32* %6, i32 4)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = load i32, i32* %6
store i32 %12, i32* %3
br label %14
13: ; preds = %2
store i32 -1, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @fsfr_lgetxattr_int(i8* %0, i8* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call i64 @lgetxattr(i8* %0, i8* %1, i32* %3, i32 4)
%6 = icmp sgt i64 %5, 0
%7 = load i32, i32* %3
%8 = select i1 %6, i32 %7, i32 -1
ret i32 %8
}
const char *str_toWhite(const char *cp) {
  int c;
  while ((c = *cp)) {
    if (c == ' ' || c == '\t' || c == '\n' || c == '\r')
      break;
    ++cp;
  }
  return cp;
}


x86 assembly (clang, -O0):
<str_toWhite>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1159 <str_toWhite+0x59>
cmpl   $0x20,-0xc(%rbp)
je     1143 <str_toWhite+0x43>
cmpl   $0x9,-0xc(%rbp)
je     1143 <str_toWhite+0x43>
cmpl   $0xa,-0xc(%rbp)
je     1143 <str_toWhite+0x43>
cmpl   $0xd,-0xc(%rbp)
jne    1148 <str_toWhite+0x48>
jmp    1159 <str_toWhite+0x59>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <str_toWhite+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_toWhite>:
mov    %rdi,%rax
movabs $0x100002601,%rcx
jmp    1114 <str_toWhite+0x14>
nop
add    $0x1,%rax
movzbl (%rax),%edx
cmp    $0x20,%rdx
ja     1110 <str_toWhite+0x10>
bt     %rdx,%rcx
jae    1110 <str_toWhite+0x10>
ret

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

LLVM IR (-O2):
define i8* @str_toWhite(i8* %0) {
br label %2
2: ; preds = %5, %1
%3 = phi i8* [ %0, %1 ], [ %6, %5 ]
%4 = load i8, i8* %3
switch i8 %4, label %5 [
i8 0, label %7
i8 32, label %7
i8 13, label %7
i8 10, label %7
i8 9, label %7
]
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
7: ; preds = %2, %2, %2, %2, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ vec4f_scalarDiv_new(float *, float const *, float const);
void vec4f_homogenize_new(float dest[4], const float src[4]) {
  vec4f_scalarDiv_new(dest, src, src[3]);
}


x86 assembly (clang, -O0):
<vec4f_homogenize_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
movss  0xc(%rax),%xmm0
call   1030 <vec4f_scalarDiv_new@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec4f_homogenize_new>:
movss  0xc(%rsi),%xmm0
jmp    1030 <vec4f_scalarDiv_new@plt>

LLVM IR (-O0):
define void @vec4f_homogenize_new(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float*, float** %4
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 3
%9 = load float, float* %8
%10 = call i32 @vec4f_scalarDiv_new(float* %5, float* %6, float %9)
ret void
}

LLVM IR (-O2):
define void @vec4f_homogenize_new(float* %0, float* %1) {
%3 = getelementptr inbounds float, float* %1, i64 3
%4 = load float, float* %3
%5 = tail call i32 @vec4f_scalarDiv_new(float* %0, float* %1, float %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("This is the sentence");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"This is the sentence\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"This is the sentence\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void base_real_who_am_i(void) { printf("I'm base!\n"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"I'm base!\0A\00"
define void @base_real_who_am_i() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"I'm base!\00"
define void @base_real_who_am_i() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}
void update_disp_right(int pos) {}


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

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

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

LLVM IR (-O2):
define void @update_disp_right(i32 %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int is_prime(uint64_t p) {
  uint64_t i;
  int retour = 1;
  for (i = 2; i < (p / 2) && retour == 1; i++) {
    if ((p) % i == 0) {
      retour = 0;
    }
  }
  return retour;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xd(%rbp)
jge    113c <is_prime+0x3c>
cmpl   $0x1,-0xc(%rbp)
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114c <is_prime+0x4c>
jmp    1176 <is_prime+0x76>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1163 <is_prime+0x63>
movl   $0x0,-0xc(%rbp)
jmp    1168 <is_prime+0x68>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <is_prime+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%eax
cmp    $0x6,%edi
jl     113b <is_prime+0x3b>
mov    %edi,%r8d
mov    %edi,%ecx
shr    $0x1f,%ecx
add    %edi,%ecx
sar    %ecx
mov    $0x3,%esi
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rsi),%edi
mov    %r8d,%eax
cltd
idiv   %edi
cmp    %ecx,%esi
jge    1134 <is_prime+0x34>
add    $0x1,%esi
test   %edx,%edx
jne    1120 <is_prime+0x20>
xor    %eax,%eax
test   %edx,%edx
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = sdiv i32 %0, 2
%3 = icmp sgt i32 %0, 5
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 2, %1 ]
%6 = srem i32 %0, %5
%7 = icmp ne i32 %6, 0
%8 = add nuw nsw i32 %5, 1
%9 = icmp slt i32 %8, %2
%10 = and i1 %9, %7
br i1 %10, label %4, label %11
11: ; preds = %4
%12 = zext i1 %7 to i32
br label %13
13: ; preds = %11, %1
%14 = phi i32 [ 1, %1 ], [ %12, %11 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ is_uksm_zero_pfn(unsigned long);
int is_zero_pfn(unsigned long pfn) {
  extern unsigned long zero_pfn;
  return (pfn == zero_pfn) || (is_uksm_zero_pfn(pfn));
}


x86 assembly (clang, -O0):
<is_zero_pfn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
mov    $0x1,%al
mov    0x2ebf(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x9(%rbp)
je     1148 <is_zero_pfn+0x38>
mov    -0x8(%rbp),%rdi
call   1030 <is_uksm_zero_pfn@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_zero_pfn>:
push   %rax
mov    0x2ed0(%rip),%rcx
mov    $0x1,%eax
cmp    %rdi,(%rcx)
je     1132 <is_zero_pfn+0x22>
call   1030 <is_uksm_zero_pfn@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@zero_pfn = external global i64
define i32 @is_zero_pfn(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = load i64, i64* @zero_pfn
%5 = icmp eq i64 %3, %4
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i64, i64* %2
%8 = call i64 @is_uksm_zero_pfn(i64 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@zero_pfn = external global i64
define i32 @is_zero_pfn(i64 %0) {
%2 = load i64, i64* @zero_pfn
%3 = icmp eq i64 %2, %0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @is_uksm_zero_pfn(i64 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int mcfioC_SpecificEvent(int, int, int, int, int);
int mcfio_specificevent_(int *stream, int *ievt, int *istore, int *irun,
                         int *itrig) {
  return mcfioC_SpecificEvent(*stream, *ievt, *istore, *irun, *itrig);
}


x86 assembly (clang, -O0):
<mcfio_specificevent_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%r8d
call   1030 <mcfioC_SpecificEvent@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfio_specificevent_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
mov    (%rdx),%edx
mov    (%rcx),%ecx
mov    (%r8),%r8d
jmp    1030 <mcfioC_SpecificEvent@plt>

LLVM IR (-O0):
define i32 @mcfio_specificevent_(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32* %0, i32** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = load i32*, i32** %7
%14 = load i32, i32* %13
%15 = load i32*, i32** %8
%16 = load i32, i32* %15
%17 = load i32*, i32** %9
%18 = load i32, i32* %17
%19 = load i32*, i32** %10
%20 = load i32, i32* %19
%21 = call i32 @mcfioC_SpecificEvent(i32 %12, i32 %14, i32 %16, i32 %18, i32 %20)
ret i32 %21
}

LLVM IR (-O2):
define i32 @mcfio_specificevent_(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = load i32, i32* %0
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = tail call i32 @mcfioC_SpecificEvent(i32 %6, i32 %7, i32 %8, i32 %9, i32 %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printBinary(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int userNum = 0;
  printf("Enter integer: ");
  scanf("%d", &userNum);
  printBinary(userNum);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <printBinary@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <printBinary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"Enter integer: \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @printBinary(i32 %5)
%7 = call i32 @putchar(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ accessLRUArray(int, int, int);
int /*<<< orphan*/ accessTagArray(int, int, int /*<<< orphan*/);
int findLRU(int);
int /*<<< orphan*/ tagBits(unsigned int);
int whichSet(unsigned int);
int updateOnMiss(unsigned int address) {
  int way, set;
  set = whichSet(address);
  way = findLRU(set);
  accessLRUArray(set, way, 1);
  accessTagArray(set, way, tagBits(address));
  return 0;
}


x86 assembly (clang, -O0):
<updateOnMiss>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1070 <whichSet@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1060 <findLRU@plt>
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%edx
call   1030 <accessLRUArray@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <tagBits@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    %eax,%edx
call   1040 <accessTagArray@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<updateOnMiss>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
call   1070 <whichSet@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1060 <findLRU@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <accessLRUArray@plt>
mov    %r14d,%edi
call   1050 <tagBits@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <accessTagArray@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @updateOnMiss(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @whichSet(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = call i32 @findLRU(i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = call i32 @accessLRUArray(i32 %9, i32 %10, i32 1)
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = call i32 @tagBits(i32 %14)
%16 = call i32 @accessTagArray(i32 %12, i32 %13, i32 %15)
ret i32 0
}

LLVM IR (-O2):
define i32 @updateOnMiss(i32 %0) {
%2 = tail call i32 @whichSet(i32 %0)
%3 = tail call i32 @findLRU(i32 %2)
%4 = tail call i32 @accessLRUArray(i32 %2, i32 %3, i32 1)
%5 = tail call i32 @tagBits(i32 %0)
%6 = tail call i32 @accessTagArray(i32 %2, i32 %3, i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *open_file(char *);
int /*<<< orphan*/ read_file(int /*<<< orphan*/ *);
int main(int argc, char const *argv[]) {
  FILE *fd;
  fd = open_file("mod_hello");
  read_file(fd);
  fclose(fd);
  return 0;
}


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    0xeb3(%rip),%rdi
call   1040 <open_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <read_file@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1040 <open_file@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <read_file@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"mod_hello\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @open_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %6
%8 = load i32*, i32** %6
%9 = call i32 @read_file(i32* %8)
%10 = load i32*, i32** %6
%11 = call i32 @fclose(i32* %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"mod_hello\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @open_file(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @read_file(i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i32 0
}
/* Type definitions */
typedef unsigned long volatile uint32_t;

/* Variables and functions */
uint32_t GPIO_getEventDio(uint32_t dioNumber) {
  ;
  return (
      ((*((volatile unsigned long *)(0x40022000 + 0x000000E0))) >> dioNumber) &
      1);
}


x86 assembly (clang, -O0):
<GPIO_getEventDio>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    $0x400220e0,%eax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_getEventDio>:
mov    %rdi,-0x8(%rsp)
mov    0x400220e0,%rax
40
mov    -0x8(%rsp),%rcx
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @GPIO_getEventDio(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073881312 to i64*)
%4 = load volatile i64, i64* %2
%5 = lshr i64 %3, %4
%6 = and i64 %5, 1
ret i64 %6
}

LLVM IR (-O2):
define i64 @GPIO_getEventDio(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* inttoptr (i64 1073881312 to i64*)
%4 = load volatile i64, i64* %2
%5 = lshr i64 %3, %4
%6 = and i64 %5, 1
ret i64 %6
}
int test1(int b) {
  int x = b ? b : 1;
  return x;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     111c <test1+0x1c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <test1+0x29>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <test1+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %edi,%edi
mov    $0x1,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ leftDropAtPos(int /*<<< orphan*/);
int /*<<< orphan*/ writeDebugStreamLine(char *);
void leftOuterCrate1() {
  writeDebugStreamLine("Crate 1");
  leftDropAtPos(0);
}


x86 assembly (clang, -O0):
<leftOuterCrate1>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <writeDebugStreamLine@plt>
xor    %edi,%edi
call   1030 <leftDropAtPos@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<leftOuterCrate1>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <writeDebugStreamLine@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <leftDropAtPos@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"Crate 1\00"
define void @leftOuterCrate1() {
%1 = call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @leftDropAtPos(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"Crate 1\00"
define void @leftOuterCrate1() {
%1 = tail call i32 @writeDebugStreamLine(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @leftDropAtPos(i32 0)
ret void
}
void foo225() {}


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

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

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

LLVM IR (-O2):
define void @foo225() {
ret void
}
/* Variables and functions */
int is_dq_full_impl();
bool is_dq_full() { return is_dq_full_impl(); }


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

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

LLVM IR (-O0):
define i32 @is_dq_full() {
%1 = call i32 (...) @is_dq_full_impl()
ret i32 %1
}

LLVM IR (-O2):
define i32 @is_dq_full() {
%1 = tail call i32 (...) @is_dq_full_impl()
ret i32 %1
}
/* Variables and functions */
int compseq(char *);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
int main() {
  char texto[] = "faculdade de informatica";
  printf("%zu\n", strlen(texto));
  printf("%i\n", compseq(texto));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xeb2(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1050 <compseq@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movups 0xecd(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1050 <compseq@plt>
lea    0xeaa(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.texto = [25 x i8] c"faculdade de informatica\00"
@.str = [5 x i8] c"%zu\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
store i32 0, i32* %1
%3 = bitcast [25 x i8]* %2 to i8*
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%5 = call i32 @strlen(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%8 = call i32 @compseq(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.texto = [25 x i8] c"faculdade de informatica\00"
@.str = [5 x i8] c"%zu\0A\00"
@.str.1 = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @compseq(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
__attribute__((always_)) unsigned char readb(const volatile void *addr) {
  unsigned char ret;
  asm volatile("mov"
               "b"
               " %1,%0"
               : "=q"(ret)
               : "m"(*(volatile unsigned char *)addr)
               : "memory");
  return ret;
}


x86 assembly (clang, -O0):
<readb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readb>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @readb(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8 asm sideeffect "movb $1,$0", "=q,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @readb(i8* %0) {
%2 = tail call i8 asm sideeffect "movb $1,$0", "=q,*m,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("DIFINED_WORDSIZE: %s\n", "not_defined");
  return sizeof(void *);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xef7(%rip),%rsi
call   1030 <printf@plt>
mov    $0x8,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"DIFINED_WORDSIZE: %s\0A\00"
@.str.1 = [12 x i8] c"not_defined\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 8
}

LLVM IR (-O2):
@.str = [22 x i8] c"DIFINED_WORDSIZE: %s\0A\00"
@.str.1 = [12 x i8] c"not_defined\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 8
}
char *type_name(int id) {
  switch (id) {
  case 1:
    return "INPUT  ";
  case 2:
    return "OUTPUT ";
  case 3:
    return "FEATURE";
  default:
    return "UNKNOWN";
  }
}


x86 assembly (clang, -O0):
<type_name>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x1,%eax
je     113d <type_name+0x3d>
jmp    111b <type_name+0x1b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     114d <type_name+0x4d>
jmp    112c <type_name+0x2c>
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
je     115d <type_name+0x5d>
jmp    116d <type_name+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <type_name+0x78>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <type_name+0x78>
lea    0xeac(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1178 <type_name+0x78>
lea    0xea4(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<type_name>:
add    $0xffffffff,%edi
cmp    $0x2,%edi
ja     111a <type_name+0x1a>
movslq %edi,%rax
lea    0xf0e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xef7(%rip),%rax
ret

LLVM IR (-O0):
@.str = [8 x i8] c"INPUT \00"
@.str.1 = [8 x i8] c"OUTPUT \00"
@.str.2 = [8 x i8] c"FEATURE\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
define i8* @type_name(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [8 x i8] c"INPUT \00"
@.str.1 = [8 x i8] c"OUTPUT \00"
@.str.2 = [8 x i8] c"FEATURE\00"
@.str.3 = [8 x i8] c"UNKNOWN\00"
@reltable.type_name = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.type_name to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.type_name to i64)) to i32)]
define i8* @type_name(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.type_name to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void write32(uint32_t val, void *addr) { *(volatile uint32_t *)addr = val; }


x86 assembly (clang, -O0):
<write32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write32>:
mov    %edi,(%rsi)
ret

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

LLVM IR (-O2):
define void @write32(i32 %0, i8* %1) {
%3 = bitcast i8* %1 to i32*
store volatile i32 %0, i32* %3
ret void
}
void s3c_pm_arch_stop_clocks(void) {}


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

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

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

LLVM IR (-O2):
define void @s3c_pm_arch_stop_clocks() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int f2(int a) {
  char str[] = "hello, testsuite";
  puts(str);
  return ++a;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed9(%rip),%al
mov    %al,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
movaps 0xee2(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x10(%rsp)
mov    %rsp,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
mov    %ebx,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.f2.str = [17 x i8] c"hello, testsuite\00"
define i32 @f2(i32 %0) {
%2 = alloca i32
%3 = alloca [17 x i8]
store i32 %0, i32* %2
%4 = bitcast [17 x i8]* %3 to i8*
%5 = getelementptr inbounds [17 x i8], [17 x i8]* %3, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
%7 = load i32, i32* %2
%8 = add nsw i32 %7, 1
store i32 %8, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@__const.f2.str = [17 x i8] c"hello, testsuite\00"
define i32 @f2(i32 %0) {
%2 = alloca [17 x i8]
%3 = getelementptr inbounds [17 x i8], [17 x i8]* %2, i64 0, i64 0
%4 = call i32 @puts(i8* %3)
%5 = add nsw i32 %0, 1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void freeWordArray(char *array[], int arrLen) {
  int ii;
  for (ii = 0; ii < arrLen; ii++) {
    free(array[ii]);
  }
}


x86 assembly (clang, -O0):
<freeWordArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freeWordArray+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freeWordArray+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freeWordArray>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1142 <freeWordArray+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freeWordArray+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @freeWordArray(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 @free(i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}