xunge/DecIR huggingface dataset:
int middle(int a, int b, int c) {
  int t;
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  if (b > c) {
    t = b;
    b = c;
    c = t;
  }
  if (a > b) {
    t = a;
    a = b;
    b = t;
  }
  return b;
}


x86 assembly (clang, -O0):
<middle>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    112b <middle+0x2b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1149 <middle+0x49>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1167 <middle+0x67>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<middle>:
cmp    %esi,%edi
mov    %edi,%eax
cmovg  %esi,%eax
cmovg  %edi,%esi
cmp    %edx,%esi
cmovg  %edx,%esi
cmp    %esi,%eax
cmovle %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @middle(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %4, i32 %0, i32 %1
%7 = icmp sgt i32 %6, %2
%8 = select i1 %7, i32 %2, i32 %6
%9 = icmp sgt i32 %5, %8
%10 = select i1 %9, i32 %5, i32 %8
ret i32 %10
}
int gcd_func(int first, int second) {
  if (0 == first % second) {
    return second;
  } else {
    return gcd_func(second, first % second);
  }
}


x86 assembly (clang, -O0):
<gcd_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    113a <gcd_func+0x2a>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114e <gcd_func+0x3e>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <gcd_func@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd_func>:
mov    %esi,%edx
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <gcd_func+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd_func(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %0, %2 ], [ %5, %3 ]
%5 = phi i32 [ %1, %2 ], [ %6, %3 ]
%6 = srem i32 %4, %5
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %5
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + (tv.tv_usec * 0.000001);
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
/* Variables and functions */
char *if_indextoname(unsigned int, char *);
char *netif_indextoname(unsigned int __ifindex, char *__ifname) {
  return if_indextoname(__ifindex, __ifname);
}


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

x86 assembly (clang, -O2):
<netif_indextoname>:
jmp    1030 <if_indextoname@plt>

