xunge/DecIR huggingface dataset:
unsigned long getu32(const unsigned char *addr) {
  return (((((unsigned long)addr[3] << 8) | addr[2]) << 8) | addr[1]) << 8 |
         addr[0];
}


x86 assembly (clang, -O0):
<getu32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
or     %rcx,%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %rcx,%rax
shl    $0x8,%rax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %rcx,%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @getu32(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i64
%8 = shl nuw nsw i64 %4, 16
%9 = shl nuw nsw i64 %7, 8
%10 = or i64 %9, %8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i64
%14 = or i64 %10, %13
%15 = shl nuw nsw i64 %14, 8
%16 = load i8, i8* %0
%17 = zext i8 %16 to i64
%18 = or i64 %15, %17
ret i64 %18
}
extern void vscp_timer_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @vscp_timer_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WriteInstruction(char *);
void CR_ScreenRight(void) { WriteInstruction("call scrr"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"call scrr\00"
define void @CR_ScreenRight() {
%1 = call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"call scrr\00"
define void @CR_ScreenRight() {
%1 = tail call i32 @WriteInstruction(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int biscSendByte(int);
int biscSendInt(int);
int biscWaitDistance(int distanceMM) {
  if (biscSendByte(156) == -1)
    return -1;
  if (biscSendInt(distanceMM) == -1)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<biscWaitDistance>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x9c,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
jne    114a <biscWaitDistance+0x2a>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <biscWaitDistance+0x4e>
mov    -0x8(%rbp),%edi
call   1040 <biscSendInt@plt>
cmp    $0xffffffff,%eax
jne    1167 <biscWaitDistance+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <biscWaitDistance+0x4e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<biscWaitDistance>:
push   %rbx
mov    %edi,%ebx
mov    $0x9c,%edi
call   1030 <biscSendByte@plt>
cmp    $0xffffffff,%eax
je     1147 <biscWaitDistance+0x27>
mov    %ebx,%edi
call   1040 <biscSendInt@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @biscWaitDistance(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @biscSendByte(i32 156)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %13
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @biscSendInt(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 -1, i32* %2
br label %13
12: ; preds = %7
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11, %6
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @biscWaitDistance(i32 %0) {
%2 = tail call i32 @biscSendByte(i32 156)
%3 = icmp eq i32 %2, -1
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @biscSendInt(i32 %0)
%6 = icmp eq i32 %5, -1
%7 = sext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}
void gdk_x11_get_xatom_name() {}


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

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

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

LLVM IR (-O2):
define void @gdk_x11_get_xatom_name() {
ret void
}
/* Variables and functions */
int check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, p;
  scanf("%d", &n);
  p = check_prime(n);
  printf("%d", p);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @check_prime(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
int f4(void) {
  unsigned char a = 128;
  return (a & 0x80) ? -128 : 0;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
movb   $0x80,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0x80,%edx
xor    %eax,%eax
mov    $0xffffff80,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f4() {
%1 = alloca i8
store i8 -128, i8* %1
%2 = load i8, i8* %1
%3 = zext i8 %2 to i32
%4 = and i32 %3, 128
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 -128, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @f4() {
ret i32 -128
}
int pi_graphics_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pi_graphics_init() {
ret i32 0
}
long long llabs(long long n) { return ((n < 0LL) ? -n : n); }


x86 assembly (clang, -O0):
<llabs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <llabs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <llabs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<llabs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @llabs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_PUBKEY;

/* Variables and functions */
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_PUBKEY_it;
X509_PUBKEY *X509_PUBKEY_new(void) {
  return (X509_PUBKEY *)ASN1_item_new(&X509_PUBKEY_it);
}


x86 assembly (clang, -O0):
<X509_PUBKEY_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<X509_PUBKEY_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@X509_PUBKEY_it = global i32 0
define i32* @X509_PUBKEY_new() {
%1 = call i64 @ASN1_item_new(i32* @X509_PUBKEY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@X509_PUBKEY_it = global i32 0
define i32* @X509_PUBKEY_new() {
%1 = tail call i64 @ASN1_item_new(i32* @X509_PUBKEY_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
int test_imm_0Buint16_mem(unsigned short *val) {
  return ((*val) & (-0x0B << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_0Buint16_mem>:
movzwl (%rdi),%eax
test   $0xfff5,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_0Buint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -11
%7 = icmp ne i32 %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_0Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -11
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int bs_log2(int x) {
  float fx;
  unsigned long ix, exp;
  fx = (float)x;
  ix = *(unsigned long *)&fx;
  exp = (ix >> 23) & 0xFF;
  return exp - 127;
}


x86 assembly (clang, -O0):
<bs_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x17,%rax
and    $0xff,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x7f,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bs_log2>:
cvtsi2ss %edi,%xmm0
movss  %xmm0,-0x8(%rsp)
mov    -0x8(%rsp),%eax
shr    $0x17,%eax
movzbl %al,%eax
add    $0xffffff81,%eax
ret

LLVM IR (-O0):
define i32 @bs_log2(i32 %0) {
%2 = alloca i32
%3 = alloca float
%4 = alloca i64
%5 = alloca i64
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sitofp i32 %6 to float
store float %7, float* %3
%8 = bitcast float* %3 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %4
%10 = load i64, i64* %4
%11 = lshr i64 %10, 23
%12 = and i64 %11, 255
store i64 %12, i64* %5
%13 = load i64, i64* %5
%14 = sub i64 %13, 127
%15 = trunc i64 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @bs_log2(i32 %0) {
%2 = alloca float
%3 = bitcast float* %2 to i8*
%4 = sitofp i32 %0 to float
store float %4, float* %2
%5 = bitcast float* %2 to i64*
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = lshr i32 %7, 23
%9 = and i32 %8, 255
%10 = add nsw i32 %9, -127
ret i32 %10
}
/* Variables and functions */
int i2c_smbus_read_byte_data(int, int);
int radxaI2CReadReg8(int fd, int reg) {
  return i2c_smbus_read_byte_data(fd, reg);
}


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

x86 assembly (clang, -O2):
<radxaI2CReadReg8>:
jmp    1030 <i2c_smbus_read_byte_data@plt>

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

LLVM IR (-O2):
define i32 @radxaI2CReadReg8(i32 %0, i32 %1) {
%3 = tail call i32 @i2c_smbus_read_byte_data(i32 %0, i32 %1)
ret i32 %3
}
int gpio_init(struct gpio_dev_t *gpio) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.gpio_dev_t = type opaque
define i32 @gpio_init(%struct.gpio_dev_t* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *str) {
  const char *p;
  for (p = str; *p != '\0'; p++) {
  }
  return (size_t)(p - str);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1136 <strlen+0x36>
jmp    1125 <strlen+0x25>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
ret i64 %10
}
/* Variables and functions */
int /*<<< orphan*/ BSP_ClearDspInterrupt(unsigned int);
int BSP_GetCoreId();
int /*<<< orphan*/ BSP_OtherHandlerEntry(int, unsigned int);
scalar_t__ Scropius_ISRHandlerEntry(int, unsigned int);
void BSP_IsrHandlerEntry(unsigned int vectorNum) {
  int core = BSP_GetCoreId();
  BSP_ClearDspInterrupt(vectorNum);
  if (Scropius_ISRHandlerEntry(core, vectorNum))
    BSP_OtherHandlerEntry(core, vectorNum);
}


x86 assembly (clang, -O0):
<BSP_IsrHandlerEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <BSP_GetCoreId@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <BSP_ClearDspInterrupt@plt>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1050 <Scropius_ISRHandlerEntry@plt>
cmp    $0x0,%rax
je     117d <BSP_IsrHandlerEntry+0x3d>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1060 <BSP_OtherHandlerEntry@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BSP_IsrHandlerEntry>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <BSP_GetCoreId@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1040 <BSP_ClearDspInterrupt@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <Scropius_ISRHandlerEntry@plt>
test   %rax,%rax
je     1172 <BSP_IsrHandlerEntry+0x32>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <BSP_OtherHandlerEntry@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @BSP_IsrHandlerEntry(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @BSP_GetCoreId()
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = call i32 @BSP_ClearDspInterrupt(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %2
%9 = call i64 @Scropius_ISRHandlerEntry(i32 %7, i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %1
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = call i32 @BSP_OtherHandlerEntry(i32 %12, i32 %13)
br label %15
15: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
define void @BSP_IsrHandlerEntry(i32 %0) {
%2 = tail call i32 (...) @BSP_GetCoreId()
%3 = tail call i32 @BSP_ClearDspInterrupt(i32 %0)
%4 = tail call i64 @Scropius_ISRHandlerEntry(i32 %2, i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @BSP_OtherHandlerEntry(i32 %2, i32 %0)
br label %8
8: ; preds = %6, %1
ret void
}
int fun994() { return 994; }


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

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

LLVM IR (-O0):
define i32 @fun994() {
ret i32 994
}

LLVM IR (-O2):
define i32 @fun994() {
ret i32 994
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AESIntClear(uint32_t ui32Base, uint32_t ui32IntFlags) {
  ;

  ;
  (*((volatile uint32_t *)(ui32Base + 0xFFFFA02C))) =
      (((ui32IntFlags & 0x00010000) >> 16) |
       ((ui32IntFlags & 0x00060000) >> 15) |
       ((ui32IntFlags & 0x00080000) >> 18));
}


x86 assembly (clang, -O0):
<AESIntClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x10000,%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%eax
and    $0x60000,%eax
sar    $0xf,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%eax
and    $0x80000,%eax
sar    $0x12,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0xffffa02c,%eax
mov    %eax,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AESIntClear>:
mov    %esi,%eax
shr    $0x10,%eax
and    $0x1,%eax
mov    %esi,%ecx
shr    $0xf,%ecx
and    $0xc,%ecx
or     %eax,%ecx
shr    $0x12,%esi
and    $0x2,%esi
or     %ecx,%esi
add    $0xffffa02c,%edi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @AESIntClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 65536
%7 = ashr i32 %6, 16
%8 = load i32, i32* %4
%9 = and i32 %8, 393216
%10 = ashr i32 %9, 15
%11 = or i32 %7, %10
%12 = load i32, i32* %4
%13 = and i32 %12, 524288
%14 = ashr i32 %13, 18
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = add i32 %16, -24532
%18 = zext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
ret void
}

LLVM IR (-O2):
define void @AESIntClear(i32 %0, i32 %1) {
%3 = lshr i32 %1, 16
%4 = and i32 %3, 1
%5 = lshr i32 %1, 15
%6 = and i32 %5, 12
%7 = or i32 %4, %6
%8 = lshr i32 %1, 18
%9 = and i32 %8, 2
%10 = or i32 %7, %9
%11 = add i32 %0, -24532
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
store volatile i32 %10, i32* %13
ret void
}
/* Variables and functions */
int pow(int, float);
float mel_inv(float f) { return ((float)(700.0 * (pow(10, f / 2595.0) - 1))); }


x86 assembly (clang, -O0):
<mel_inv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeda(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mel_inv>:
push   %rax
divss  0xee7(%rip),%xmm0
mov    $0xa,%edi
call   1030 <pow@plt>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xed3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @mel_inv(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 2.595000e+03
%6 = fptrunc double %5 to float
%7 = call i32 @pow(i32 10, float %6)
%8 = sub nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fmul double 7.000000e+02, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @mel_inv(float %0) {
%2 = fdiv float %0, 2.595000e+03
%3 = tail call i32 @pow(i32 10, float %2)
%4 = add nsw i32 %3, -1
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 7.000000e+02
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int tcpconn(char *, int, int);
int default_login_func(char *ip, int port, char *user, char *pwd, void *param) {
  return tcpconn(ip, port, 5);
}


x86 assembly (clang, -O0):
<default_login_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x5,%edx
call   1030 <tcpconn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_login_func>:
mov    $0x5,%edx
jmp    1030 <tcpconn@plt>

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

LLVM IR (-O2):
define i32 @default_login_func(i8* %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i32 @tcpconn(i8* %0, i32 %1, i32 5)
ret i32 %6
}
int wpas_p2p_wps_eapol_cb(struct wpa_supplicant *wpa_s) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define i32 @wpas_p2p_wps_eapol_cb(%struct.wpa_supplicant* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ PIN_IRQ_Handler(int);
void PIN_INT2_IRQHandler(void) { PIN_IRQ_Handler(2); }


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

x86 assembly (clang, -O2):
<PIN_INT2_IRQHandler>:
mov    $0x2,%edi
jmp    1030 <PIN_IRQ_Handler@plt>

LLVM IR (-O0):
define void @PIN_INT2_IRQHandler() {
%1 = call i32 @PIN_IRQ_Handler(i32 2)
ret void
}

LLVM IR (-O2):
define void @PIN_INT2_IRQHandler() {
%1 = tail call i32 @PIN_IRQ_Handler(i32 2)
ret void
}
int db_upgrade(int old_version) {
  switch (old_version) {}
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @db_upgrade(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %4 [
]
4: ; preds = %1
ret i32 0
}

LLVM IR (-O2):
define i32 @db_upgrade(i32 %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ c;
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ _expect_int_eq(int, int, char *);
void test_array_size(void) {
  short a[3];
  double b[7];
  struct {
    int x;
    char y;
  } c[11];
  _expect_int_eq(
      3, ((int)((sizeof(a) / sizeof(*(a))) / !(sizeof(a) % sizeof(*(a))))),
      "3"
      " == "
      "AZ_ARRAY_SIZE(a)");
  _expect_int_eq(
      7, ((int)((sizeof(b) / sizeof(*(b))) / !(sizeof(b) % sizeof(*(b))))),
      "7"
      " == "
      "AZ_ARRAY_SIZE(b)");
  _expect_int_eq(
      11, ((int)((sizeof(c) / sizeof(*(c))) / !(sizeof(c) % sizeof(*(c))))),
      "11"
      " == "
      "AZ_ARRAY_SIZE(c)");
}


x86 assembly (clang, -O0):
<test_array_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    $0x3,%esi
lea    0xed9(%rip),%rdx
mov    %esi,%edi
call   1030 <_expect_int_eq@plt>
mov    $0x7,%esi
lea    0xedc(%rip),%rdx
mov    %esi,%edi
call   1030 <_expect_int_eq@plt>
mov    $0xb,%esi
lea    0xedf(%rip),%rdx
mov    %esi,%edi
call   1030 <_expect_int_eq@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_array_size>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x3,%edi
mov    $0x3,%esi
call   1030 <_expect_int_eq@plt>
lea    0xee8(%rip),%rdx
mov    $0x7,%edi
mov    $0x7,%esi
call   1030 <_expect_int_eq@plt>
lea    0xee8(%rip),%rdx
mov    $0xb,%edi
mov    $0xb,%esi
pop    %rax
jmp    1030 <_expect_int_eq@plt>

LLVM IR (-O0):
%struct.anon = type { i32, i8 }
@.str = [22 x i8] c"3 == AZ_ARRAY_SIZE(a)\00"
@.str.1 = [22 x i8] c"7 == AZ_ARRAY_SIZE(b)\00"
@.str.2 = [23 x i8] c"11 == AZ_ARRAY_SIZE(c)\00"
define void @test_array_size() {
%1 = alloca [3 x i16]
%2 = alloca [7 x double]
%3 = alloca [11 x %struct.anon]
%4 = call i32 @_expect_int_eq(i32 3, i32 3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @_expect_int_eq(i32 7, i32 7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @_expect_int_eq(i32 11, i32 11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.anon = type { i32, i8 }
@.str = [22 x i8] c"3 == AZ_ARRAY_SIZE(a)\00"
@.str.1 = [22 x i8] c"7 == AZ_ARRAY_SIZE(b)\00"
@.str.2 = [23 x i8] c"11 == AZ_ARRAY_SIZE(c)\00"
define void @test_array_size() {
%1 = tail call i32 @_expect_int_eq(i32 3, i32 3, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @_expect_int_eq(i32 7, i32 7, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @_expect_int_eq(i32 11, i32 11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ test3();
int main(int argc, char **argv) {
  if (!test3())
    abort();
  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)
mov    $0x0,%al
call   1040 <test3@plt>
cmp    $0x0,%eax
jne    114d <main+0x2d>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test3@plt>
test   %eax,%eax
je     1130 <main+0x10>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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 (...) @test3()
%7 = icmp ne i32 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %2
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test3()
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ power_touch_panel(int);
void _backlight_off(void) {
  (*(volatile unsigned long *)0x80000330) &= ~0x2;
  power_touch_panel(false);
}


x86 assembly (clang, -O0):
<_backlight_off>:
push   %rbp
mov    %rsp,%rbp
mov    $0x80000330,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffd,%rcx
mov    $0x80000330,%eax
mov    %rcx,(%rax)
xor    %edi,%edi
call   1030 <power_touch_panel@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_backlight_off>:
mov    $0x80000330,%eax
andq   $0xfffffffffffffffd,(%rax)
xor    %edi,%edi
jmp    1030 <power_touch_panel@plt>

LLVM IR (-O0):
define void @_backlight_off() {
%1 = load volatile i64, i64* inttoptr (i64 2147484464 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2147484464 to i64*)
%3 = call i32 @power_touch_panel(i32 0)
ret void
}

LLVM IR (-O2):
define void @_backlight_off() {
%1 = load volatile i64, i64* inttoptr (i64 2147484464 to i64*)
%2 = and i64 %1, -3
store volatile i64 %2, i64* inttoptr (i64 2147484464 to i64*)
%3 = tail call i32 @power_touch_panel(i32 0)
ret void
}
unsigned short read_beword(const unsigned char *p) {
  return (p[0] << 8) | p[1];
}


x86 assembly (clang, -O0):
<read_beword>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_beword>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @read_beword(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 8
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %7, %11
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @read_beword(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float pi = 3.1415f;
  printf("ОТГ: %05.4f\n ", pi);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"\D0\9E\D0\A2\D0\93: %05.4f\0A \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x400921CAC0000000, float* %2
%3 = load float, float* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"\D0\9E\D0\A2\D0\93: %05.4f\0A \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 0x400921CAC0000000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
size_t str_index_n(char const *, char *, size_t);
size_t u_char_to_u(int /*<<< orphan*/, char *);
size_t u_char_index_n(const char *str, uint32_t c, size_t n) {
  char ch[7];
  ch[u_char_to_u(c, ch)] = '\0';
  return str_index_n(str, ch, n);
}


x86 assembly (clang, -O0):
<u_char_index_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x1f(%rbp),%rsi
call   1040 <u_char_to_u@plt>
movb   $0x0,-0x1f(%rbp,%rax,1)
mov    -0x8(%rbp),%rdi
lea    -0x1f(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <str_index_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_char_index_n>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rdi,%rbx
lea    0x9(%rsp),%r15
mov    %esi,%edi
mov    %r15,%rsi
call   1040 <u_char_to_u@plt>
movb   $0x0,0x9(%rsp,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <str_index_n@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @u_char_index_n(i8* %0, i32 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i64
%7 = alloca [7 x i8]
store i8* %0, i8** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%8 = load i32, i32* %5
%9 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%10 = call i64 @u_char_to_u(i32 %8, i8* %9)
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 %10
store i8 0, i8* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%14 = load i64, i64* %6
%15 = call i64 @str_index_n(i8* %12, i8* %13, i64 %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @u_char_index_n(i8* %0, i32 %1, i64 %2) {
%4 = alloca [7 x i8]
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%6 = call i64 @u_char_to_u(i32 %1, i8* %5)
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 %6
store i8 0, i8* %7
%8 = call i64 @str_index_n(i8* %0, i8* %5, i64 %2)
ret i64 %8
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int rc_i2c_read_byte(int, int, int *);
int rc_i2c_read_bit(int bus, uint8_t regAddr, uint8_t bitNum, uint8_t *data) {
  uint8_t b;
  uint8_t count = rc_i2c_read_byte(bus, regAddr, &b);
  *data = b & (1 << bitNum);
  return count;
}


x86 assembly (clang, -O0):
<rc_i2c_read_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x1c(%rbp),%rdx
call   1030 <rc_i2c_read_byte@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    -0x24(%rbp),%ecx
and    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_i2c_read_bit>:
push   %rbp
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %edx,%ebp
lea    0x4(%rsp),%rdx
call   1030 <rc_i2c_read_byte@plt>
mov    $0x1,%edx
mov    %ebp,%ecx
shl    %cl,%edx
and    0x4(%rsp),%edx
mov    %edx,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rc_i2c_read_bit(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
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 @rc_i2c_read_byte(i32 %11, i32 %12, i32* %9)
store i32 %13, i32* %10
%14 = load i32, i32* %9
%15 = load i32, i32* %7
%16 = shl i32 1, %15
%17 = and i32 %14, %16
%18 = load i32*, i32** %8
store i32 %17, i32* %18
%19 = load i32, i32* %10
ret i32 %19
}

LLVM IR (-O2):
define i32 @rc_i2c_read_bit(i32 %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32 @rc_i2c_read_byte(i32 %0, i32 %1, i32* %5)
%8 = load i32, i32* %5
%9 = shl nuw i32 1, %2
%10 = and i32 %8, %9
store i32 %10, i32* %3
ret i32 %7
}
int pf_pqos_localbw_setup(struct _perf_pqos *pqos __attribute__((unused)),
                          int pid __attribute__((unused)),
                          int lwpid __attribute__((unused))) {
  return 0;
}


x86 assembly (clang, -O0):
<pf_pqos_localbw_setup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._perf_pqos = type opaque
define i32 @pf_pqos_localbw_setup(%struct._perf_pqos* %0, i32 %1, i32 %2) {
%4 = alloca %struct._perf_pqos*
%5 = alloca i32
%6 = alloca i32
store %struct._perf_pqos* %0, %struct._perf_pqos** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct._perf_pqos = type opaque
define i32 @pf_pqos_localbw_setup(%struct._perf_pqos* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
void latex_list(void) {
  write_break();
  write_line("\\begin{description}");
}


x86 assembly (clang, -O0):
<latex_list>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <write_break@plt>
lea    0xece(%rip),%rdi
call   1040 <write_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<latex_list>:
push   %rax
xor    %eax,%eax
call   1030 <write_break@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <write_line@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"\\begin{description}\00"
define void @latex_list() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"\\begin{description}\00"
define void @latex_list() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int alloc(int);
_sys_alloc(int x) { return alloc(x); }


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

x86 assembly (clang, -O2):
<_sys_alloc>:
jmp    1030 <alloc@plt>

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

LLVM IR (-O2):
define i32 @_sys_alloc(i32 %0) {
%2 = tail call i32 @alloc(i32 %0)
ret i32 %2
}
/* Variables and functions */
int toint(char);
int organizational_category(char fascn[40]) {
  int temp;
  temp = toint(fascn[32]);
  return (temp);
}


x86 assembly (clang, -O0):
<organizational_category>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x20(%rax),%edi
call   1030 <toint@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<organizational_category>:
movsbl 0x20(%rdi),%edi
jmp    1030 <toint@plt>

LLVM IR (-O0):
define i32 @organizational_category(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 32
%6 = load i8, i8* %5
%7 = call i32 @toint(i8 signext %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @organizational_category(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 32
%3 = load i8, i8* %2
%4 = tail call i32 @toint(i8 signext %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ sscal(int const *, float const *, float *, int const *);
void c_sscal(const int N, const float alpha, float *X, const int stride) {
  sscal(&N, &alpha, X, &stride);
}


x86 assembly (clang, -O0):
<c_sscal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x14(%rbp),%rcx
call   1030 <sscal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_sscal>:
sub    $0x18,%rsp
mov    %rsi,%rax
mov    %edi,0x14(%rsp)
movss  %xmm0,0x10(%rsp)
mov    %edx,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rcx
mov    %rax,%rdx
call   1030 <sscal@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @c_sscal(i32 %0, float %1, float* %2, i32 %3) {
%5 = alloca i32
%6 = alloca float
%7 = alloca i32
store i32 %0, i32* %5
store float %1, float* %6
store i32 %3, i32* %7
%8 = call i32 @sscal(i32* %5, float* %6, float* %2, i32* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printbigbytes(long, long, long);
int /*<<< orphan*/ printf(char *);
void printftrafficinc_(long int *mmfM, int *mmfsz, int *mmf) {
  printf(" F Traffic: ");
  printbigbytes(*mmfM, (long int)*mmfsz, (long int)*mmf);
  printf(" bytes\n");
}


x86 assembly (clang, -O0):
<printftrafficinc_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
movslq (%rax),%rsi
mov    -0x18(%rbp),%rax
movslq (%rax),%rdx
call   1040 <printbigbytes@plt>
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printftrafficinc_>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    (%rbx),%rdi
movslq (%r15),%rsi
movslq (%r14),%rdx
call   1050 <printbigbytes@plt>
lea    0xeae(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@.str = [13 x i8] c" F Traffic: \00"
@str = [7 x i8] c" bytes\00"
define void @printftrafficinc_(i64* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%5 = load i64, i64* %0
%6 = load i32, i32* %1
%7 = sext i32 %6 to i64
%8 = load i32, i32* %2
%9 = sext i32 %8 to i64
%10 = tail call i32 @printbigbytes(i64 %5, i64 %7, i64 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
void inclass_unit2chal() {}


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

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

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

LLVM IR (-O2):
define void @inclass_unit2chal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stdout;
void print_error(char str[]) {
  fprintf(stdout, "\033[1;31mERROR: \033[1;30m%s\n\033[0m", str);
}


x86 assembly (clang, -O0):
<print_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_error>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [29 x i8] c"\1B[1;31mERROR: \1B[1;30m%s\0A\1B[0m\00"
define void @print_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [29 x i8] c"\1B[1;31mERROR: \1B[1;30m%s\0A\1B[0m\00"
define void @print_error(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned long stable_NCode(char const *, size_t);
size_t strlen(char const *);
unsigned long stable_Code(const char *name) {
  size_t length = strlen(name);
  return stable_NCode(name, length);
}


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

x86 assembly (clang, -O2):
<stable_Code>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1040 <stable_NCode@plt>

LLVM IR (-O0):
define i64 @stable_Code(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
store i64 %5, i64* %3
%6 = load i8*, i8** %2
%7 = load i64, i64* %3
%8 = call i64 @stable_NCode(i8* %6, i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @stable_Code(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = tail call i64 @stable_NCode(i8* %0, i64 %2)
ret i64 %3
}
/* Variables and functions */
char *libintl_dcgettext(char const *, char const *, int);
char *dcgettext(const char *domainname, const char *msgid, int category) {
  return libintl_dcgettext(domainname, msgid, category);
}


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

x86 assembly (clang, -O2):
<dcgettext>:
jmp    1030 <libintl_dcgettext@plt>

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

LLVM IR (-O2):
define i8* @dcgettext(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @libintl_dcgettext(i8* %0, i8* %1, i32 %2)
ret i8* %4
}
void init_audio() {}


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

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

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

LLVM IR (-O2):
define void @init_audio() {
ret void
}
cbuf11(f, n) { return (cbuf(f, n, 11)); }


x86 assembly (clang, -O0):
<cbuf11>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0xb,%edx
mov    $0x0,%al
call   1030 <cbuf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cbuf11>:
mov    $0xb,%edx
xor    %eax,%eax
jmp    1030 <cbuf@plt>

LLVM IR (-O0):
define i32 @cbuf11(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 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %5, i32 %6, i32 11)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cbuf11(i32 %0, i32 %1) {
%3 = tail call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @cbuf to i32 (i32, i32, i32, ...)*)(i32 %0, i32 %1, i32 11)
ret i32 %3
}