xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int s291_parity(int);
void s291_set_dc(uint16_t *p_s291, uint8_t i_dc) {
  p_s291[5] = i_dc | s291_parity(i_dc);
}


x86 assembly (clang, -O0):
<s291_set_dc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <s291_parity@plt>
mov    -0x10(%rbp),%ecx
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s291_set_dc>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <s291_parity@plt>
or     %ebx,%eax
mov    %eax,0x14(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @s291_set_dc(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 = load i32, i32* %4
%7 = call i32 @s291_parity(i32 %6)
%8 = or i32 %5, %7
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 5
store i32 %8, i32* %10
ret void
}

LLVM IR (-O2):
define void @s291_set_dc(i32* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @s291_parity(i32 %1)
%4 = or i32 %3, %1
%5 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %4, i32* %5
ret void
}
/* Variables and functions */
double genrand_int32(unsigned long *, unsigned long *);
double genrand_real1(unsigned long mt[], unsigned long *mtiPtr) {
  return genrand_int32(mt, mtiPtr) * (1.0 / 4294967295.0);
}


x86 assembly (clang, -O0):
<genrand_real1>:
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 <genrand_int32@plt>
movsd  0xecb(%rip),%xmm1
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<genrand_real1>:
push   %rax
call   1030 <genrand_int32@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @genrand_real1(i64* %0, i64* %1) {
%3 = alloca i64*
%4 = alloca i64*
store i64* %0, i64** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %3
%6 = load i64*, i64** %4
%7 = call double @genrand_int32(i64* %5, i64* %6)
%8 = fmul double %7, 0x3DF0000000100000
ret double %8
}

LLVM IR (-O2):
define double @genrand_real1(i64* %0, i64* %1) {
%3 = tail call double @genrand_int32(i64* %0, i64* %1)
%4 = fmul double %3, 0x3DF0000000100000
ret double %4
}
int sortedKeyCompare(int (*xCmp)(void *, int, void *, int), int iLhsTopic,
                     void *pLhsKey, int nLhsKey, int iRhsTopic, void *pRhsKey,
                     int nRhsKey) {
  int res = iLhsTopic - iRhsTopic;
  if (res == 0) {
    res = xCmp(pLhsKey, nLhsKey, pRhsKey, nRhsKey);
  }
  return res;
}


x86 assembly (clang, -O0):
<sortedKeyCompare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    114b <sortedKeyCompare+0x4b>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    0x10(%rbp),%ecx
call   *%rax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortedKeyCompare>:
sub    %r8d,%esi
je     1108 <sortedKeyCompare+0x8>
mov    %esi,%eax
ret
mov    %rdi,%rax
mov    0x8(%rsp),%r8d
mov    %rdx,%rdi
mov    %ecx,%esi
mov    %r9,%rdx
mov    %r8d,%ecx
jmp    *%rax

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

LLVM IR (-O2):
define i32 @sortedKeyCompare(i32 (i8*, i32, i8*, i32)* nocapture %0, i32 %1, i8* %2, i32 %3, i32 %4, i8* %5, i32 %6) {
%8 = sub nsw i32 %1, %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 %0(i8* %2, i32 %3, i8* %5, i32 %6)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ %11, %10 ], [ %8, %7 ]
ret i32 %13
}
/* Variables and functions */
int rnd();
int random_number() { return rnd() % 4 + 1; }


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rnd@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rax
xor    %eax,%eax
call   1030 <rnd@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_number() {
%1 = call i32 (...) @rnd()
%2 = srem i32 %1, 4
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @random_number() {
%1 = tail call i32 (...) @rnd()
%2 = srem i32 %1, 4
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
main() {
  char str1[] = "Slobomir";
  char *str2 = "FIT";
  char str3[101];
  char str4[] = {'O', 's', 'n', 'o', 'v', 'i', '\0'};
  printf("str4 = %s\n", str4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0xede(%rip),%rax
mov    %rax,-0x9(%rbp)
mov    0xedc(%rip),%al
mov    %al,-0x1(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecd(%rip),%eax
mov    %eax,-0x87(%rbp)
mov    0xec4(%rip),%ax
mov    %ax,-0x83(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0x81(%rbp)
lea    -0x87(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x69766f,0x3(%rsp)
movl   $0x6f6e734f,(%rsp)
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str1 = [9 x i8] c"Slobomir\00"
@.str = [4 x i8] c"FIT\00"
@__const.main.str4 = [7 x i8] c"Osnovi\00"
@.str.1 = [11 x i8] c"str4 = %s\0A\00"
define i32 @main() {
%1 = alloca [9 x i8]
%2 = alloca i8*
%3 = alloca [101 x i8]
%4 = alloca [7 x i8]
%5 = bitcast [9 x i8]* %1 to i8*
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2
%6 = bitcast [7 x i8]* %4 to i8*
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str4 = [7 x i8] c"Osnovi\00"
@.str.1 = [11 x i8] c"str4 = %s\0A\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
int pthread_yield() {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_yield() {
ret i32 0
}
int GPIO_Interrupt(long *base_add, int reg, unsigned long mask) {
  *((unsigned *)(base_add + (reg / 4))) = mask;
  return 1;
}


x86 assembly (clang, -O0):
<GPIO_Interrupt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%edx
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,8)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIO_Interrupt>:
lea    0x3(%rsi),%eax
test   %esi,%esi
cmovns %esi,%eax
sar    $0x2,%eax
cltq
mov    %edx,(%rdi,%rax,8)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @GPIO_Interrupt(i64* %0, i32 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i64
store i64* %0, i64** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
%9 = load i64*, i64** %4
%10 = load i32, i32* %5
%11 = sdiv i32 %10, 4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = bitcast i64* %13 to i32*
store i32 %8, i32* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @GPIO_Interrupt(i64* nocapture writeonly %0, i32 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = sdiv i32 %1, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i64, i64* %0, i64 %6
%8 = bitcast i64* %7 to i32*
store i32 %4, i32* %8
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Set32(int, int);
int /*<<< orphan*/ set_next_tick_default();
void timer_init() {
  set_next_tick_default();
  Set32(0x20003000, 2);
  Set32(0x2000B210, 0x00000002);
}


x86 assembly (clang, -O0):
<timer_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <set_next_tick_default@plt>
mov    $0x20003000,%edi
mov    $0x2,%esi
call   1040 <Set32@plt>
mov    $0x2000b210,%edi
mov    $0x2,%esi
call   1040 <Set32@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<timer_init>:
push   %rax
xor    %eax,%eax
call   1030 <set_next_tick_default@plt>
mov    $0x20003000,%edi
mov    $0x2,%esi
call   1040 <Set32@plt>
mov    $0x2000b210,%edi
mov    $0x2,%esi
pop    %rax
jmp    1040 <Set32@plt>

LLVM IR (-O0):
define void @timer_init() {
%1 = call i32 (...) @set_next_tick_default()
%2 = call i32 @Set32(i32 536883200, i32 2)
%3 = call i32 @Set32(i32 536916496, i32 2)
ret void
}

LLVM IR (-O2):
define void @timer_init() {
%1 = tail call i32 (...) @set_next_tick_default()
%2 = tail call i32 @Set32(i32 536883200, i32 2)
%3 = tail call i32 @Set32(i32 536916496, i32 2)
ret void
}
void abcde9fghijklmn9opqrstuvwxzy() {}


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

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

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

LLVM IR (-O2):
define void @abcde9fghijklmn9opqrstuvwxzy() {
ret void
}
void cfun() {}


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

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

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

LLVM IR (-O2):
define void @cfun() {
ret void
}
int sipdomain_del(const char *ifname, int ifindex, const char *domain) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @sipdomain_del(i8* %0, i32 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
ret i32 0
}

LLVM IR (-O2):
define i32 @sipdomain_del(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
ret i32 0
}
int test_imm_F1uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0xF1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F1uint64_highword_reg>:
movabs $0xf100000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F1uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 1035087118336
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test_imm_65uint16_mem(unsigned short *val) {
  return ((*val) & (0x65 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_65uint16_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, 101
%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_65uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 101
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ isalnum(char);
bool hidrd_char_istkn(char c) { return (isalnum(c) || c == '_'); }


x86 assembly (clang, -O0):
<hidrd_char_istkn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <hidrd_char_istkn+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hidrd_char_istkn>:
push   %rbx
mov    %edi,%ebx
call   1030 <isalnum@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @hidrd_char_istkn(i8 signext %0) {
%2 = tail call i64 @isalnum(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
int IntNormalize(int value, int omin, int omax, int nmin, int nmax) {
  float tmp;
  int i;
  if ((omax - omin) == 0)
    return 0;
  tmp = ((float)(value - omin)) / ((float)(omax - omin));
  i = nmin + (int)(tmp * ((float)(nmax - nmin)));
  return i;
}


x86 assembly (clang, -O0):
<IntNormalize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cmp    $0x0,%eax
jne    112f <IntNormalize+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1171 <IntNormalize+0x71>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
movss  -0x1c(%rbp),%xmm0
mov    -0x18(%rbp),%ecx
sub    -0x14(%rbp),%ecx
cvtsi2ss %ecx,%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%ecx
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntNormalize>:
sub    %esi,%edx
je     1128 <IntNormalize+0x28>
sub    %esi,%edi
cvtsi2ss %edi,%xmm0
cvtsi2ss %edx,%xmm1
divss  %xmm1,%xmm0
sub    %ecx,%r8d
xorps  %xmm1,%xmm1
cvtsi2ss %r8d,%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%eax
add    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @IntNormalize(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = sub nsw i32 %14, %15
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %5
store i32 0, i32* %6
br label %39
19: ; preds = %5
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = sub nsw i32 %20, %21
%23 = sitofp i32 %22 to float
%24 = load i32, i32* %9
%25 = load i32, i32* %8
%26 = sub nsw i32 %24, %25
%27 = sitofp i32 %26 to float
%28 = fdiv float %23, %27
store float %28, float* %12
%29 = load i32, i32* %10
%30 = load float, float* %12
%31 = load i32, i32* %11
%32 = load i32, i32* %10
%33 = sub nsw i32 %31, %32
%34 = sitofp i32 %33 to float
%35 = fmul float %30, %34
%36 = fptosi float %35 to i32
%37 = add nsw i32 %29, %36
store i32 %37, i32* %13
%38 = load i32, i32* %13
store i32 %38, i32* %6
br label %39
39: ; preds = %19, %18
%40 = load i32, i32* %6
ret i32 %40
}

LLVM IR (-O2):
define i32 @IntNormalize(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = sub nsw i32 %2, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %18, label %8
8: ; preds = %5
%9 = sub nsw i32 %0, %1
%10 = sitofp i32 %9 to float
%11 = sitofp i32 %6 to float
%12 = fdiv float %10, %11
%13 = sub nsw i32 %4, %3
%14 = sitofp i32 %13 to float
%15 = fmul float %12, %14
%16 = fptosi float %15 to i32
%17 = add nsw i32 %16, %3
br label %18
18: ; preds = %5, %8
%19 = phi i32 [ %17, %8 ], [ 0, %5 ]
ret i32 %19
}
/* Variables and functions */
int fpcompare(double, double, int /*<<< orphan*/, int);
int isgreater(double x, double y) { return fpcompare(x, y, 0, -1); }


x86 assembly (clang, -O0):
<isgreater>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
xor    %edi,%edi
mov    $0xffffffff,%esi
call   1030 <fpcompare@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isgreater>:
xor    %edi,%edi
mov    $0xffffffff,%esi
jmp    1030 <fpcompare@plt>

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

LLVM IR (-O2):
define i32 @isgreater(double %0, double %1) {
%3 = tail call i32 @fpcompare(double %0, double %1, i32 0, i32 -1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void bit_unset(uint8_t *v, uint8_t bit) { *v &= ~bit; }


x86 assembly (clang, -O0):
<bit_unset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
mov    -0x8(%rbp),%rax
and    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_unset>:
not    %esi
and    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @bit_unset(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 = xor i32 %5, -1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = and i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @bit_unset(i32* nocapture %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = load i32, i32* %0
%5 = and i32 %4, %3
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int bbm_read(void *, unsigned short, unsigned char *);
int fc8151_bb_read(void *hDevice, unsigned short addr, unsigned char *data) {
  int res;
  res = bbm_read(hDevice, addr, data);
  return res;
}


x86 assembly (clang, -O0):
<fc8151_bb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
movzwl %ax,%esi
call   1030 <bbm_read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fc8151_bb_read>:
jmp    1030 <bbm_read@plt>

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

LLVM IR (-O2):
define i32 @fc8151_bb_read(i8* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 @bbm_read(i8* %0, i16 zeroext %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ freeWakeLock(int);
int /*<<< orphan*/ getWakeLock(int);
int main() {
  int i;
  if (i == 0) {
    getWakeLock(1);
  } else {
    getWakeLock(0);
  }
  freeWakeLock(0);
  freeWakeLock(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1148 <main+0x28>
mov    $0x1,%edi
call   1030 <getWakeLock@plt>
jmp    114f <main+0x2f>
xor    %edi,%edi
call   1030 <getWakeLock@plt>
xor    %edi,%edi
call   1040 <freeWakeLock@plt>
mov    $0x1,%edi
call   1040 <freeWakeLock@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @getWakeLock(i32 0)
%2 = tail call i32 @freeWakeLock(i32 0)
%3 = tail call i32 @freeWakeLock(i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ wrap_execv(char const **);
void wrap_execsh(const char *command) {
  const char *args[4];
  args[0] = "/bin/sh";
  args[1] = "-c";
  args[2] = command;
  args[3] = 0;
  wrap_execv(args);
}


x86 assembly (clang, -O0):
<wrap_execsh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <wrap_execv@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrap_execsh>:
sub    $0x28,%rsp
lea    0xee5(%rip),%rax
mov    %rax,(%rsp)
lea    0xee2(%rip),%rax
mov    %rax,0x8(%rsp)
mov    %rdi,0x10(%rsp)
movq   $0x0,0x18(%rsp)
mov    %rsp,%rdi
call   1030 <wrap_execv@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"-c\00"
define void @wrap_execsh(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8*]
store i8* %0, i8** %2
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %2
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 2
store i8* %6, i8** %7
%8 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 3
store i8* null, i8** %8
%9 = getelementptr inbounds [4 x i8*], [4 x i8*]* %3, i64 0, i64 0
%10 = call i32 @wrap_execv(i8** %9)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"/bin/sh\00"
@.str.1 = [3 x i8] c"-c\00"
define void @wrap_execsh(i8* %0) {
%2 = alloca [4 x i8*]
%3 = bitcast [4 x i8*]* %2 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 2
store i8* %0, i8** %6
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %2, i64 0, i64 3
store i8* null, i8** %7
%8 = call i32 @wrap_execv(i8** %4)
ret void
}
void termop_testfill(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      230, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_testfill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0xe6,%r8d
lea    0xf37(%rip),%r9
lea    0xf40(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_testfill>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf67(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0xe6,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_testfill = [16 x i8] c"termop_testfill\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_testfill(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_testfill, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_testfill = [16 x i8] c"termop_testfill\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_testfill(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 230, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @__func__.termop_testfill, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, char *);
int solve(char *, int);
int strlen(char *);
int main() {
  int n = 0, res = 0, len = 0;
  char input[30];
  res = scanf("%s", input);
  len = strlen(input);
  printf("%d", solve(input, len));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xeb4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <solve@plt>
lea    0xe93(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @solve(i8* %2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int sqrt(float);
float f(float x) { return 7 * sqrt(x); }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <sqrt@plt>
imul   $0x7,%eax,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rax
call   1030 <sqrt@plt>
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @f(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @sqrt(float %3)
%5 = mul nsw i32 7, %4
%6 = sitofp i32 %5 to float
ret float %6
}

LLVM IR (-O2):
define float @f(float %0) {
%2 = tail call i32 @sqrt(float %0)
%3 = mul nsw i32 %2, 7
%4 = sitofp i32 %3 to float
ret float %4
}
double abs_df(double *p) {
  double d = *p;
  __asm__("# reg %x0" : "+v"(d));
  return __builtin_fabs(d);
}


x86 assembly (clang, -O0):
<abs_df>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xed5(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs_df>:
movsd  (%rdi),%xmm0
andps  0xef5(%rip),%xmm0
ret

LLVM IR (-O0):
define double @abs_df(double* %0) {
%2 = alloca double*
%3 = alloca double
store double* %0, double** %2
%4 = load double*, double** %2
%5 = load double, double* %4
store double %5, double* %3
%6 = load double, double* %3
%7 = call double asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(double %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = call double @llvm.fabs.f64(double %8)
ret double %9
}

LLVM IR (-O2):
define double @abs_df(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double asm "# reg ${0:x}", "=v,0,~{dirflag},~{fpsr},~{flags}"(double %2)
%4 = tail call double @llvm.fabs.f64(double %3)
ret double %4
}
long C_mpointer(long **ptr, void *mp) {
  long *p = *ptr, *p0 = p;
  *(p++) = (0x0900000000000000L | 0x2000000000000000L) | 1;
  *((void **)p) = mp;
  *ptr = p + 1;
  return (long)p0;
}


x86 assembly (clang, -O0):
<C_mpointer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
movabs $0x2900000000000001,%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
add    $0x8,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<C_mpointer>:
mov    (%rdi),%rax
movabs $0x2900000000000001,%rcx
mov    %rcx,(%rax)
mov    %rsi,0x8(%rax)
lea    0x10(%rax),%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define i64 @C_mpointer(i64** %0, i8* %1) {
%3 = alloca i64**
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i64*
store i64** %0, i64*** %3
store i8* %1, i8** %4
%7 = load i64**, i64*** %3
%8 = load i64*, i64** %7
store i64* %8, i64** %5
%9 = load i64*, i64** %5
store i64* %9, i64** %6
%10 = load i64*, i64** %5
%11 = getelementptr inbounds i64, i64* %10, i32 1
store i64* %11, i64** %5
store i64 2954361355555045377, i64* %10
%12 = load i8*, i8** %4
%13 = load i64*, i64** %5
%14 = bitcast i64* %13 to i8**
store i8* %12, i8** %14
%15 = load i64*, i64** %5
%16 = getelementptr inbounds i64, i64* %15, i64 1
%17 = load i64**, i64*** %3
store i64* %16, i64** %17
%18 = load i64*, i64** %6
%19 = ptrtoint i64* %18 to i64
ret i64 %19
}

LLVM IR (-O2):
define i64 @C_mpointer(i64** nocapture %0, i8* %1) {
%3 = load i64*, i64** %0
%4 = getelementptr inbounds i64, i64* %3, i64 1
store i64 2954361355555045377, i64* %3
%5 = bitcast i64* %4 to i8**
store i8* %1, i8** %5
%6 = getelementptr inbounds i64, i64* %3, i64 2
store i64* %6, i64** %0
%7 = ptrtoint i64* %3 to i64
ret i64 %7
}
void SV_PausedTic(float fDuration) {}


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

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

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

LLVM IR (-O2):
define void @SV_PausedTic(float %0) {
ret void
}
char *zstrdup(int type, char *str) {
  void *dup;
  dup = strdup(str);
  return dup;
}


x86 assembly (clang, -O0):
<zstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zstrdup>:
mov    %rsi,%rdi
jmp    1030 <strdup@plt>

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

LLVM IR (-O2):
define noalias i8* @zstrdup(i32 %0, i8* nocapture %1) {
%3 = tail call i8* @strdup(i8* %1)
ret i8* %3
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ WNOHANG;
int /*<<< orphan*/ printf(char *, int);
int waitpid(int, int *, int /*<<< orphan*/);
void signal_child_handler(int signo) {
  pid_t pid;
  int stat;
  while ((pid = waitpid(-1, &stat, WNOHANG)) > 0) {
    printf("child process pid(%d) terminated\n", pid);
  }
}


x86 assembly (clang, -O0):
<signal_child_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0xc(%rbp),%rsi
call   1040 <waitpid@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1162 <signal_child_handler+0x42>
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <signal_child_handler+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_child_handler>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    0x2eb8(%rip),%r15
mov    (%r15),%edx
lea    0xc(%rsp),%rsi
mov    $0xffffffff,%edi
call   1040 <waitpid@plt>
test   %eax,%eax
jle    117e <signal_child_handler+0x5e>
lea    0xeb3(%rip),%r14
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    (%r15),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1040 <waitpid@plt>
test   %eax,%eax
jg     1160 <signal_child_handler+0x40>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@WNOHANG = global i32 0
@.str = [34 x i8] c"child process pid(%d) terminated\0A\00"
define void @signal_child_handler(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
br label %5
5: ; preds = %9, %1
%6 = load i32, i32* @WNOHANG
%7 = call i32 @waitpid(i32 -1, i32* %4, i32 %6)
store i32 %7, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %3
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
@WNOHANG = global i32 0
@.str = [34 x i8] c"child process pid(%d) terminated\0A\00"
define void @signal_child_handler(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = load i32, i32* @WNOHANG
%5 = call i32 @waitpid(i32 -1, i32* %2, i32 %4)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %1, %7
%8 = phi i32 [ %11, %7 ], [ %5, %1 ]
%9 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @WNOHANG
%11 = call i32 @waitpid(i32 -1, i32* %2, i32 %10)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %7, label %13
13: ; preds = %7, %1
ret void
}
int Arith_div(int x, int y) {
  if ((-13 / 5 == -2) && ((x < 0) != (y < 0)) && (x % y != 0)) {
    return x / y - 1;
  } else {
    return x / y;
  }
}


x86 assembly (clang, -O0):
<Arith_div>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x0,-0xc(%rbp)
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
je     114d <Arith_div+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     114d <Arith_div+0x4d>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1157 <Arith_div+0x57>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Arith_div>:
mov    %esi,%eax
xor    %edi,%eax
js     110c <Arith_div+0xc>
mov    %edi,%eax
cltd
idiv   %esi
ret
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1106 <Arith_div+0x6>
mov    %edi,%eax
cltd
idiv   %esi
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @Arith_div(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %11, label %5
5: ; preds = %2
%6 = srem i32 %0, %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = sdiv i32 %0, %1
%10 = add nsw i32 %9, -1
br label %13
11: ; preds = %5, %2
%12 = sdiv i32 %0, %1
br label %13
13: ; preds = %11, %8
%14 = phi i32 [ %10, %8 ], [ %12, %11 ]
ret i32 %14
}
short test_62_2(short *mem) { return __atomic_nand_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_62_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movw   $0x1,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    %cx,-0x10(%rbp)
mov    (%rax),%ax
mov    %ax,-0xe(%rbp)
mov    -0xe(%rbp),%ax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%dx
mov    %dx,%si
mov    %ax,%dx
mov    %edx,-0x28(%rbp)
and    %esi,%edx
mov    %edx,-0x24(%rbp)
not    %edx
mov    %edx,-0x20(%rbp)
lock cmpxchg %dx,(%rcx)
sete   %cl
mov    %ax,-0x1a(%rbp)
test   $0x1,%cl
mov    %ax,-0xe(%rbp)
jne    1162 <test_62_2+0x62>
jmp    1125 <test_62_2+0x25>
mov    -0x10(%rbp),%cx
mov    -0x1a(%rbp),%ax
and    %cx,%ax
xor    $0xffff,%ax
mov    %ax,-0xc(%rbp)
movswl -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_62_2>:
movzwl (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%ecx
not    %ecx
or     $0xfffe,%ecx
lock cmpxchg %cx,(%rdi)
jne    1110 <test_62_2+0x10>
not    %eax
or     $0xfffe,%eax
ret

LLVM IR (-O0):
define signext i16 @test_62_2(i16* %0) {
%2 = alloca i16*
%3 = alloca i16
%4 = alloca i16
store i16* %0, i16** %2
%5 = load i16*, i16** %2
%6 = getelementptr inbounds i16, i16* %5, i64 0
store i16 1, i16* %3
%7 = load i16, i16* %3
%8 = atomicrmw nand i16* %6, i16 %7 acq_rel
%9 = and i16 %8, %7
%10 = xor i16 %9, -1
store i16 %10, i16* %4
%11 = load i16, i16* %4
ret i16 %11
}

LLVM IR (-O2):
define signext i16 @test_62_2(i16* nocapture %0) {
%2 = atomicrmw nand i16* %0, i16 1 acq_rel
%3 = and i16 %2, 1
%4 = xor i16 %3, -1
ret i16 %4
}
/* Variables and functions */
int *malloc(int);
int /*<<< orphan*/ my_freeBoth(int *, int *);
void testMultipleFreeAnnotations() {
  int *p = malloc(12);
  int *q = malloc(12);
  my_freeBoth(p, q);
}


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

x86 assembly (clang, -O2):
<testMultipleFreeAnnotations>:
push   %rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xc,%edi
call   1040 <malloc@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <my_freeBoth@plt>

LLVM IR (-O0):
define void @testMultipleFreeAnnotations() {
%1 = alloca i32*
%2 = alloca i32*
%3 = call i32* @malloc(i32 12)
store i32* %3, i32** %1
%4 = call i32* @malloc(i32 12)
store i32* %4, i32** %2
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = call i32 @my_freeBoth(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @testMultipleFreeAnnotations() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32* @malloc(i32 12)
%3 = tail call i32 @my_freeBoth(i32* %1, i32* %2)
ret void
}
void sws_getColorspaceDetails() {}


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

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

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

LLVM IR (-O2):
define void @sws_getColorspaceDetails() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ c();
void b() { c(); }


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

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

LLVM IR (-O0):
define void @b() {
%1 = call i32 (...) @c()
ret void
}

LLVM IR (-O2):
define void @b() {
%1 = tail call i32 (...) @c()
ret void
}
int fieldRelativePos(int field) {
  int pos = -1;
  switch (field) {
  case 1:
    pos = 4;
    break;
  case 2:
    pos = 1;
    break;
  case 3:
    pos = 5;
    break;
  case 4:
    pos = 7;
    break;
  case 5:
    pos = 6;
    break;
  case 6:
    pos = 2;
    break;
  case 7:
    pos = 3;
    break;
  case 8:
    pos = 0;
    break;
  }
  return pos;
}


x86 assembly (clang, -O0):
<fieldRelativePos>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1192 <fieldRelativePos+0x92>
mov    -0x10(%rbp),%rax
lea    0xed2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x4,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x1,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x5,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x7,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x6,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x2,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x3,-0x8(%rbp)
jmp    1192 <fieldRelativePos+0x92>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fieldRelativePos>:
add    $0xffffffff,%edi
mov    $0xffffffff,%eax
cmp    $0x7,%edi
ja     111a <fieldRelativePos+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @fieldRelativePos(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 -1, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %13 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
i32 8, label %12
]
5: ; preds = %1
store i32 4, i32* %3
br label %13
6: ; preds = %1
store i32 1, i32* %3
br label %13
7: ; preds = %1
store i32 5, i32* %3
br label %13
8: ; preds = %1
store i32 7, i32* %3
br label %13
9: ; preds = %1
store i32 6, i32* %3
br label %13
10: ; preds = %1
store i32 2, i32* %3
br label %13
11: ; preds = %1
store i32 3, i32* %3
br label %13
12: ; preds = %1
store i32 0, i32* %3
br label %13
13: ; preds = %1, %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@switch.table.fieldRelativePos = [8 x i32] [i32 4, i32 1, i32 5, i32 7, i32 6, i32 2, i32 3, i32 0]
define i32 @fieldRelativePos(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.fieldRelativePos, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ -1, %1 ], [ %7, %4 ]
ret i32 %9
}