xunge/DecIR huggingface dataset:
int isSame(char a, char b) {
  return ((a <= 'Z' && a >= 'A') ? (a + 32) : (a)) ==
         ((b <= 'Z' && b >= 'A') ? (b + 32) : (b));
}


x86 assembly (clang, -O0):
<isSame>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jg     1139 <isSame+0x39>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1139 <isSame+0x39>
movsbl -0x1(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <isSame+0x40>
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x5a,%eax
jg     116f <isSame+0x6f>
movsbl -0x2(%rbp),%eax
cmp    $0x41,%eax
jl     116f <isSame+0x6f>
movsbl -0x2(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1176 <isSame+0x76>
movsbl -0x2(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSame>:
lea    -0x41(%rdi),%eax
lea    0x20(%rdi),%ecx
cmp    $0x1a,%al
cmovae %edi,%ecx
lea    -0x41(%rsi),%eax
lea    0x20(%rsi),%edx
cmp    $0x1a,%al
cmovae %esi,%edx
xor    %eax,%eax
cmp    %edx,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @isSame(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp sge i32 %10, 65
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = add nsw i32 %14, 32
br label %19
16: ; preds = %8, %2
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
br label %19
19: ; preds = %16, %12
%20 = phi i32 [ %15, %12 ], [ %18, %16 ]
%21 = load i8, i8* %4
%22 = sext i8 %21 to i32
%23 = icmp sle i32 %22, 90
br i1 %23, label %24, label %32
24: ; preds = %19
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = icmp sge i32 %26, 65
br i1 %27, label %28, label %32
28: ; preds = %24
%29 = load i8, i8* %4
%30 = sext i8 %29 to i32
%31 = add nsw i32 %30, 32
br label %35
32: ; preds = %24, %19
%33 = load i8, i8* %4
%34 = sext i8 %33 to i32
br label %35
35: ; preds = %32, %28
%36 = phi i32 [ %31, %28 ], [ %34, %32 ]
%37 = icmp eq i32 %20, %36
%38 = zext i1 %37 to i32
ret i32 %38
}

LLVM IR (-O2):
define i32 @isSame(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 26
%6 = add nsw i32 %3, 32
%7 = select i1 %5, i32 %6, i32 %3
%8 = sext i8 %1 to i32
%9 = add i8 %1, -65
%10 = icmp ult i8 %9, 26
%11 = add nsw i32 %8, 32
%12 = select i1 %10, i32 %11, i32 %8
%13 = icmp eq i32 %7, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ init_map();
int /*<<< orphan*/ print_map();
int /*<<< orphan*/ scan_sections(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int main(int argc, char *argv[]) {
  init_map();
  scan_sections(stdin);
  print_map();
  exit(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 <init_map@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%edi
call   1030 <scan_sections@plt>
mov    $0x0,%al
call   1050 <print_map@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <init_map@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1030 <scan_sections@plt>
xor    %eax,%eax
call   1050 <print_map@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@stdin = global i32 0
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 (...) @init_map()
%7 = load i32, i32* @stdin
%8 = call i32 @scan_sections(i32 %7)
%9 = call i32 (...) @print_map()
%10 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@stdin = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @init_map()
%4 = load i32, i32* @stdin
%5 = tail call i32 @scan_sections(i32 %4)
%6 = tail call i32 (...) @print_map()
%7 = tail call i32 @exit(i32 0)
unreachable
}
void swap(char *a, char *b) {
  char t = *a;
  *a = *b;
  *b = t;
}


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

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

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

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
unsigned bitCount_fun_char(char x) {
  unsigned r = x & 1;
  for (x = x >> 1 & 0x7f; x; x >>= 1)
    r += x & 1;
  return r;
}


x86 assembly (clang, -O0):
<bitCount_fun_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x1,%eax
and    $0x7f,%eax
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <bitCount_fun_char+0x47>
movsbl -0x1(%rbp),%eax
and    $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    1121 <bitCount_fun_char+0x21>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitCount_fun_char>:
mov    %edi,%eax
and    $0x1,%eax
cmp    $0x2,%dil
jb     1124 <bitCount_fun_char+0x24>
mov    %edi,%ecx
nopl   (%rax)
shr    %cl
mov    %ecx,%edx
and    $0x1,%dl
movzbl %dl,%edx
add    %edx,%eax
cmp    $0x3,%dil
mov    %ecx,%edi
ja     1110 <bitCount_fun_char+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitCount_fun_char(i8 signext %0) {
%2 = and i8 %0, 1
%3 = zext i8 %2 to i32
%4 = icmp ult i8 %0, 2
br i1 %4, label %13, label %5
5: ; preds = %1, %5
%6 = phi i8 [ %8, %5 ], [ %0, %1 ]
%7 = phi i32 [ %11, %5 ], [ %3, %1 ]
%8 = lshr i8 %6, 1
%9 = and i8 %8, 1
%10 = zext i8 %9 to i32
%11 = add i32 %7, %10
%12 = icmp ult i8 %6, 4
br i1 %12, label %13, label %5
13: ; preds = %5, %1
%14 = phi i32 [ %3, %1 ], [ %11, %5 ]
ret i32 %14
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long timestart() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_usec / 1000) + (tv.tv_sec * 1000);
}


x86 assembly (clang, -O0):
<timestart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
imul   $0x3e8,-0x4(%rbp),%ecx
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timestart>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
movslq 0x4(%rsp),%rcx
imul   $0x3e8,%rcx,%rcx
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @timestart() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = sdiv i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @timestart() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int core3_safe(char const *);
int U_EMRSETICMMODE_safe(const char *record) { return (core3_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRSETICMMODE_safe>:
jmp    1030 <core3_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETICMMODE_safe(i8* %0) {
%2 = tail call i32 @core3_safe(i8* %0)
ret i32 %2
}
unsigned long msm_allocate_iova_address(unsigned int iommu_domain,
                                        unsigned int partition_no,
                                        unsigned long size,
                                        unsigned long align) {
  return 0;
}


x86 assembly (clang, -O0):
<msm_allocate_iova_address>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @msm_allocate_iova_address(i32 %0, i32 %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i32 %1, i32* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
ret i64 0
}

LLVM IR (-O2):
define i64 @msm_allocate_iova_address(i32 %0, i32 %1, i64 %2, i64 %3) {
ret i64 0
}
int test_imm_77uint16_mem(unsigned short *val) {
  return ((*val) & (0x77 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_77uint16_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, 119
%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_77uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 119
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ tolower(char);
char *strlib_tolower(char *s) {
  char *ps;
  if (s) {
    ps = s;
    while (*ps) {
      *ps = (char)tolower(*ps);
      ps++;
    }
  }
  return (s);
}


x86 assembly (clang, -O0):
<strlib_tolower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <strlib_tolower+0x56>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <strlib_tolower+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <strlib_tolower+0x1f>
jmp    1166 <strlib_tolower+0x56>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlib_tolower>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <strlib_tolower+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <strlib_tolower+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strlib_tolower+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strlib_tolower(i8* returned %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %12, %6 ], [ %4, %3 ]
%8 = phi i8* [ %11, %6 ], [ %0, %3 ]
%9 = tail call i64 @tolower(i8 signext %7)
%10 = trunc i64 %9 to i8
store i8 %10, i8* %8
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %3, %1
ret i8* %0
}
long longTest(long value) { return value; }


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

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

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

LLVM IR (-O2):
define i64 @longTest(i64 returned %0) {
ret i64 %0
}
/* Type definitions */
typedef int /*<<< orphan*/ aid;

/* Variables and functions */
unsigned short multosSendAPDU(int /*<<< orphan*/, int, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, int /*<<< orphan*/,
                              unsigned char *, int /*<<< orphan*/,
                              unsigned char *, int, int);
int multosDeselectCurrApplication() {
  unsigned char aid[] = {0x3F, 0x00};
  unsigned char La;
  unsigned short sw;
  sw = multosSendAPDU(0, 0xA4, 0, 0, 2, 0, &La, 0, aid, sizeof(aid), 100000);
  if (sw == 0x9000)
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<multosDeselectCurrApplication>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x6(%rbp),%rax
xor    %r9d,%r9d
mov    $0xa4,%esi
mov    $0x2,%r8d
lea    -0x7(%rbp),%r10
mov    %r9d,%edi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r10,(%rsp)
movl   $0x0,0x8(%rsp)
mov    %rax,0x10(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x186a0,0x20(%rsp)
call   1030 <multosSendAPDU@plt>
mov    %ax,-0xa(%rbp)
movzwl -0xa(%rbp),%eax
cmp    $0x9000,%eax
jne    1187 <multosDeselectCurrApplication+0x77>
movl   $0x1,-0x4(%rbp)
jmp    118e <multosDeselectCurrApplication+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multosDeselectCurrApplication>:
push   %rax
movw   $0x3f,0x4(%rsp)
sub    $0x8,%rsp
lea    0xc(%rsp),%rax
lea    0xf(%rsp),%r10
xor    %edi,%edi
mov    $0xa4,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x2,%r8d
xor    %r9d,%r9d
push   $0x186a0
push   $0x2
push   %rax
push   $0x0
push   %r10
call   1030 <multosSendAPDU@plt>
add    $0x30,%rsp
movzwl %ax,%ecx
xor    %eax,%eax
cmp    $0x9000,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@__const.multosDeselectCurrApplication.aid = [2 x i8] c"?\00"
define i32 @multosDeselectCurrApplication() {
%1 = alloca i32
%2 = alloca [2 x i8]
%3 = alloca i8
%4 = alloca i16
%5 = bitcast [2 x i8]* %2 to i8*
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%7 = call zeroext i16 @multosSendAPDU(i32 0, i32 164, i32 0, i32 0, i32 2, i32 0, i8* %3, i32 0, i8* %6, i32 2, i32 100000)
store i16 %7, i16* %4
%8 = load i16, i16* %4
%9 = zext i16 %8 to i32
%10 = icmp eq i32 %9, 36864
br i1 %10, label %11, label %12
11: ; preds = %0
store i32 1, i32* %1
br label %13
12: ; preds = %0
store i32 0, i32* %1
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @multosDeselectCurrApplication() {
%1 = alloca i16
%2 = alloca i8
%3 = bitcast i16* %1 to i8*
store i16 63, i16* %1
%4 = call zeroext i16 @multosSendAPDU(i32 0, i32 164, i32 0, i32 0, i32 2, i32 0, i8* %2, i32 0, i8* %3, i32 2, i32 100000)
%5 = icmp eq i16 %4, -28672
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
double log(scalar_t__);
scalar_t__ sqrt(double);
double asinh(double x) { return log(x + sqrt(x * x + 1.)); }


x86 assembly (clang, -O0):
<asinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb3(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x10(%rbp),%xmm0
cvtsi2sd %rax,%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rdi
call   1030 <log@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asinh>:
push   %rax
movsd  %xmm0,(%rsp)
mulsd  %xmm0,%xmm0
addsd  0xece(%rip),%xmm0
call   1040 <sqrt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  (%rsp),%xmm0
cvttsd2si %xmm0,%rdi
pop    %rax
jmp    1030 <log@plt>

LLVM IR (-O0):
define double @asinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = load double, double* %2
%5 = load double, double* %2
%6 = call double @llvm.fmuladd.f64(double %4, double %5, double 1.000000e+00)
%7 = call i64 @sqrt(double %6)
%8 = sitofp i64 %7 to double
%9 = fadd double %3, %8
%10 = fptosi double %9 to i64
%11 = call double @log(i64 %10)
ret double %11
}

LLVM IR (-O2):
define double @asinh(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double %0, double 1.000000e+00)
%3 = tail call i64 @sqrt(double %2)
%4 = sitofp i64 %3 to double
%5 = fadd double %4, %0
%6 = fptosi double %5 to i64
%7 = tail call double @log(i64 %6)
ret double %7
}
/* Variables and functions */
void *malloc(size_t);
void *xmalloc(size_t n) { return malloc(n); }


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

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

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

LLVM IR (-O2):
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
const char *get_fps_list(int palette) { return "8|12|16|24|25|30|50|60"; }


x86 assembly (clang, -O0):
<get_fps_list>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_fps_list>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [23 x i8] c"8|12|16|24|25|30|50|60\00"
define i8* @get_fps_list(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [23 x i8] c"8|12|16|24|25|30|50|60\00"
define i8* @get_fps_list(i32 %0) {
ret i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0)
}
int rightChild(int i) { return 2 * i + 2; }


x86 assembly (clang, -O0):
<rightChild>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightChild>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @rightChild(i32 %0) {
%2 = shl nsw i32 %0, 1
%3 = add nsw i32 %2, 2
ret i32 %3
}
/* Type definitions */
struct stat {
  scalar_t__ st_nlink;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
int md_link_count(char *fname) {
  struct stat sbuf;
  stat(fname, &sbuf);
  return ((int)sbuf.st_nlink);
}


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

x86 assembly (clang, -O2):
<md_link_count>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i32 @md_link_count(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i32 @md_link_count(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
yyerror(char *s) { printf("\nErreur "); }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"\0AErreur \00"
define i32 @yyerror(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char const);
void ft_putstr(char const *s) {
  int i;
  i = 0;
  while (s[i] != '\0') {
    ft_putchar(s[i]);
    i++;
  }
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1157 <ft_putstr+0x47>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_putchar@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ft_putstr+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <ft_putstr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <ft_putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <ft_putstr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @ft_putchar(i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int EOF;
int /*<<< orphan*/ printf(char *, int);
main() { printf("the value of EOF is %d\n", EOF); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [24 x i8] c"the value of EOF is %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"the value of EOF is %d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int get_hardware_info(char *hardware_string) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @get_hardware_info(i8* nocapture readnone %0) {
ret i32 0
}
int f2(int *a) {
  int j, res;
  for (j = 0, res = 0; j < 32; j += 4) {
    res += a[j];
  }
  return res;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    113f <f2+0x3f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <f2+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    0x10(%rdi),%eax
add    (%rdi),%eax
add    0x20(%rdi),%eax
add    0x30(%rdi),%eax
add    0x40(%rdi),%eax
add    0x50(%rdi),%eax
add    0x60(%rdi),%eax
add    0x70(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f2(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = load i32, i32* %3
%5 = add nsw i32 %4, %2
%6 = getelementptr inbounds i32, i32* %0, i64 8
%7 = load i32, i32* %6
%8 = add nsw i32 %7, %5
%9 = getelementptr inbounds i32, i32* %0, i64 12
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %8
%12 = getelementptr inbounds i32, i32* %0, i64 16
%13 = load i32, i32* %12
%14 = add nsw i32 %13, %11
%15 = getelementptr inbounds i32, i32* %0, i64 20
%16 = load i32, i32* %15
%17 = add nsw i32 %16, %14
%18 = getelementptr inbounds i32, i32* %0, i64 24
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %17
%21 = getelementptr inbounds i32, i32* %0, i64 28
%22 = load i32, i32* %21
%23 = add nsw i32 %22, %20
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ hijack_foo_intro(int, int);
int /*<<< orphan*/ hijack_foo_outro(int, int, int);
int orig_foo(int, int);
int foo(int a, int b) {
  hijack_foo_intro(a, b);
  int r = orig_foo(a, b);
  hijack_foo_outro(a, b, r);
  return r;
}


x86 assembly (clang, -O0):
<foo>:
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   1050 <hijack_foo_intro@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <orig_foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <hijack_foo_outro@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
call   1050 <hijack_foo_intro@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <orig_foo@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
mov    %eax,%edx
call   1030 <hijack_foo_outro@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = call i32 @hijack_foo_intro(i32 %6, i32 %7)
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @orig_foo(i32 %9, i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i32 @hijack_foo_outro(i32 %12, i32 %13, i32 %14)
%16 = load i32, i32* %5
ret i32 %16
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = tail call i32 @hijack_foo_intro(i32 %0, i32 %1)
%4 = tail call i32 @orig_foo(i32 %0, i32 %1)
%5 = tail call i32 @hijack_foo_outro(i32 %0, i32 %1, i32 %4)
ret i32 %4
}
/* Variables and functions */
char *read_record(int, char *, int *, int);
char *QMReadl(int fno, char *id, int wait, int *err) {
  return read_record(fno, id, err, (wait) ? 8 : 7);
}


x86 assembly (clang, -O0):
<QMReadl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x14(%rbp),%r8d
mov    $0x7,%ecx
mov    $0x8,%eax
cmp    $0x0,%r8d
cmovne %eax,%ecx
call   1030 <read_record@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QMReadl>:
cmp    $0x1,%edx
mov    $0x8,%eax
sbb    $0x0,%eax
mov    %rcx,%rdx
mov    %eax,%ecx
jmp    1030 <read_record@plt>

LLVM IR (-O0):
define i8* @QMReadl(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i32*, i32** %8
%12 = load i32, i32* %7
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 8, i32 7
%16 = call i8* @read_record(i32 %9, i8* %10, i32* %11, i32 %15)
ret i8* %16
}

LLVM IR (-O2):
define i8* @QMReadl(i32 %0, i8* %1, i32 %2, i32* %3) {
%5 = icmp eq i32 %2, 0
%6 = select i1 %5, i32 7, i32 8
%7 = tail call i8* @read_record(i32 %0, i8* %1, i32* %3, i32 %6)
ret i8* %7
}
void func_nofb_marker(void) {}


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

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

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

LLVM IR (-O2):
define void @func_nofb_marker() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_CC_SFD_PIN() { clear_io_bit(-4, 3); }


x86 assembly (clang, -O0):
<TOSH_CLR_CC_SFD_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffc,%edi
mov    $0x3,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_CC_SFD_PIN>:
mov    $0xfffffffc,%edi
mov    $0x3,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_CC_SFD_PIN() {
%1 = call i32 @clear_io_bit(i32 -4, i32 3)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_CC_SFD_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -4, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, float);
int main(void) {
  char esc = '\\';
  int i = 0;
  int limit = 100 + 1;
  float eps = 1e-2;
  float eps2 = 9e-1;
  printf("Float1: %f --- Float2: %.1f\n", eps, eps2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x5c,-0x5(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x65,-0x10(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xeba(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"Float1: %f --- Float2: %.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store i8 92, i8* %2
store i32 0, i32* %3
store i32 101, i32* %4
store float 0x3F847AE140000000, float* %5
store float 0x3FECCCCCC0000000, float* %6
%7 = load float, float* %5
%8 = load float, float* %6
%9 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float %7, float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Float1: %f --- Float2: %.1f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), float 0x3F847AE140000000, float 0x3FECCCCCC0000000)
ret i32 0
}
void TimerEventGenerate(unsigned long ulBase, unsigned long ulEventSource) {

  ;

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000014))) = ulEventSource;
}


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

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

LLVM IR (-O0):
define void @TimerEventGenerate(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 20
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerEventGenerate(i64 %0, i64 %1) {
%3 = add i64 %0, 20
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
char return_your_return(char (*c)()) { return c(); }


x86 assembly (clang, -O0):
<return_your_return>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   *-0x8(%rbp)
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<return_your_return>:
xor    %eax,%eax
jmp    *%rdi

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

LLVM IR (-O2):
define signext i8 @return_your_return(i8 (...)* nocapture %0) {
%2 = tail call signext i8 (...) %0()
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_suspend_source_by_index() {
  printf("NOT IMPLEMENTED:"
         "pa_context_suspend_source_by_index"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [52 x i8] c"NOT IMPLEMENTED:pa_context_suspend_source_by_index\0A\00"
define i32 @pa_context_suspend_source_by_index() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [51 x i8] c"NOT IMPLEMENTED:pa_context_suspend_source_by_index\00"
define i32 @pa_context_suspend_source_by_index() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
char *strpbrk(char const *, char const *);
long fortran_strpbrk_core(const char *sz, const char *charset) {
  char *cz = strpbrk(sz, charset);
  if (cz)
    return cz - sz + 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<fortran_strpbrk_core>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strpbrk@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1154 <fortran_strpbrk_core+0x44>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115c <fortran_strpbrk_core+0x4c>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fortran_strpbrk_core>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strpbrk@plt>
mov    %rax,%rcx
sub    %rbx,%rcx
add    $0x1,%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @fortran_strpbrk_core(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strpbrk(i8* %0, i8* %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 1, %6
%8 = add i64 %7, %5
%9 = select i1 %4, i64 0, i64 %8
ret i64 %9
}
/* Variables and functions */
char *corta_string(char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  char *s = "C";
  s = corta_string(s);
  printf("%s\n", s);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <corta_string@plt>
lea    0xece(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @corta_string(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
void simde_trap(void) { __asm__ __volatile__("int $03"); }


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

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

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

LLVM IR (-O2):
define void @simde_trap() {
tail call void asm sideeffect "int $$03", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long long);
int main(void) {
  printf("llu: %llx\n",
         ((1ull << (((sizeof(unsigned long long)) * 8) - 1) << 1) - 1));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"llu: %llx\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 -1)
ret i32 0
}
/* Variables and functions */
int EtatRelai(int);
int IdentifiantBoutonPlosible(int);
int retournerEtatBouton(int identifiantBouton) {
  int codeRetour = IdentifiantBoutonPlosible(identifiantBouton);
  if (codeRetour != 200) {
    return codeRetour;
  }
  return EtatRelai(identifiantBouton);
}


x86 assembly (clang, -O0):
<retournerEtatBouton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <IdentifiantBoutonPlosible@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xc8,-0xc(%rbp)
je     114e <retournerEtatBouton+0x2e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <retournerEtatBouton+0x39>
mov    -0x8(%rbp),%edi
call   1040 <EtatRelai@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<retournerEtatBouton>:
push   %rbx
mov    %edi,%ebx
call   1030 <IdentifiantBoutonPlosible@plt>
cmp    $0xc8,%eax
jne    1137 <retournerEtatBouton+0x17>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <EtatRelai@plt>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @retournerEtatBouton(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @IdentifiantBoutonPlosible(i32 %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 200
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %14
11: ; preds = %1
%12 = load i32, i32* %3
%13 = call i32 @EtatRelai(i32 %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %11, %9
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @retournerEtatBouton(i32 %0) {
%2 = tail call i32 @IdentifiantBoutonPlosible(i32 %0)
%3 = icmp eq i32 %2, 200
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @EtatRelai(i32 %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ %5, %4 ], [ %2, %1 ]
ret i32 %7
}
void isr_nmi(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<isr_nmi>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <isr_nmi+0x9>
jmp    1109 <isr_nmi+0x9>

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

LLVM IR (-O0):
define void @isr_nmi() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @isr_nmi() {
br label %1
1: ; preds = %0, %1
br label %1
}
long long func5(long long a, long long b) { return a * b; }


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

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

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

LLVM IR (-O2):
define i64 @func5(i64 %0, i64 %1) {
%3 = mul nsw i64 %1, %0
ret i64 %3
}
void __DELETE_java_lang_reflect_Method(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_lang_reflect_Method(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
unsigned short isupper(char c) { return (c >= 'A' && c <= 'Z'); }


x86 assembly (clang, -O0):
<isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isupper+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isupper>:
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define zeroext i16 @isupper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 90
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = trunc i32 %12 to i16
ret i16 %13
}

LLVM IR (-O2):
define zeroext i16 @isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i16
ret i16 %4
}
/* Variables and functions */
int /*<<< orphan*/ my_func(int);
int main() {
  my_func(4);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @my_func(i32 4)
ret i32 0
}
int test_imm_B7int32_reg(int val) { return ((val) & (0xB7 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_B7int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xb7,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B7int32_reg>:
test   $0xb7,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B7int32_reg(i32 %0) {
%2 = and i32 %0, 183
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}