LLVM IR (-O0):
define i8* @netif_indextoname(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 = call i8* @if_indextoname(i32 %5, i8* %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @netif_indextoname(i32 %0, i8* %1) {
%3 = tail call i8* @if_indextoname(i32 %0, i8* %1)
ret i8* %3
}
/* Variables and functions */
int flsl(long mask) {
  int bit;
  if (mask == 0)
    return (0);
  for (bit = 1; mask != 1; bit++)
    mask = (unsigned long)mask >> 1;
  return (bit);
}


x86 assembly (clang, -O0):
<flsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <flsl+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1151 <flsl+0x51>
movl   $0x1,-0x14(%rbp)
cmpq   $0x1,-0x10(%rbp)
je     114b <flsl+0x4b>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1126 <flsl+0x26>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flsl>:
test   %rdi,%rdi
je     112d <flsl+0x2d>
mov    $0x1,%eax
cmp    $0x1,%rdi
je     112c <flsl+0x2c>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
shr    %rdi
add    $0x1,%eax
cmp    $0x1,%rdi
jne    1120 <flsl+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @flsl(i64 %0) {
switch i64 %0, label %2 [
i64 0, label %10
i64 1, label %8
]
2: ; preds = %1, %2
%3 = phi i32 [ %6, %2 ], [ 1, %1 ]
%4 = phi i64 [ %5, %2 ], [ %0, %1 ]
%5 = lshr i64 %4, 1
%6 = add nuw nsw i32 %3, 1
%7 = icmp eq i64 %5, 1
br i1 %7, label %8, label %2
8: ; preds = %2, %1
%9 = phi i32 [ 1, %1 ], [ %6, %2 ]
br label %10
10: ; preds = %1, %8
%11 = phi i32 [ 0, %1 ], [ %9, %8 ]
ret i32 %11
}
int test_imm_74int64_lowword_mem(long long *val) {
  return ((*val) & (0x74 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_74int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 116
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ Widget;

/* Variables and functions */
int /*<<< orphan*/ focus_push(int /*<<< orphan*/);
int /*<<< orphan*/ focus_set_cur_widget(int /*<<< orphan*/);
void focus_push_action(Widget prev, Widget w) {
  focus_set_cur_widget(prev);
  focus_push(w);
}


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

x86 assembly (clang, -O2):
<focus_push_action>:
push   %rbx
mov    %esi,%ebx
call   1040 <focus_set_cur_widget@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <focus_push@plt>

LLVM IR (-O0):
define void @focus_push_action(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 = call i32 @focus_set_cur_widget(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @focus_push(i32 %7)
ret void
}

LLVM IR (-O2):
define void @focus_push_action(i32 %0, i32 %1) {
%3 = tail call i32 @focus_set_cur_widget(i32 %0)
%4 = tail call i32 @focus_push(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ debug_print_int(char *, unsigned int);
int /*<<< orphan*/ virtio_panic(char *);
int zipl_magic(unsigned char *ptr) {
  unsigned int *p = (void *)ptr;
  unsigned int *z = (void *)"zIPL";
  if (*p != *z) {
    debug_print_int("invalid magic", *p);
    virtio_panic("invalid magic");
  }
  return 1;
}


x86 assembly (clang, -O0):
<zipl_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xec5(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
cmp    (%rcx),%eax
je     116f <zipl_magic+0x4f>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xea7(%rip),%rdi
call   1040 <debug_print_int@plt>
lea    0xe9b(%rip),%rdi
call   1030 <virtio_panic@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipl_magic>:
push   %rbx
mov    (%rdi),%esi
cmp    $0x4c50497a,%esi
je     1142 <zipl_magic+0x22>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
call   1040 <debug_print_int@plt>
mov    %rbx,%rdi
call   1030 <virtio_panic@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"zIPL\00"
@.str.1 = [14 x i8] c"invalid magic\00"
define i32 @zipl_magic(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = bitcast i8* %5 to i32*
store i32* %6, i32** %3
store i32* bitcast ([5 x i8]* @.str to i32*), i32** %4
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = icmp ne i32 %8, %10
br i1 %11, label %12, label %17
12: ; preds = %1
%13 = load i32*, i32** %3
%14 = load i32, i32* %13
%15 = call i32 @debug_print_int(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = call i32 @virtio_panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %12, %1
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [14 x i8] c"invalid magic\00"
define i32 @zipl_magic(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1280330106
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = tail call i32 @debug_print_int(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%7 = tail call i32 @virtio_panic(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %5, %1
ret i32 1
}
void UYVYToUV422Row_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @UYVYToUV422Row_Any_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ magic(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  printf("Vavedi golemina na kvadrata: \n");
  scanf("%d", &a);
  magic(a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xecb(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <magic@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Vavedi golemina na kvadrata: \0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 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 @magic(i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [30 x i8] c"Vavedi golemina na kvadrata: \00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 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 @magic(i32 %5)
ret i32 0
}
int check_bits(int pos, int tst) { return (pos & tst) == tst; }


x86 assembly (clang, -O0):
<check_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    -0x8(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_bits>:
not    %edi
xor    %eax,%eax
test   %edi,%esi
sete   %al
ret

LLVM IR (-O0):
define i32 @check_bits(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 = and i32 %5, %6
%8 = load i32, i32* %4
%9 = icmp eq i32 %7, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @check_bits(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp eq i32 %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int mem_read32(unsigned char *);
int get_document_quality(unsigned char *signature_header_vals) {
  return mem_read32(signature_header_vals + (3 * 4));
}


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

x86 assembly (clang, -O2):
<get_document_quality>:
add    $0xc,%rdi
jmp    1030 <mem_read32@plt>

LLVM IR (-O0):
define i32 @get_document_quality(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 12
%5 = call i32 @mem_read32(i8* %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_document_quality(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 12
%3 = tail call i32 @mem_read32(i8* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ hint();
main() { hint(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @hint()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @hint()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _delay_us(int);
void lcd_shortDelay() { _delay_us(15); }


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

x86 assembly (clang, -O2):
<lcd_shortDelay>:
mov    $0xf,%edi
jmp    1030 <_delay_us@plt>

LLVM IR (-O0):
define void @lcd_shortDelay() {
%1 = call i32 @_delay_us(i32 15)
ret void
}

LLVM IR (-O2):
define void @lcd_shortDelay() {
%1 = tail call i32 @_delay_us(i32 15)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *program) { printf("USAGE %s [-hamt]\n\n", program); }


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"USAGE %s [-hamt]\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"USAGE %s [-hamt]\0A\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ make_table();
int main(void) {
  make_table();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @make_table()
ret i32 0
}
int xtensa_simm8x256(v)
int v;
{ return (v & 255) == 0 && (v >= -32768 && v <= 32512); }


x86 assembly (clang, -O0):
<xtensa_simm8x256>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jne    1143 <xtensa_simm8x256+0x43>
xor    %eax,%eax
cmpl   $0xffff8000,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     113d <xtensa_simm8x256+0x3d>
cmpl   $0x7f00,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtensa_simm8x256>:
test   %dil,%dil
sete   %al
add    $0x8000,%edi
cmp    $0xff01,%edi
setb   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @xtensa_simm8x256(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %14
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sge i32 %7, -32768
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %2
%11 = icmp sle i32 %10, 32512
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br label %14
14: ; preds = %12, %1
%15 = phi i1 [ false, %1 ], [ %13, %12 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @xtensa_simm8x256(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = add i32 %0, 32768
%5 = icmp ult i32 %4, 65281
%6 = and i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
void avcodec_send_packet() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_send_packet() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned char, unsigned char, unsigned char,
                          unsigned char);
paddr(unsigned char *s) { printf("%d.%d.%d.%d\n", s[0], s[1], s[2], s[3]); }


x86 assembly (clang, -O0):
<paddr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%sil
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%dl
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x10(%rbp),%rax
lea    0xec4(%rip),%rdi
movzbl %sil,%esi
movzbl %dl,%edx
movzbl %cl,%ecx
movzbl 0x3(%rax),%r8d
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paddr>:
movzbl (%rdi),%esi
movzbl 0x1(%rdi),%edx
movzbl 0x2(%rdi),%ecx
movzbl 0x3(%rdi),%r8d
lea    0xed9(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"%d.%d.%d.%d\0A\00"
define i32 @paddr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 zeroext %2, i8 zeroext %4, i8 zeroext %6, i8 zeroext %8)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *const);
void serd_free(void *const ptr) { free(ptr); }


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

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

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

LLVM IR (-O2):
define void @serd_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double sqrt(double);
double euclidian_norm(double x, double y) { return sqrt(x * x + y * y); }


x86 assembly (clang, -O0):
<euclidian_norm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclidian_norm>:
mulsd  %xmm1,%xmm1
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     112b <euclidian_norm+0x1b>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @euclidian_norm(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %3
%7 = load double, double* %4
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @llvm.fmuladd.f64(double %5, double %6, double %9)
%11 = call double @sqrt(double %10)
ret double %11
}

LLVM IR (-O2):
define double @euclidian_norm(double %0, double %1) {
%3 = fmul double %1, %1
%4 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %3)
%5 = tail call double @sqrt(double %4)
ret double %5
}
int getRate(char type) {
  if (type == 'c') {
    return 2;
    ;
  } else if (type == 'b') {
    return 3;
    ;
  } else {
    return 4;
    ;
  }
}


x86 assembly (clang, -O0):
<getRate>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x63,%eax
jne    1123 <getRate+0x23>
movl   $0x2,-0x4(%rbp)
jmp    1143 <getRate+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    113c <getRate+0x3c>
movl   $0x3,-0x4(%rbp)
jmp    1143 <getRate+0x43>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRate>:
xor    %eax,%eax
cmp    $0x62,%dil
sete   %al
mov    $0x4,%ecx
sub    %eax,%ecx
cmp    $0x63,%dil
mov    $0x2,%eax
cmovne %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @getRate(i8 signext %0) {
%2 = icmp eq i8 %0, 98
%3 = select i1 %2, i32 3, i32 4
%4 = icmp eq i8 %0, 99
%5 = select i1 %4, i32 2, i32 %3
ret i32 %5
}
/* Variables and functions */
void Sys_GLimpInit(void) {}


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

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

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

LLVM IR (-O2):
define void @Sys_GLimpInit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isgraph(int);
void t_isgraph_0x39() {
  Assert_real((isgraph(57)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              290, ("isgraph should be 1 for 9"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x39>:
push   %rbp
mov    %rsp,%rbp
mov    $0x39,%edi
call   1040 <isgraph@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x122,%edx
lea    0xf65(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x39>:
push   %rax
mov    $0x39,%edi
call   1040 <isgraph@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x122,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 9\00"
define void @t_isgraph_0x39() {
%1 = call i32 @isgraph(i32 57)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [26 x i8] c"isgraph should be 1 for 9\00"
define void @t_isgraph_0x39() {
%1 = tail call i32 @isgraph(i32 57)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 290, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WARN_ON(char *);
int /*<<< orphan*/ pr_info(char *);
int myinit(void) {
  pr_info("warn_on init\n");
  WARN_ON("warn_on do it");
  pr_info("warn_on after\n");
  return 0;
}


x86 assembly (clang, -O0):
<myinit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <pr_info@plt>
lea    0xed7(%rip),%rdi
call   1040 <WARN_ON@plt>
lea    0xed9(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myinit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <pr_info@plt>
lea    0xeda(%rip),%rdi
call   1040 <WARN_ON@plt>
lea    0xedc(%rip),%rdi
call   1030 <pr_info@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"warn_on init\0A\00"
@.str.1 = [14 x i8] c"warn_on do it\00"
@.str.2 = [15 x i8] c"warn_on after\0A\00"
define i32 @myinit() {
%1 = call i32 @pr_info(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @WARN_ON(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"warn_on init\0A\00"
@.str.1 = [14 x i8] c"warn_on do it\00"
@.str.2 = [15 x i8] c"warn_on after\0A\00"
define i32 @myinit() {
%1 = tail call i32 @pr_info(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WARN_ON(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @pr_info(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *, double const);
int main(void) {
  const double e = 2.71828182845905;
  const char msg[] = "warning: ";
  printf("%s%.15f\n", msg, e);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x1a(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x12(%rbp)
lea    -0x1a(%rbp),%rsi
lea    0xec5(%rip),%rdi
movsd  0xeab(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x3a676e696e726177,%rax
6e 67 3a
mov    %rax,0x8(%rsp)
movw   $0x20,0x10(%rsp)
lea    0xee1(%rip),%rdi
lea    0x8(%rsp),%rsi
movsd  0xec2(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.msg = [10 x i8] c"warning: \00"
@.str = [9 x i8] c"%s%.15f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca [10 x i8]
store i32 0, i32* %1
store double 0x4005BF0A8B145774, double* %2
%4 = bitcast [10 x i8]* %3 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %5, double 0x4005BF0A8B145774)
ret i32 0
}

LLVM IR (-O2):
@__const.main.msg = [10 x i8] c"warning: \00"
@.str = [9 x i8] c"%s%.15f\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %2, double 0x4005BF0A8B145774)
ret i32 0
}
unsigned test2(unsigned x) { return (x >> 8) & 0x00FF00FF; }


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

x86 assembly (clang, -O2):
<test2>:
mov    %edi,%eax
shr    $0x8,%eax
and    $0xff00ff,%eax
ret

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

LLVM IR (-O2):
define i32 @test2(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 16711935
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ MIPS_SET_BIT(int, int);
void xburst_cgm_gate_hdmi() { MIPS_SET_BIT((0xB0000000 + 0x28), 9); }


x86 assembly (clang, -O0):
<xburst_cgm_gate_hdmi>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0000028,%edi
mov    $0x9,%esi
call   1030 <MIPS_SET_BIT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xburst_cgm_gate_hdmi>:
mov    $0xb0000028,%edi
mov    $0x9,%esi
jmp    1030 <MIPS_SET_BIT@plt>

LLVM IR (-O0):
define void @xburst_cgm_gate_hdmi() {
%1 = call i32 @MIPS_SET_BIT(i32 -1342177240, i32 9)
ret void
}

LLVM IR (-O2):
define void @xburst_cgm_gate_hdmi() {
%1 = tail call i32 @MIPS_SET_BIT(i32 -1342177240, i32 9)
ret void
}
void __set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = (1UL << ((nr) % (8 * sizeof(long))));
  unsigned long *p = ((unsigned long *)addr) + ((nr) / (8 * sizeof(long)));
  *p |= mask;
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
mov    $0x1,%eax
shl    %cl,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
movslq %edi,%rcx
mov    $0x1,%eax
shl    %cl,%rax
shr    $0x6,%rcx
or     %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @__set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = urem i64 %8, 64
%10 = shl i64 1, %9
store i64 %10, i64* %5
%11 = load i64*, i64** %4
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = udiv i64 %13, 64
%15 = getelementptr inbounds i64, i64* %11, i64 %14
store i64* %15, i64** %6
%16 = load i64, i64* %5
%17 = load i64*, i64** %6
%18 = load i64, i64* %17
%19 = or i64 %18, %16
store i64 %19, i64* %17
ret void
}

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = and i64 %3, 63
%5 = shl nuw i64 1, %4
%6 = lshr i64 %3, 6
%7 = getelementptr inbounds i64, i64* %1, i64 %6
%8 = load i64, i64* %7
%9 = or i64 %8, %5
store i64 %9, i64* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
void add(unsigned int a, unsigned int b) {
  unsigned int total = 0;
  total = a + b;
  printf("%d + %d = %d\n", a, b, total);
}


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

x86 assembly (clang, -O2):
<add>:
mov    %esi,%edx
mov    %edi,%esi
lea    (%rdx,%rsi,1),%ecx
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @add(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
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = add i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d + %d = %d\0A\00"
define void @add(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
int is_even(int num) {
  int answer;
  if (num % 2 == 0) {
    answer = 1;
  } else {
    answer = 0;
  }
  return answer;
}


x86 assembly (clang, -O0):
<is_even>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <is_even+0x27>
movl   $0x1,-0x8(%rbp)
jmp    112e <is_even+0x2e>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_even>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @is_even(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
void *ALflangerState_New(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<ALflangerState_New>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @ALflangerState_New(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i8* @malloc(i64 %3)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @ALflangerState_New(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
void DotQuote(s) char *s;
{
  c("(.\")");
  place_string(s);
}


x86 assembly (clang, -O0):
<DotQuote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <c@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <place_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DotQuote>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <c@plt>
mov    %rbx,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <place_string@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"(.\22)\00"
define void @DotQuote(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @c to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @place_string to i32 (i8*, ...)*)(i8* %0)
ret void
}
void __main() {}


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

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

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

LLVM IR (-O2):
define void @__main() {
ret void
}
char *GetLastAfterDelimiter(char *String, const char Delimiter) {
  char *Result = String;
  for (char *Scan = String; *Scan; ++Scan) {
    if (*Scan == Delimiter) {
      Result = Scan + 1;
    }
  }
  return Result;
}


x86 assembly (clang, -O0):
<GetLastAfterDelimiter>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1160 <GetLastAfterDelimiter+0x60>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114a <GetLastAfterDelimiter+0x4a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114f <GetLastAfterDelimiter+0x4f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111e <GetLastAfterDelimiter+0x1e>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetLastAfterDelimiter>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     1122 <GetLastAfterDelimiter+0x22>
lea    0x1(%rax),%rdx
nopl   (%rax)
cmp    %sil,%cl
cmove  %rdx,%rax
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <GetLastAfterDelimiter+0x10>
ret

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

LLVM IR (-O2):
define i8* @GetLastAfterDelimiter(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %7, %2
%6 = phi i8* [ %0, %2 ], [ %13, %7 ]
ret i8* %6
7: ; preds = %2, %7
%8 = phi i8 [ %14, %7 ], [ %3, %2 ]
%9 = phi i8* [ %12, %7 ], [ %0, %2 ]
%10 = phi i8* [ %13, %7 ], [ %0, %2 ]
%11 = icmp eq i8 %8, %1
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = select i1 %11, i8* %12, i8* %10
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %5, label %7
}
/* Type definitions */
struct mtf_stream {
  int dummy;
};

/* Variables and functions */
int mtf_stream_copy(struct mtf_stream *, int);
int mtf_stream_next(struct mtf_stream *s) { return mtf_stream_copy(s, -1); }


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

x86 assembly (clang, -O2):
<mtf_stream_next>:
mov    $0xffffffff,%esi
jmp    1030 <mtf_stream_copy@plt>

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

LLVM IR (-O2):
%struct.mtf_stream = type { i32 }
define i32 @mtf_stream_next(%struct.mtf_stream* %0) {
%2 = tail call i32 @mtf_stream_copy(%struct.mtf_stream* %0, i32 -1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ curs_set(int);
int /*<<< orphan*/ echo();
int /*<<< orphan*/ timeout(int);
void f18a_dbgterm(void) {
  curs_set(1);
  timeout(-1);
  echo();
}


x86 assembly (clang, -O0):
<f18a_dbgterm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0xffffffff,%edi
call   1040 <timeout@plt>
mov    $0x0,%al
call   1030 <echo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f18a_dbgterm>:
push   %rax
mov    $0x1,%edi
call   1050 <curs_set@plt>
mov    $0xffffffff,%edi
call   1040 <timeout@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <echo@plt>

LLVM IR (-O0):
define void @f18a_dbgterm() {
%1 = call i32 @curs_set(i32 1)
%2 = call i32 @timeout(i32 -1)
%3 = call i32 (...) @echo()
ret void
}

LLVM IR (-O2):
define void @f18a_dbgterm() {
%1 = tail call i32 @curs_set(i32 1)
%2 = tail call i32 @timeout(i32 -1)
%3 = tail call i32 (...) @echo()
ret void
}
main(argc, argv) int argc;
char *argv[];
{}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int strlen(char *);
void strlen_constant0() {
  if (strlen("123") != 3)
    (void)*(char *)0;
}


x86 assembly (clang, -O0):
<strlen_constant0>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
je     1129 <strlen_constant0+0x19>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strlen_constant0() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i32 %1, 3
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = load i8, i8* null
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strlen_constant0() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cc_common_cmp_str(const void *str1, const void *str2) {
  return strcmp((const char *)str1, (const char *)str2);
}


x86 assembly (clang, -O0):
<cc_common_cmp_str>:
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 <strcmp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cc_common_cmp_str>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @cc_common_cmp_str(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ struct_by_value_17a_x();
int main() {
  struct_by_value_17a_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <struct_by_value_17a_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <struct_by_value_17a_x@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @struct_by_value_17a_x()
%2 = tail call i32 @exit(i32 0)
unreachable
}
unsigned retro_api_version(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @retro_api_version() {
ret i32 1
}

LLVM IR (-O2):
define i32 @retro_api_version() {
ret i32 1
}