xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef int int32_t;

/* Variables and functions */
__attribute__((always_)) uint32_t __SHASX(uint32_t x, uint32_t y) {
  int32_t r, s;
  r = (((((int32_t)x << 16) >> 16) - (((int32_t)y) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  s = (((((int32_t)x) >> 16) + (((int32_t)y << 16) >> 16)) >> 1) &
      (int32_t)0x0000FFFF;
  return ((uint32_t)((s << 16) | (r)));
}


x86 assembly (clang, -O0):
<__SHASX>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x10,%eax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
sar    $0x10,%ecx
sub    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
sar    $0x10,%eax
mov    -0x10(%rbp),%rcx
shl    $0x10,%ecx
sar    $0x10,%ecx
add    %ecx,%eax
sar    $0x1,%eax
and    $0xffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x10,%eax
or     -0x14(%rbp),%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<__SHASX>:
movswl %di,%eax
movswl %si,%ecx
mov    %esi,%edx
sar    $0x10,%edx
sub    %edx,%eax
shr    %eax
movzwl %ax,%eax
sar    $0x10,%edi
add    %edi,%ecx
and    $0xfffffffe,%ecx
shl    $0xf,%ecx
or     %eax,%ecx
movslq %ecx,%rax
ret

LLVM IR (-O0):
define i64 @__SHASX(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = trunc i64 %7 to i32
%9 = shl i32 %8, 16
%10 = ashr i32 %9, 16
%11 = load i64, i64* %4
%12 = trunc i64 %11 to i32
%13 = ashr i32 %12, 16
%14 = sub nsw i32 %10, %13
%15 = ashr i32 %14, 1
%16 = and i32 %15, 65535
store i32 %16, i32* %5
%17 = load i64, i64* %3
%18 = trunc i64 %17 to i32
%19 = ashr i32 %18, 16
%20 = load i64, i64* %4
%21 = trunc i64 %20 to i32
%22 = shl i32 %21, 16
%23 = ashr i32 %22, 16
%24 = add nsw i32 %19, %23
%25 = ashr i32 %24, 1
%26 = and i32 %25, 65535
store i32 %26, i32* %6
%27 = load i32, i32* %6
%28 = shl i32 %27, 16
%29 = load i32, i32* %5
%30 = or i32 %28, %29
%31 = sext i32 %30 to i64
ret i64 %31
}

LLVM IR (-O2):
define i64 @__SHASX(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i32
%4 = shl i32 %3, 16
%5 = ashr exact i32 %4, 16
%6 = trunc i64 %1 to i32
%7 = ashr i32 %6, 16
%8 = sub nsw i32 %5, %7
%9 = lshr i32 %8, 1
%10 = and i32 %9, 65535
%11 = ashr i32 %3, 16
%12 = shl i32 %6, 16
%13 = ashr exact i32 %12, 16
%14 = add nsw i32 %13, %11
%15 = shl nsw i32 %14, 15
%16 = and i32 %15, -65536
%17 = or i32 %16, %10
%18 = sext i32 %17 to i64
ret i64 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void swap_byte(uint8_t *a, uint8_t *b) {
  uint8_t t = *a;
  *a = *b;
  *b = t;
}


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

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

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

LLVM IR (-O2):
define void @swap_byte(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  int t;
  printf("Filip Piorski\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [14 x i8] c"Filip Piorski\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *nvram_get(char *);
int /*<<< orphan*/ strcmp(char const *, char *);
int nvram_match(char *name, char *match) {
  const char *value = nvram_get(name);
  return value && !strcmp(value, match);
}


x86 assembly (clang, -O0):
<nvram_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <nvram_get@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     1165 <nvram_match+0x45>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nvram_match>:
push   %rbx
mov    %rsi,%rbx
call   1040 <nvram_get@plt>
test   %rax,%rax
je     1144 <nvram_match+0x24>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @nvram_match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i8* @nvram_get(i8* %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i32 @strcmp(i8* %11, i8* %12)
%14 = icmp ne i32 %13, 0
%15 = xor i1 %14, true
br label %16
16: ; preds = %10, %2
%17 = phi i1 [ false, %2 ], [ %15, %10 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @nvram_match(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @nvram_get(i8* %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @strcmp(i8* %3, i8* dereferenceable(1) %1)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void create_files_cleanup(char *path) { unlink(path); }


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

x86 assembly (clang, -O2):
<create_files_cleanup>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @create_files_cleanup(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
int ADC_done(int adc) {
  if (adc <= (1 << 7)) {
    return ((*((volatile unsigned long *)0xE0034004)) & (1 << 31));
  } else {
    return ((*((volatile unsigned long *)0xE0060004)) & (1 << 31));
  }
}


x86 assembly (clang, -O0):
<ADC_done>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x80,-0x8(%rbp)
jg     112a <ADC_done+0x2a>
mov    $0xe0034004,%eax
mov    (%rax),%rax
and    $0xffffffff80000000,%rax
mov    %eax,-0x4(%rbp)
jmp    113b <ADC_done+0x3b>
mov    $0xe0060004,%eax
mov    (%rax),%rax
and    $0xffffffff80000000,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_done>:
mov    $0xe0034004,%eax
lea    0x2c000(%rax),%rcx
cmp    $0x81,%edi
cmovl  %rax,%rcx
mov    (%rcx),%rax
and    $0x80000000,%eax
ret

LLVM IR (-O0):
define i32 @ADC_done(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 128
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load volatile i64, i64* inttoptr (i64 3758309380 to i64*)
%8 = and i64 %7, -2147483648
%9 = trunc i64 %8 to i32
store i32 %9, i32* %2
br label %14
10: ; preds = %1
%11 = load volatile i64, i64* inttoptr (i64 3758489604 to i64*)
%12 = and i64 %11, -2147483648
%13 = trunc i64 %12 to i32
store i32 %13, i32* %2
br label %14
14: ; preds = %10, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ADC_done(i32 %0) {
%2 = icmp slt i32 %0, 129
%3 = select i1 %2, i64* inttoptr (i64 3758309380 to i64*), i64* inttoptr (i64 3758489604 to i64*)
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = and i32 %5, -2147483648
ret i32 %6
}
/* Variables and functions */
unsigned char *poly1305_auth(unsigned char *, unsigned char const *,
                             unsigned char const *, size_t);
unsigned char *mac_poly1305_hash(unsigned char *out, const unsigned char *key,
                                 const unsigned char *msg, size_t msg_len) {
  return poly1305_auth(out, key, msg, msg_len);
}


x86 assembly (clang, -O0):
<mac_poly1305_hash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <poly1305_auth@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mac_poly1305_hash>:
jmp    1030 <poly1305_auth@plt>

LLVM IR (-O0):
define i8* @mac_poly1305_hash(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i8*, i8** %7
%12 = load i64, i64* %8
%13 = call i8* @poly1305_auth(i8* %9, i8* %10, i8* %11, i64 %12)
ret i8* %13
}

LLVM IR (-O2):
define i8* @mac_poly1305_hash(i8* %0, i8* %1, i8* %2, i64 %3) {
%5 = tail call i8* @poly1305_auth(i8* %0, i8* %1, i8* %2, i64 %3)
ret i8* %5
}
const char *type2str(int type) {
  if (type == 1)
    return "I";
  if (type == 2)
    return "P";
  if (type == 3)
    return "B";
  return "S";
}


x86 assembly (clang, -O0):
<type2str>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1121 <type2str+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <type2str+0x60>
cmpl   $0x2,-0xc(%rbp)
jne    113b <type2str+0x3b>
lea    0xed0(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <type2str+0x60>
cmpl   $0x3,-0xc(%rbp)
jne    1155 <type2str+0x55>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1160 <type2str+0x60>
lea    0xeaa(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [2 x i8] c"I\00"
@.str.1 = [2 x i8] c"P\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [2 x i8] c"S\00"
define i8* @type2str(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
br label %16
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %11
10: ; preds = %7
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %16
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 3
br i1 %13, label %14, label %15
14: ; preds = %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %16
15: ; preds = %11
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %16
16: ; preds = %15, %14, %10, %6
%17 = load i8*, i8** %2
ret i8* %17
}

LLVM IR (-O2):
@.str = [2 x i8] c"I\00"
@.str.1 = [2 x i8] c"P\00"
@.str.2 = [2 x i8] c"B\00"
@.str.3 = [2 x i8] c"S\00"
@reltable.type2str = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.type2str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.type2str to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([2 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.type2str to i64)) to i32)]
define i8* @type2str(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.type2str to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long led_mask;
};
typedef TYPE_1__ XKeyboardState;

/* Variables and functions */
void set_XKeyboardState_led_mask(void *_p, unsigned long _v) {
  ((XKeyboardState *)_p)->led_mask = (unsigned long)_v;
}


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

x86 assembly (clang, -O2):
<set_XKeyboardState_led_mask>:
mov    %rsi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XKeyboardState_led_mask(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
void INT_Excep_TPU9_TGI9D(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_TPU9_TGI9D() {
ret void
}
unsigned xrop3_195_0_0(unsigned char s, unsigned char t) {
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T ^ S;
  stk1 = ~stk1;
  return stk1;
}


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

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

LLVM IR (-O0):
define i32 @xrop3_195_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = shl i32 %9, 8
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
store i32 %13, i32* %5
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 8
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = xor i32 %20, %21
store i32 %22, i32* %7
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %7
%25 = load i32, i32* %7
ret i32 %25
}

LLVM IR (-O2):
define i32 @xrop3_195_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, -1
ret i32 %8
}
int calc_gcd(unsigned long a, unsigned long b) {
  unsigned long r = a % b;
  if (r == 0)
    return b;
  return calc_gcd(b, r);
}


x86 assembly (clang, -O0):
<calc_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1147 <calc_gcd+0x37>
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1157 <calc_gcd+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <calc_gcd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_gcd>:
mov    %rsi,%rdx
mov    %rdi,%rax
jmp    111d <calc_gcd+0x1d>
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <calc_gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <calc_gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <calc_gcd+0x15>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @calc_gcd(i64 %0, i64 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ %0, %2 ], [ %5, %3 ]
%5 = phi i64 [ %1, %2 ], [ %6, %3 ]
%6 = urem i64 %4, %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
%9 = trunc i64 %5 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_array(int *arr, int size) {
  int i = 0;
  for (; i < size; i++) {
    printf("%d | ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_array+0x16>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d | \00"
define void @print_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
int /*<<< orphan*/ ft_putnbr(int);
void ft_putint(int *table, int len) {
  int i;
  i = 0;
  while (i < len) {
    ft_putnbr(table[i]);
    i++;
  }
  ft_putchar('\n');
}


x86 assembly (clang, -O0):
<ft_putint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1160 <ft_putint+0x40>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1040 <ft_putnbr@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <ft_putint+0x16>
mov    $0xa,%edi
call   1030 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putint>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1152 <ft_putint+0x32>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
call   1040 <ft_putnbr@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1140 <ft_putint+0x20>
mov    $0xa,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <ft_putchar@plt>

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

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


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

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

LLVM IR (-O0):
%struct.snd_soc_platform = type opaque
define void @msm_routing_ahc_add_controls(%struct.snd_soc_platform* %0) {
%2 = alloca %struct.snd_soc_platform*
store %struct.snd_soc_platform* %0, %struct.snd_soc_platform** %2
ret void
}

LLVM IR (-O2):
%struct.snd_soc_platform = type opaque
define void @msm_routing_ahc_add_controls(%struct.snd_soc_platform* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ otest(int);
int /*<<< orphan*/ testit(int);
int main(int argc, char **argv) {
  testit(0);
  otest(2);
  testit(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1040 <testit@plt>
mov    $0x2,%edi
call   1030 <otest@plt>
mov    $0x1,%edi
call   1040 <testit@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <testit@plt>
mov    $0x2,%edi
call   1030 <otest@plt>
mov    $0x1,%edi
call   1040 <testit@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @testit(i32 0)
%4 = tail call i32 @otest(i32 2)
%5 = tail call i32 @testit(i32 1)
ret i32 0
}
int test_imm_0Fint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x0F << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_0Fint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 64424509440
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ktsan_percpu_acquire(void *addr) {}


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

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

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

LLVM IR (-O2):
define void @ktsan_percpu_acquire(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    if (len > 0)
      printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x0,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    116c <main+0x4c>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jg     1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %0, %5
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%7 = call i32 @getline(i8* %2, i32 1000)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %5, label %9
9: ; preds = %5, %0
ret i32 0
}
/* Type definitions */
typedef int uint;

/* Variables and functions */
unsigned GetFieldW16(uint *A, register uint index) {
  register uint i = index / 2, j = (index & 1) << 4, result;
  result = (A[i] << (16 - j)) >> (16);
  return result;
}


x86 assembly (clang, -O0):
<GetFieldW16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
shl    $0x4,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    $0x10,%ecx
sub    -0x14(%rbp),%ecx
shl    %cl,%eax
sar    $0x10,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFieldW16>:
mov    %esi,%ecx
mov    %esi,%eax
shr    $0x1f,%eax
add    %esi,%eax
sar    %eax
shl    $0x4,%ecx
cltq
mov    (%rdi,%rax,4),%eax
not    %cl
and    $0x10,%cl
shl    %cl,%eax
sar    $0x10,%eax
ret

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

LLVM IR (-O2):
define i32 @GetFieldW16(i32* nocapture %0, i32 %1) {
%3 = sdiv i32 %1, 2
%4 = shl i32 %1, 4
%5 = sext i32 %3 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = load i32, i32* %6
%8 = and i32 %4, 16
%9 = xor i32 %8, 16
%10 = shl i32 %7, %9
%11 = ashr i32 %10, 16
ret i32 %11
}
struct workqueue_struct *__create_workqueue(char *name, int singlethread) {
  struct workqueue_struct *a;
  return a;
}


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

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

LLVM IR (-O0):
%struct.workqueue_struct = type opaque
define %struct.workqueue_struct* @__create_workqueue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.workqueue_struct*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load %struct.workqueue_struct*, %struct.workqueue_struct** %5
ret %struct.workqueue_struct* %6
}

LLVM IR (-O2):
%struct.workqueue_struct = type opaque
define noalias %struct.workqueue_struct* @__create_workqueue(i8* nocapture readnone %0, i32 %1) {
ret %struct.workqueue_struct* undef
}
/* Type definitions */
struct genlist_link {
  int dummy;
};
struct genlist {
  int dummy;
};
struct clause_list_link {
  int dummy;
};
struct clause_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_erase(struct genlist *, struct genlist_link *);
void clause_list_erase(struct clause_list *tthis,
                       struct clause_list_link *plink) {
  genlist_erase((struct genlist *)tthis, (struct genlist_link *)plink);
}


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

x86 assembly (clang, -O2):
<clause_list_erase>:
jmp    1030 <genlist_erase@plt>

LLVM IR (-O0):
%struct.clause_list = type { i32 }
%struct.clause_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @clause_list_erase(%struct.clause_list* %0, %struct.clause_list_link* %1) {
%3 = alloca %struct.clause_list*
%4 = alloca %struct.clause_list_link*
store %struct.clause_list* %0, %struct.clause_list** %3
store %struct.clause_list_link* %1, %struct.clause_list_link** %4
%5 = load %struct.clause_list*, %struct.clause_list** %3
%6 = bitcast %struct.clause_list* %5 to %struct.genlist*
%7 = load %struct.clause_list_link*, %struct.clause_list_link** %4
%8 = bitcast %struct.clause_list_link* %7 to %struct.genlist_link*
%9 = call i32 @genlist_erase(%struct.genlist* %6, %struct.genlist_link* %8)
ret void
}

LLVM IR (-O2):
%struct.clause_list = type { i32 }
%struct.clause_list_link = type { i32 }
%struct.genlist = type { i32 }
%struct.genlist_link = type { i32 }
define void @clause_list_erase(%struct.clause_list* %0, %struct.clause_list_link* %1) {
%3 = bitcast %struct.clause_list* %0 to %struct.genlist*
%4 = bitcast %struct.clause_list_link* %1 to %struct.genlist_link*
%5 = tail call i32 @genlist_erase(%struct.genlist* %3, %struct.genlist_link* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
int isqrt(int);
void t_sqrt_4() {
  Assert_real((isqrt(4) == 2),
              "/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",
              25, ("Integer square root of 4 should be 2"));
}


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

x86 assembly (clang, -O2):
<t_sqrt_4>:
push   %rax
mov    $0x4,%edi
call   1030 <isqrt@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf60(%rip),%rcx
mov    $0x19,%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 = [37 x i8] c"Integer square root of 4 should be 2\00"
define void @t_sqrt_4() {
%1 = call i32 @isqrt(i32 4)
%2 = icmp eq i32 %1, 2
%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 25, i8* getelementptr inbounds ([37 x i8], [37 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 = [37 x i8] c"Integer square root of 4 should be 2\00"
define void @t_sqrt_4() {
%1 = tail call i32 @isqrt(i32 4)
%2 = icmp eq i32 %1, 2
%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 25, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int c087(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @c087() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ mtx_t;

/* Variables and functions */
void mtx_destroy(mtx_t *mtx) {}


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

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

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

LLVM IR (-O2):
define void @mtx_destroy(i32* nocapture %0) {
ret void
}
void UARTDisableSIR(unsigned long ulBase) {
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000030))) &=
      ~(0x00000002 | 0x00000004);
}


x86 assembly (clang, -O0):
<UARTDisableSIR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x30(%rax),%rcx
and    $0xfffffffffffffff9,%rcx
mov    %rcx,0x30(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTDisableSIR>:
andq   $0xfffffffffffffff9,0x30(%rdi)
ret

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

LLVM IR (-O2):
define void @UARTDisableSIR(i64 %0) {
%2 = add i64 %0, 48
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = and i64 %4, -7
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
int /*<<< orphan*/ test_env();
int /*<<< orphan*/ test_setunset();
int /*<<< orphan*/ test_zero();
int main(void) {
  test_zero();
  test_setunset();
  test_env();
  _exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <test_zero@plt>
xor    %eax,%eax
call   1040 <test_setunset@plt>
xor    %eax,%eax
call   1050 <test_env@plt>
xor    %edi,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_zero()
%3 = call i32 (...) @test_setunset()
%4 = call i32 (...) @test_env()
%5 = call i32 @_exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_zero()
%2 = tail call i32 (...) @test_setunset()
%3 = tail call i32 (...) @test_env()
%4 = tail call i32 @_exit(i32 0)
unreachable
}
/* Variables and functions */
scalar_t__ CallBack1(int, void *);
int /*<<< orphan*/ CheckRunningInMainThread(char *);
int ResourceToActualMenuID(int resourceMenuID) {
  if (!CheckRunningInMainThread("ResourceToActualMenuID"))
    return 0;
  return (int)CallBack1(61, (void *)resourceMenuID);
}


x86 assembly (clang, -O0):
<ResourceToActualMenuID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xece(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
cmp    $0x0,%eax
jne    114c <ResourceToActualMenuID+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    115d <ResourceToActualMenuID+0x3d>
movslq -0x8(%rbp),%rsi
mov    $0x3d,%edi
call   1030 <CallBack1@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ResourceToActualMenuID>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <CheckRunningInMainThread@plt>
test   %eax,%eax
je     1142 <ResourceToActualMenuID+0x22>
movslq %ebx,%rsi
mov    $0x3d,%edi
call   1030 <CallBack1@plt>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"ResourceToActualMenuID\00"
define i32 @ResourceToActualMenuID(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i32 %4, 0
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = call i64 @CallBack1(i32 61, i8* %10)
%12 = trunc i64 %11 to i32
store i32 %12, i32* %2
br label %13
13: ; preds = %7, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [23 x i8] c"ResourceToActualMenuID\00"
define i32 @ResourceToActualMenuID(i32 %0) {
%2 = tail call i32 @CheckRunningInMainThread(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = sext i32 %0 to i64
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @CallBack1(i32 61, i8* %6)
%8 = trunc i64 %7 to i32
br label %9
9: ; preds = %1, %4
%10 = phi i32 [ %8, %4 ], [ 0, %1 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void nasm_free(void *q) {
  if (q)
    free(q);
}


x86 assembly (clang, -O0):
<nasm_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <nasm_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nasm_free>:
test   %rdi,%rdi
je     111a <nasm_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @nasm_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @nasm_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void bacct_add_tsk(struct taskstats_v4 *stats, struct task_struct *tsk) {}


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

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

LLVM IR (-O0):
%struct.taskstats_v4 = type opaque
%struct.task_struct = type opaque
define void @bacct_add_tsk(%struct.taskstats_v4* %0, %struct.task_struct* %1) {
%3 = alloca %struct.taskstats_v4*
%4 = alloca %struct.task_struct*
store %struct.taskstats_v4* %0, %struct.taskstats_v4** %3
store %struct.task_struct* %1, %struct.task_struct** %4
ret void
}

LLVM IR (-O2):
%struct.taskstats_v4 = type opaque
%struct.task_struct = type opaque
define void @bacct_add_tsk(%struct.taskstats_v4* nocapture %0, %struct.task_struct* nocapture %1) {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void USBEndpointDMAEnable(uint32_t ui32Base, uint32_t ui32Endpoint,
                          uint32_t ui32Flags) {
  if (ui32Flags & 0x00002000) {
    (*((volatile unsigned char *)(ui32Base + (ui32Endpoint - 0x10) +
                                  0x00000113))) |= 0x00000010;
  } else {
    (*((volatile unsigned char *)(ui32Base + (ui32Endpoint - 0x10) +
                                  0x00000117))) |= 0x00000020;
  }
}


x86 assembly (clang, -O0):
<USBEndpointDMAEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2000,%eax
cmp    $0x0,%eax
je     113f <USBEndpointDMAEnable+0x3f>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
add    $0x113,%eax
cltq
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x10,%ecx
mov    %cl,(%rax)
jmp    115b <USBEndpointDMAEnable+0x5b>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x10,%ecx
add    %ecx,%eax
add    $0x117,%eax
cltq
mov    (%rax),%cl
movzbl %cl,%ecx
or     $0x20,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<USBEndpointDMAEnable>:
xor    %eax,%eax
test   $0x2000,%edx
sete   %al
add    %esi,%edi
lea    (%rdi,%rax,4),%ecx
add    $0x103,%ecx
shl    $0x4,%al
add    $0x10,%al
movslq %ecx,%rcx
or     %al,(%rcx)
ret

LLVM IR (-O0):
define void @USBEndpointDMAEnable(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* %6
%8 = and i32 %7, 8192
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 16
%14 = add nsw i32 %11, %13
%15 = add nsw i32 %14, 275
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = load volatile i8, i8* %17
%19 = zext i8 %18 to i32
%20 = or i32 %19, 16
%21 = trunc i32 %20 to i8
store volatile i8 %21, i8* %17
br label %34
22: ; preds = %3
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = sub nsw i32 %24, 16
%26 = add nsw i32 %23, %25
%27 = add nsw i32 %26, 279
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i8*
%30 = load volatile i8, i8* %29
%31 = zext i8 %30 to i32
%32 = or i32 %31, 32
%33 = trunc i32 %32 to i8
store volatile i8 %33, i8* %29
br label %34
34: ; preds = %22, %10
ret void
}

LLVM IR (-O2):
define void @USBEndpointDMAEnable(i32 %0, i32 %1, i32 %2) {
%4 = and i32 %2, 8192
%5 = icmp eq i32 %4, 0
%6 = add i32 %1, %0
%7 = select i1 %5, i32 263, i32 259
%8 = select i1 %5, i8 32, i8 16
%9 = add i32 %6, %7
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = load volatile i8, i8* %11
%13 = or i8 %12, %8
store volatile i8 %13, i8* %11
ret void
}
/* Type definitions */
struct nlmsg {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct nlmsg *);
extern void nlmsg_free(struct nlmsg *nlmsg) { free(nlmsg); }


x86 assembly (clang, -O0):
<nlmsg_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):
<nlmsg_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define void @nlmsg_free(%struct.nlmsg* %0) {
%2 = alloca %struct.nlmsg*
store %struct.nlmsg* %0, %struct.nlmsg** %2
%3 = load %struct.nlmsg*, %struct.nlmsg** %2
%4 = call i32 @free(%struct.nlmsg* %3)
ret void
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define void @nlmsg_free(%struct.nlmsg* nocapture %0) {
%2 = tail call i32 @free(%struct.nlmsg* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void av_free(void *ptr) {
  if (ptr) {
    free(ptr);
  }
}


x86 assembly (clang, -O0):
<av_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <av_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_free>:
test   %rdi,%rdi
je     111a <av_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @av_free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i32 @free(i8* %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @av_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("rot [--shift n] input\n");
  printf("\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"rot [--shift n] input\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"rot [--shift n] input\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @exit(i32 1)
unreachable
}