xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int g(int a) {
  printf("g 0: a = %d\n", a);
  a = 3;
  printf("g 1: a = %d\n", a);
}


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

x86 assembly (clang, -O2):
<g>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x3,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c"g 0: a = %d\0A\00"
@.str.1 = [13 x i8] c"g 1: a = %d\0A\00"
define i32 @g(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ Car_Set(int);
int /*<<< orphan*/ Car_SetOverload(int /*<<< orphan*/, int);
void Car_SetCarOverload(int carnum, int Overload) {
  Car_SetOverload(Car_Set(carnum), Overload);
}


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

x86 assembly (clang, -O2):
<Car_SetCarOverload>:
push   %rbx
mov    %esi,%ebx
call   1030 <Car_Set@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <Car_SetOverload@plt>

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

LLVM IR (-O2):
define void @Car_SetCarOverload(i32 %0, i32 %1) {
%3 = tail call i32 @Car_Set(i32 %0)
%4 = tail call i32 @Car_SetOverload(i32 %3, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_134() {
  Assert_real((isqrt(134) == 11),
              "/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/stdlib/isqrt.c",
              675, ("Integer square root of 134 should be 11"));
}


x86 assembly (clang, -O0):
<t_sqrt_134>:
push   %rbp
mov    %rsp,%rbp
mov    $0x86,%edi
call   1030 <isqrt@plt>
cmp    $0xb,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xec0(%rip),%rsi
mov    $0x2a3,%edx
lea    0xf56(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_sqrt_134>:
push   %rax
mov    $0x86,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0xb,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x2a3,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 134 should be 11\00"
define void @t_sqrt_134() {
%1 = call i32 @isqrt(i32 134)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [162 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/stdlib/isqrt.c\00"
@.str.1 = [40 x i8] c"Integer square root of 134 should be 11\00"
define void @t_sqrt_134() {
%1 = tail call i32 @isqrt(i32 134)
%2 = icmp eq i32 %1, 11
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([162 x i8], [162 x i8]* @.str, i64 0, i64 0), i32 675, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned short getcNofail(int /*<<< orphan*/ *const);
int pm_readbigshort(FILE *const ifP, short *const sP) {
  unsigned short s;
  s = getcNofail(ifP) << 8;
  s |= getcNofail(ifP) << 0;
  *sP = s;
  return 0;
}


x86 assembly (clang, -O0):
<pm_readbigshort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getcNofail@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %ax,-0x12(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getcNofail@plt>
movzwl %ax,%ecx
shl    $0x0,%ecx
movzwl -0x12(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x12(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_readbigshort>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <getcNofail@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1030 <getcNofail@plt>
or     %ebp,%eax
mov    %ax,(%r14)
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @pm_readbigshort(i32* %0, i16* %1) {
%3 = alloca i32*
%4 = alloca i16*
%5 = alloca i16
store i32* %0, i32** %3
store i16* %1, i16** %4
%6 = load i32*, i32** %3
%7 = call zeroext i16 @getcNofail(i32* %6)
%8 = zext i16 %7 to i32
%9 = shl i32 %8, 8
%10 = trunc i32 %9 to i16
store i16 %10, i16* %5
%11 = load i32*, i32** %3
%12 = call zeroext i16 @getcNofail(i32* %11)
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 0
%15 = load i16, i16* %5
%16 = zext i16 %15 to i32
%17 = or i32 %16, %14
%18 = trunc i32 %17 to i16
store i16 %18, i16* %5
%19 = load i16, i16* %5
%20 = load i16*, i16** %4
store i16 %19, i16* %20
ret i32 0
}

LLVM IR (-O2):
define i32 @pm_readbigshort(i32* %0, i16* nocapture writeonly %1) {
%3 = tail call zeroext i16 @getcNofail(i32* %0)
%4 = shl i16 %3, 8
%5 = tail call zeroext i16 @getcNofail(i32* %0)
%6 = or i16 %4, %5
store i16 %6, i16* %1
ret i32 0
}
long long mini(long long a, long long b) { return (a < b) ? a : b; }


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

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

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

LLVM IR (-O2):
define i64 @mini(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
void bluePixel(unsigned char *frame_buf, unsigned int ip) {
  frame_buf[ip] = 0xff;
  frame_buf[ip + 1] = 0xff;
  frame_buf[ip + 2] = 0x00;
  frame_buf[ip + 3] = 0xff;
}


x86 assembly (clang, -O0):
<bluePixel>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movb   $0xff,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movb   $0xff,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x2,%ecx
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x3,%ecx
mov    %ecx,%ecx
movb   $0xff,(%rax,%rcx,1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bluePixel>:
mov    %esi,%eax
movb   $0xff,(%rdi,%rax,1)
lea    0x1(%rsi),%eax
movb   $0xff,(%rdi,%rax,1)
lea    0x2(%rsi),%eax
movb   $0x0,(%rdi,%rax,1)
add    $0x3,%esi
movb   $0xff,(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @bluePixel(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
store i8 -1, i8* %8
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add i32 %10, 1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 -1, i8* %13
%14 = load i8*, i8** %3
%15 = load i32, i32* %4
%16 = add i32 %15, 2
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = add i32 %20, 3
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %19, i64 %22
store i8 -1, i8* %23
ret void
}

LLVM IR (-O2):
define void @bluePixel(i8* nocapture writeonly %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
store i8 -1, i8* %4
%5 = add i32 %1, 1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 -1, i8* %7
%8 = add i32 %1, 2
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
%11 = add i32 %1, 3
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 -1, i8* %13
ret void
}
/* Variables and functions */
int /*<<< orphan*/ TopDownSplitMerge(unsigned int *, int /*<<< orphan*/, int,
                                     unsigned int *);
void TopDownMergeSort(unsigned int A[], unsigned int B[], int n) {
  TopDownSplitMerge(A, 0, n, B);
}


x86 assembly (clang, -O0):
<TopDownMergeSort>:
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    -0x14(%rbp),%edx
mov    -0x10(%rbp),%rcx
xor    %esi,%esi
call   1030 <TopDownSplitMerge@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TopDownMergeSort>:
mov    %rsi,%rcx
xor    %esi,%esi
jmp    1030 <TopDownSplitMerge@plt>

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

LLVM IR (-O2):
define void @TopDownMergeSort(i32* %0, i32* %1, i32 %2) {
%4 = tail call i32 @TopDownSplitMerge(i32* %0, i32 0, i32 %2, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rm(char *);
int /*<<< orphan*/ sm(char *);
void decnkm(int flag) {
  if (flag)
    sm("?66");
  else
    rm("?66");
}


x86 assembly (clang, -O0):
<decnkm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <decnkm+0x26>
lea    0xec4(%rip),%rdi
call   1040 <sm@plt>
jmp    1152 <decnkm+0x32>
lea    0xeb3(%rip),%rdi
call   1030 <rm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decnkm>:
test   %edi,%edi
je     1130 <decnkm+0x10>
lea    0xed5(%rip),%rdi
jmp    1040 <sm@plt>
lea    0xec9(%rip),%rdi
jmp    1030 <rm@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"?66\00"
define void @decnkm(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %1
%8 = call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"?66\00"
define void @decnkm(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @sm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
5: ; preds = %1
%6 = tail call i32 @rm(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %3
ret void
}
int search_label(char *arr) {
  int i = 0;
  while (arr[i] != '\0') {
    if (arr[i] == ':') {
      arr[i] = '\0';
      return 2;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<search_label>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115f <search_label+0x5f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1151 <search_label+0x51>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
movl   $0x2,-0x4(%rbp)
jmp    1166 <search_label+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <search_label+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_label>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <search_label+0x23>
cmp    $0x3a,%cl
je     1126 <search_label+0x26>
add    $0x1,%rax
jmp    1110 <search_label+0x10>
xor    %eax,%eax
ret
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @search_label(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %10, %9 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %11
i8 58, label %6
]
6: ; preds = %2
%7 = and i64 %3, 4294967295
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %11
9: ; preds = %2
%10 = add nuw i64 %3, 1
br label %2
11: ; preds = %2, %6
%12 = phi i32 [ 2, %6 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ pow(double, double);
unsigned short SYS16_TstBit(unsigned short bit, unsigned short value) {
  return (((value & (unsigned short)(pow(2.0, (double)bit))) >> bit));
}


x86 assembly (clang, -O0):
<SYS16_TstBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xec3(%rip),%xmm0
call   1030 <pow@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%eax
movzwl %cx,%ecx
and    %ecx,%eax
movzwl -0x2(%rbp),%ecx
sar    %cl,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS16_TstBit>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
cvtsi2sd %edi,%xmm1
movsd  0xedd(%rip),%xmm0
call   1030 <pow@plt>
and    %ebx,%eax
mov    %ebp,%ecx
shr    %cl,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @SYS16_TstBit(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = zext i16 %5 to i32
%7 = load i16, i16* %3
%8 = uitofp i16 %7 to double
%9 = call i64 @pow(double 2.000000e+00, double %8)
%10 = trunc i64 %9 to i16
%11 = zext i16 %10 to i32
%12 = and i32 %6, %11
%13 = load i16, i16* %3
%14 = zext i16 %13 to i32
%15 = ashr i32 %12, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @SYS16_TstBit(i16 zeroext %0, i16 zeroext %1) {
%3 = zext i16 %1 to i32
%4 = uitofp i16 %0 to double
%5 = tail call i64 @pow(double 2.000000e+00, double %4)
%6 = trunc i64 %5 to i32
%7 = and i32 %6, %3
%8 = zext i16 %0 to i32
%9 = lshr i32 %7, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}
/* Type definitions */
struct state {
  int dummy;
};

/* Variables and functions */
unsigned int read_number(struct state *, unsigned int);
unsigned read_prefix(struct state *state) {
  unsigned nbits = read_number(state, 2);
  unsigned val = read_number(state, nbits);
  return 128 * ((1 << (nbits + 1)) - 1 - val);
}


x86 assembly (clang, -O0):
<read_prefix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <read_number@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <read_number@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
sub    -0x10(%rbp),%eax
shl    $0x7,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_prefix>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2,%esi
call   1030 <read_number@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <read_number@plt>
add    $0x1,%bpl
mov    $0xffffffff,%edx
mov    %ebp,%ecx
shl    %cl,%edx
not    %edx
sub    %eax,%edx
shl    $0x7,%edx
mov    %edx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.state = type { i32 }
define i32 @read_prefix(%struct.state* %0) {
%2 = alloca %struct.state*
%3 = alloca i32
%4 = alloca i32
store %struct.state* %0, %struct.state** %2
%5 = load %struct.state*, %struct.state** %2
%6 = call i32 @read_number(%struct.state* %5, i32 2)
store i32 %6, i32* %3
%7 = load %struct.state*, %struct.state** %2
%8 = load i32, i32* %3
%9 = call i32 @read_number(%struct.state* %7, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %3
%11 = add i32 %10, 1
%12 = shl i32 1, %11
%13 = sub nsw i32 %12, 1
%14 = load i32, i32* %4
%15 = sub i32 %13, %14
%16 = mul i32 128, %15
ret i32 %16
}

LLVM IR (-O2):
%struct.state = type { i32 }
define i32 @read_prefix(%struct.state* %0) {
%2 = tail call i32 @read_number(%struct.state* %0, i32 2)
%3 = tail call i32 @read_number(%struct.state* %0, i32 %2)
%4 = add i32 %2, 1
%5 = shl nsw i32 -1, %4
%6 = xor i32 %5, -1
%7 = sub i32 %6, %3
%8 = shl i32 %7, 7
ret i32 %8
}
/* Variables and functions */
int smallest_bit(int, int, int);
int test_negative() {
  return -2 == smallest_bit(1, 2, -2) && -2 == smallest_bit(1, -1, -2);
}


x86 assembly (clang, -O0):
<test_negative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffe,%edx
call   1030 <smallest_bit@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0xfffffffe,%ecx
cmp    %edx,%ecx
mov    %al,-0x1(%rbp)
jne    1163 <test_negative+0x53>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xfffffffe,%edx
call   1030 <smallest_bit@plt>
mov    %eax,%ecx
mov    $0xfffffffe,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_negative>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffe,%edx
call   1030 <smallest_bit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xfffffffe,%ecx
jne    114c <test_negative+0x3c>
mov    $0x1,%edi
mov    $0xffffffff,%esi
mov    $0xfffffffe,%edx
call   1030 <smallest_bit@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xfffffffe,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @test_negative() {
%1 = call i32 @smallest_bit(i32 1, i32 2, i32 -2)
%2 = icmp eq i32 -2, %1
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @smallest_bit(i32 1, i32 -1, i32 -2)
%5 = icmp eq i32 -2, %4
br label %6
6: ; preds = %3, %0
%7 = phi i1 [ false, %0 ], [ %5, %3 ]
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_negative() {
%1 = tail call i32 @smallest_bit(i32 1, i32 2, i32 -2)
%2 = icmp eq i32 %1, -2
br i1 %2, label %3, label %7
3: ; preds = %0
%4 = tail call i32 @smallest_bit(i32 1, i32 -1, i32 -2)
%5 = icmp eq i32 %4, -2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %0
%8 = phi i32 [ 0, %0 ], [ %6, %3 ]
ret i32 %8
}
void test14() {
  const char *p = 0;
  for (;;) {
  }
}


x86 assembly (clang, -O0):
<test14>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
jmp    110c <test14+0xc>

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

LLVM IR (-O0):
define void @test14() {
%1 = alloca i8*
store i8* null, i8** %1
br label %2
2: ; preds = %2, %0
br label %2
}

LLVM IR (-O2):
define void @test14() {
br label %1
1: ; preds = %1, %0
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
double get_time(int /*<<< orphan*/);
double get_monotonic_time() { return get_time(CLOCK_MONOTONIC); }


x86 assembly (clang, -O0):
<get_monotonic_time>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <get_time@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_monotonic_time>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <get_time@plt>

LLVM IR (-O0):
@CLOCK_MONOTONIC = global i32 0
define double @get_monotonic_time() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = call double @get_time(i32 %1)
ret double %2
}

LLVM IR (-O2):
@CLOCK_MONOTONIC = global i32 0
define double @get_monotonic_time() {
%1 = load i32, i32* @CLOCK_MONOTONIC
%2 = tail call double @get_time(i32 %1)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ strsep(int /*<<< orphan*/, char *);
void strsep_null_search() { strsep(0, ""); }


x86 assembly (clang, -O0):
<strsep_null_search>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
call   1030 <strsep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsep_null_search>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
jmp    1030 <strsep@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @strsep_null_search() {
%1 = call i32 @strsep(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @strsep_null_search() {
%1 = tail call i32 @strsep(i32 0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(int, int, int, int);
int main(void) {
  printf("%x\n", setbits(0xaa, 4, 3, 0x166));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xaa,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x166,%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xaa,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x166,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @setbits(i32 170, i32 4, i32 3, i32 358)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 170, i32 4, i32 3, i32 358)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_ldr(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_imm5_op(int);
void t16_ldr_imm5() { arm_memio_ldr(t16_memio_imm5_op(4)); }


x86 assembly (clang, -O0):
<t16_ldr_imm5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
call   1040 <t16_memio_imm5_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_ldr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_ldr_imm5>:
push   %rax
mov    $0x4,%edi
call   1040 <t16_memio_imm5_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_ldr@plt>

LLVM IR (-O0):
define void @t16_ldr_imm5() {
%1 = call i32 @t16_memio_imm5_op(i32 4)
%2 = call i32 @arm_memio_ldr(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_ldr_imm5() {
%1 = tail call i32 @t16_memio_imm5_op(i32 4)
%2 = tail call i32 @arm_memio_ldr(i32 %1)
ret void
}
int iscntrl(int c) { return (c >= 0 && c <= 0x1f) || c == 0x7f; }


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x1f,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 31
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_184(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf52_errata_184() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf52_errata_184() {
ret i32 0
}
unsigned xrop3_121_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  unsigned stk4;
  stk4 = D | S;
  stk3 = T & stk4;
  stk2 = S ^ stk3;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_121_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_121_0_0>:
mov    %edi,%eax
shl    $0x8,%eax
lea    (%rdi,%rax,1),%ecx
mov    %esi,%edx
shl    $0x8,%edx
or     %esi,%edx
or     $0xff,%eax
and    %edx,%eax
xor    %ecx,%eax
xor    $0xffffff00,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_121_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = mul nuw nsw i32 %6, 257
%8 = or i32 %4, 255
%9 = and i32 %7, %8
%10 = xor i32 %5, %9
%11 = xor i32 %10, -256
ret i32 %11
}
void rcu_idle_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @rcu_idle_exit() {
ret void
}
void generate_bash_history_with_special_chars() {}


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

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

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

LLVM IR (-O2):
define void @generate_bash_history_with_special_chars() {
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
uint16_t ST7735_SwapColor(uint16_t x) {
  return (x << 11) | (x & 0x07E0) | (x >> 11);
}


x86 assembly (clang, -O0):
<ST7735_SwapColor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xb,%eax
mov    -0x4(%rbp),%ecx
and    $0x7e0,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0xb,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ST7735_SwapColor>:
mov    %edi,%ecx
shl    $0xb,%ecx
mov    %edi,%eax
and    $0x7e0,%eax
or     %ecx,%eax
sar    $0xb,%edi
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ST7735_SwapColor(i32 %0) {
%2 = shl i32 %0, 11
%3 = and i32 %0, 2016
%4 = or i32 %2, %3
%5 = ashr i32 %0, 11
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 5;
  int y = x + 1;
  printf("%i\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xece(%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
mov    $0x6,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 6)
ret i32 0
}
long f2(long a) { return a == 511; }


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x1ff,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
xor    %eax,%eax
cmp    $0x1ff,%rdi
sete   %al
ret

LLVM IR (-O0):
define i64 @f2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 511
%5 = zext i1 %4 to i32
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @f2(i64 %0) {
%2 = icmp eq i64 %0, 511
%3 = zext i1 %2 to i64
ret i64 %3
}
unsigned int clz(unsigned int x) {
  if (x != 0)
    return __builtin_clz(x);
  return sizeof(unsigned int) * 8;
}


x86 assembly (clang, -O0):
<clz>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1122 <clz+0x22>
mov    -0x8(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
mov    %eax,-0x4(%rbp)
jmp    1129 <clz+0x29>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<clz>:
test   %edi,%edi
je     110b <clz+0xb>
bsr    %edi,%eax
xor    $0x1f,%eax
ret
mov    $0x20,%eax
ret

LLVM IR (-O0):
define i32 @clz(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @llvm.ctlz.i32(i32 %7, i1 true)
store i32 %8, i32* %2
br label %10
9: ; preds = %1
store i32 32, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @clz(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 false)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ debugPrintStr(char *, char *);
void contactOfflineRecvd(char *line) {
  debugPrintStr("command parser: contactOfflineRecvd: ", line);
}


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

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

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

LLVM IR (-O2):
@.str = [38 x i8] c"command parser: contactOfflineRecvd: \00"
define void @contactOfflineRecvd(i8* %0) {
%2 = tail call i32 @debugPrintStr(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
long max_l(long x, long y) { return x > y ? x : y; }


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

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

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

LLVM IR (-O2):
define i64 @max_l(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
unsigned int ar_mslot_status_get(int my_cid) {}


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

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

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

LLVM IR (-O2):
define i32 @ar_mslot_status_get(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int backtrace(void **, int);
int /*<<< orphan*/ backtrace_symbols(void **, int);
int main() {
  void *array[20];
  int backtrace_size = backtrace(array, 20);
  backtrace_symbols(array, backtrace_size);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xb0(%rbp),%rdi
mov    $0x14,%esi
call   1040 <backtrace@plt>
mov    %eax,-0xb4(%rbp)
lea    -0xb0(%rbp),%rdi
mov    -0xb4(%rbp),%esi
call   1030 <backtrace_symbols@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <backtrace@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <backtrace_symbols@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [20 x i8*], [20 x i8*]* %2, i64 0, i64 0
%5 = call i32 @backtrace(i8** %4, i32 20)
store i32 %5, i32* %3
%6 = getelementptr inbounds [20 x i8*], [20 x i8*]* %2, i64 0, i64 0
%7 = load i32, i32* %3
%8 = call i32 @backtrace_symbols(i8** %6, i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [20 x i8*]
%2 = bitcast [20 x i8*]* %1 to i8*
%3 = getelementptr inbounds [20 x i8*], [20 x i8*]* %1, i64 0, i64 0
%4 = call i32 @backtrace(i8** %3, i32 20)
%5 = call i32 @backtrace_symbols(i8** %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __console_tx_char(int, unsigned char);
void print_spew_char(unsigned char byte) { __console_tx_char(8, byte); }


x86 assembly (clang, -O0):
<print_spew_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x8,%edi
movzbl -0x1(%rbp),%esi
call   1030 <__console_tx_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_spew_char>:
mov    %edi,%esi
mov    $0x8,%edi
jmp    1030 <__console_tx_char@plt>

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

LLVM IR (-O2):
define void @print_spew_char(i8 zeroext %0) {
%2 = tail call i32 @__console_tx_char(i32 8, i8 zeroext %0)
ret void
}
int storageCapacity(const int patternSize) { return 0.14 * patternSize; }


x86 assembly (clang, -O0):
<storageCapacity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xeec(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<storageCapacity>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @storageCapacity(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double 1.400000e-01, %4
%6 = fptosi double %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @storageCapacity(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 1.400000e-01
%4 = fptosi double %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xd4() {
  Assert_real((iscntrl(212) == 0),
              "/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_iscntrl.c",
              1065, ("iscntrl should be 0 for 0xd4"));
}


x86 assembly (clang, -O0):
<t_iscntrl_0xd4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd4,%edi
call   1030 <iscntrl@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x429,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_iscntrl_0xd4>:
push   %rax
mov    $0xd4,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x429,%edx
pop    %rax
jmp    1040 <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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd4\00"
define void @t_iscntrl_0xd4() {
%1 = call i64 @iscntrl(i32 212)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1065, i8* getelementptr inbounds ([29 x i8], [29 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd4\00"
define void @t_iscntrl_0xd4() {
%1 = tail call i64 @iscntrl(i32 212)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1065, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ switch_on_bits(unsigned char *, int);
void CTRL_REGSB_BITSET_mwup_enb(unsigned char *data) {
  switch_on_bits(data, (0x04));
}


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

x86 assembly (clang, -O2):
<CTRL_REGSB_BITSET_mwup_enb>:
mov    $0x4,%esi
jmp    1030 <switch_on_bits@plt>

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

LLVM IR (-O2):
define void @CTRL_REGSB_BITSET_mwup_enb(i8* %0) {
%2 = tail call i32 @switch_on_bits(i8* %0, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int write(int, void *, int);
int util_write(int fd, void *p, int max) {
  int n;
  do {
    n = write(fd, p, max);
  } while (n < 0 && errno == EINTR);
  return n;
}


x86 assembly (clang, -O0):
<util_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <write@plt>
mov    %eax,-0x18(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
jge    115d <util_write+0x4d>
mov    0x2e96(%rip),%rax
mov    (%rax),%rax
mov    0x2e84(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1122 <util_write+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_write>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <write@plt>
test   %eax,%eax
jns    114a <util_write+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <util_write+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @util_write(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @write(i32 %9, i8* %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @util_write(i32 %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
int hoge(int foo, int puyo) { return foo + puyo; }


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

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

LLVM IR (-O0):
define i32 @hoge(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @hoge(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void hanoi(int n, int a, int b, int c) {
  int i, tmp;
  int start, focus, temp;
  for (i = n; i > 0; i--) {
    printf("%d->%d\n", start, focus);
    tmp = start;
    start = temp;
    temp = tmp;
  }
}


x86 assembly (clang, -O0):
<hanoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1166 <hanoi+0x56>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    112a <hanoi+0x1a>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hanoi>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    1140 <hanoi+0x30>
mov    %edi,%ebx
add    $0x1,%ebx
lea    0xedc(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <hanoi+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d->%d\0A\00"
define void @hanoi(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %11
6: ; preds = %4, %6
%7 = phi i32 [ %9, %6 ], [ %0, %4 ]
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
%9 = add nsw i32 %7, -1
%10 = icmp ugt i32 %7, 1
br i1 %10, label %6, label %11
11: ; preds = %6, %4
ret void
}