xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int gera_primo();
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned int i = gera_primo();
  printf("%u\n", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @gera_primo()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void isr_int_stack_fault(long error_code) {}


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

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

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

LLVM IR (-O2):
define void @isr_int_stack_fault(i64 %0) {
ret void
}
/* Type definitions */
struct LinkedList {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LnkLstClear(struct LinkedList *);
int /*<<< orphan*/ free(struct LinkedList *);
void DestroyLinkedList(struct LinkedList *_List) {
  LnkLstClear(_List);
  free(_List);
}


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

x86 assembly (clang, -O2):
<DestroyLinkedList>:
push   %rbx
mov    %rdi,%rbx
call   1040 <LnkLstClear@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.LinkedList = type { i32 }
define void @DestroyLinkedList(%struct.LinkedList* %0) {
%2 = tail call i32 @LnkLstClear(%struct.LinkedList* %0)
%3 = tail call i32 @free(%struct.LinkedList* %0)
ret void
}
void Init_vm_stack_canary(void) {}


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

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

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

LLVM IR (-O2):
define void @Init_vm_stack_canary() {
ret void
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISSOCK(int /*<<< orphan*/);
scalar_t__ stat(char *, struct stat *);
int unary_S(char *s) {
  struct stat buf;
  if (stat(s, &buf))
    return 0;
  return S_ISSOCK(buf.st_mode);
}


x86 assembly (clang, -O0):
<unary_S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <stat@plt>
cmp    $0x0,%rax
je     114f <unary_S+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    115a <unary_S+0x3a>
mov    -0x18(%rbp),%edi
call   1030 <S_ISSOCK@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unary_S>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <unary_S+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <S_ISSOCK@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @unary_S(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %13
9: ; preds = %1
%10 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @S_ISSOCK(i32 %11)
store i32 %12, i32* %2
br label %13
13: ; preds = %9, %8
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @unary_S(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i32 @S_ISSOCK(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
int test_imm_5Fuint16_reg(unsigned short val) {
  return ((val) & (0x5F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Fuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0x5f,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_5Fuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 95
%6 = icmp ne i32 %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_5Fuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 95
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void FreeArray3D(void ***m) {
  free((char *)m[0][0]);
  free((char *)m[0]);
  free((char *)m);
}


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

x86 assembly (clang, -O2):
<FreeArray3D>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @FreeArray3D(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%4 = getelementptr inbounds i8**, i8*** %3, i64 0
%5 = load i8**, i8*** %4
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load i8***, i8**** %2
%10 = getelementptr inbounds i8**, i8*** %9, i64 0
%11 = load i8**, i8*** %10
%12 = bitcast i8** %11 to i8*
%13 = call i32 @free(i8* %12)
%14 = load i8***, i8**** %2
%15 = bitcast i8*** %14 to i8*
%16 = call i32 @free(i8* %15)
ret void
}

LLVM IR (-O2):
define void @FreeArray3D(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = bitcast i8*** %0 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @free(i8* %6)
%8 = bitcast i8*** %0 to i8*
%9 = tail call i32 @free(i8* %8)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sizes;

/* Variables and functions */
int test_loopback_all_sizes(int, int *, int);
int test_loopback_large(int fd) {
  int sizes[] = {(1024 * 4),  (5 * 1024),  (1024 * 11), (1024 * 12),
                 (1024 * 13), (1024 * 15), (1024 * 17)};
  return test_loopback_all_sizes(fd, sizes,
                                 (int)(sizeof(sizes) / sizeof((sizes)[0])));
}


x86 assembly (clang, -O0):
<test_loopback_large>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xedb(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed8(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed6(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    $0x7,%edx
call   1030 <test_loopback_all_sizes@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_loopback_large>:
sub    $0x28,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x7,%edx
call   1030 <test_loopback_all_sizes@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_loopback_large.sizes = [7 x i32] [i32 4096, i32 5120, i32 11264, i32 12288, i32 13312, i32 15360, i32 17408]
define i32 @test_loopback_large(i32 %0) {
%2 = alloca i32
%3 = alloca [7 x i32]
store i32 %0, i32* %2
%4 = bitcast [7 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [7 x i32], [7 x i32]* %3, i64 0, i64 0
%7 = call i32 @test_loopback_all_sizes(i32 %5, i32* %6, i32 7)
ret i32 %7
}

LLVM IR (-O2):
@__const.test_loopback_large.sizes = [7 x i32] [i32 4096, i32 5120, i32 11264, i32 12288, i32 13312, i32 15360, i32 17408]
define i32 @test_loopback_large(i32 %0) {
%2 = alloca [7 x i32]
%3 = bitcast [7 x i32]* %2 to i8*
%4 = getelementptr inbounds [7 x i32], [7 x i32]* %2, i64 0, i64 0
%5 = call i32 @test_loopback_all_sizes(i32 %0, i32* %4, i32 7)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *parse_value(char *);
int /*<<< orphan*/ setenv(char *, char *, int);
void set_variable(char *name, char *original, bool overwrite) {
  char *parsed;
  if (original) {
    parsed = parse_value(original);
    setenv(name, parsed + 1, overwrite);
    free(parsed);
  }
}


x86 assembly (clang, -O0):
<set_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1178 <set_variable+0x48>
mov    -0x10(%rbp),%rdi
call   1040 <parse_value@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
call   1050 <setenv@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_variable>:
test   %rsi,%rsi
je     1165 <set_variable+0x35>
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <parse_value@plt>
mov    %rax,%rbp
lea    0x1(%rax),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1050 <setenv@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
define void @set_variable(i8* %0, i8* %1, i32 %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = tail call i8* @parse_value(i8* %1)
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @setenv(i8* %0, i8* %7, i32 %2)
%9 = tail call i32 @free(i8* %6)
br label %10
10: ; preds = %5, %3
ret void
}
void LPCChannelStatusSet(unsigned long ulBase, unsigned long ulChannel,
                         unsigned long ulStatus) {
  unsigned long ulTemp;
  ;
  ;
  ;
  ulTemp =
      (*((volatile unsigned long *)(ulBase + 0x00000014 + (ulChannel * 0x10))));
  ulTemp |= ulStatus;
  (*((volatile unsigned long *)(ulBase + 0x00000014 + (ulChannel * 0x10)))) =
      ulTemp;
}


x86 assembly (clang, -O0):
<LPCChannelStatusSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    $0x14,%rax
mov    -0x10(%rbp),%rdx
shl    $0x4,%rdx
add    %rdx,%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LPCChannelStatusSet>:
shl    $0x4,%rsi
or     %rdx,0x14(%rdi,%rsi,1)
ret

LLVM IR (-O0):
define void @LPCChannelStatusSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i64, i64* %4
%9 = add i64 %8, 20
%10 = load i64, i64* %5
%11 = mul i64 %10, 16
%12 = add i64 %9, %11
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
store i64 %14, i64* %7
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = or i64 %16, %15
store i64 %17, i64* %7
%18 = load i64, i64* %7
%19 = load i64, i64* %4
%20 = add i64 %19, 20
%21 = load i64, i64* %5
%22 = mul i64 %21, 16
%23 = add i64 %20, %22
%24 = inttoptr i64 %23 to i64*
store volatile i64 %18, i64* %24
ret void
}

LLVM IR (-O2):
define void @LPCChannelStatusSet(i64 %0, i64 %1, i64 %2) {
%4 = add i64 %0, 20
%5 = shl i64 %1, 4
%6 = add i64 %4, %5
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %2
store volatile i64 %9, i64* %7
ret void
}
int iio_device_register_trigger_consumer(struct iio_dev *dev_info) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define i32 @iio_device_register_trigger_consumer(%struct.iio_dev* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ SIGINT;
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
int main(void) {
  kill(getpid(), SIGINT);
  printf("Ich lebe noch");
  sleep(2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    0x2e89(%rip),%rax
mov    (%rax),%esi
call   1050 <kill@plt>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
mov    0x2e99(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1050 <kill@plt>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1060 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [14 x i8] c"Ich lebe noch\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getpid()
%3 = load i32, i32* @SIGINT
%4 = call i32 @kill(i32 %2, i32 %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @sleep(i32 2)
ret i32 0
}

LLVM IR (-O2):
@SIGINT = global i32 0
@.str = [14 x i8] c"Ich lebe noch\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = load i32, i32* @SIGINT
%3 = tail call i32 @kill(i32 %1, i32 %2)
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @sleep(i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationSettingsBank1Handle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void StabilizationSettingsBank1Logging() {
  UAVObjLogging(StabilizationSettingsBank1Handle());
}


x86 assembly (clang, -O0):
<StabilizationSettingsBank1Logging>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <StabilizationSettingsBank1Handle@plt>
mov    %eax,%edi
call   1030 <UAVObjLogging@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<StabilizationSettingsBank1Logging>:
push   %rax
xor    %eax,%eax
call   1040 <StabilizationSettingsBank1Handle@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <UAVObjLogging@plt>

LLVM IR (-O0):
define void @StabilizationSettingsBank1Logging() {
%1 = call i32 (...) @StabilizationSettingsBank1Handle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @StabilizationSettingsBank1Logging() {
%1 = tail call i32 (...) @StabilizationSettingsBank1Handle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
void usage(void) {
  write(2, "Usage: du [-s] [name ...]\n", 26);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0x1a,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0x1a,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Usage: du [-s] [name ...]\0A\00"
define void @usage() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [27 x i8] c"Usage: du [-s] [name ...]\0A\00"
define void @usage() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26)
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int __syscall(char const *, int, int /*<<< orphan*/, int /*<<< orphan*/, int);
int chmod(const char *filename, int mode) {
  return __syscall(filename, mode, 0, 0, 15);
}


x86 assembly (clang, -O0):
<chmod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
xor    %ecx,%ecx
mov    $0xf,%r8d
mov    %ecx,%edx
call   1030 <__syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chmod>:
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0xf,%r8d
jmp    1030 <__syscall@plt>

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

LLVM IR (-O2):
define i32 @chmod(i8* %0, i32 %1) {
%3 = tail call i32 @__syscall(i8* %0, i32 %1, i32 0, i32 0, i32 15)
ret i32 %3
}
/* Variables and functions */
unsigned int num_attacks(unsigned base, unsigned max, unsigned hp, bool swarm) {
  if (!swarm)
    return base;
  return base - (base * (max - hp) / max);
}


x86 assembly (clang, -O0):
<num_attacks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1125 <num_attacks+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <num_attacks+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
imul   %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_attacks>:
test   %ecx,%ecx
je     1111 <num_attacks+0x11>
mov    %esi,%eax
sub    %edx,%eax
imul   %edi,%eax
xor    %edx,%edx
div    %esi
sub    %eax,%edi
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @num_attacks(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %3, 0
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = sub i32 %1, %2
%8 = mul i32 %7, %0
%9 = udiv i32 %8, %1
%10 = sub i32 %0, %9
br label %11
11: ; preds = %4, %6
%12 = phi i32 [ %10, %6 ], [ %0, %4 ]
ret i32 %12
}
/* Type definitions */
struct hashmap_pair {
  int dummy;
};
struct hashmap_iter {
  int dummy;
};
struct hashmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hashmap_iter_init(struct hashmap *, struct hashmap_iter *);
struct hashmap_pair *hashmap_iter_next(struct hashmap_iter *);
struct hashmap_pair *hashmap_iter_first(struct hashmap *hm,
                                        struct hashmap_iter *it) {
  hashmap_iter_init(hm, it);
  return hashmap_iter_next(it);
}


x86 assembly (clang, -O0):
<hashmap_iter_first>:
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 <hashmap_iter_init@plt>
mov    -0x10(%rbp),%rdi
call   1040 <hashmap_iter_next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashmap_iter_first>:
push   %rbx
mov    %rsi,%rbx
call   1030 <hashmap_iter_init@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <hashmap_iter_next@plt>

LLVM IR (-O0):
%struct.hashmap_pair = type { i32 }
%struct.hashmap = type { i32 }
%struct.hashmap_iter = type { i32 }
define %struct.hashmap_pair* @hashmap_iter_first(%struct.hashmap* %0, %struct.hashmap_iter* %1) {
%3 = alloca %struct.hashmap*
%4 = alloca %struct.hashmap_iter*
store %struct.hashmap* %0, %struct.hashmap** %3
store %struct.hashmap_iter* %1, %struct.hashmap_iter** %4
%5 = load %struct.hashmap*, %struct.hashmap** %3
%6 = load %struct.hashmap_iter*, %struct.hashmap_iter** %4
%7 = call i32 @hashmap_iter_init(%struct.hashmap* %5, %struct.hashmap_iter* %6)
%8 = load %struct.hashmap_iter*, %struct.hashmap_iter** %4
%9 = call %struct.hashmap_pair* @hashmap_iter_next(%struct.hashmap_iter* %8)
ret %struct.hashmap_pair* %9
}

LLVM IR (-O2):
%struct.hashmap_pair = type { i32 }
%struct.hashmap = type { i32 }
%struct.hashmap_iter = type { i32 }
define %struct.hashmap_pair* @hashmap_iter_first(%struct.hashmap* %0, %struct.hashmap_iter* %1) {
%3 = tail call i32 @hashmap_iter_init(%struct.hashmap* %0, %struct.hashmap_iter* %1)
%4 = tail call %struct.hashmap_pair* @hashmap_iter_next(%struct.hashmap_iter* %1)
ret %struct.hashmap_pair* %4
}
void __SLIC_fun_local_irq_enable_call(void) {
  { return; }
}


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

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

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

LLVM IR (-O2):
define void @__SLIC_fun_local_irq_enable_call() {
ret void
}
/* Variables and functions */
float arraySum(int, float *);
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float sum;
  float array[11] = {1.0, 5.1, 5.2, 1.3, 0.4, 9.5, 6.7, 9.8, 8.9, 2.0, 8.1};
  sum = arraySum(11, array);
  printf("¸ÃÊý×éËùÓÐÔªËØµÄºÍÎª:%.2f\n", sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x2c,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rsi
mov    $0xb,%edi
call   1040 <arraySum@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
movups 0xef1(%rip),%xmm0
movups %xmm0,0x1c(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xb,%edi
call   1040 <arraySum@plt>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [11 x float] [float 1.000000e+00, float 0x4014666660000000, float 0x4014CCCCC0000000, float 0x3FF4CCCCC0000000, float 0x3FD99999A0000000, float 9.500000e+00, float 0x401ACCCCC0000000, float 0x40239999A0000000, float 0x4021CCCCC0000000, float 2.000000e+00, float 0x4020333340000000]
@.str = [47 x i8] c"\C2\B8\C3\83\C3\8A\C3\BD\C3\97\C3\A9\C3\8B\C3\B9\C3\93\C3\90\C3\94\C2\AA\C3\8B\C3\98\C2\B5\C3\84\C2\BA\C3\8D\C3\8E\C2\AA:%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca [11 x float]
store i32 0, i32* %1
%4 = bitcast [11 x float]* %3 to i8*
%5 = getelementptr inbounds [11 x float], [11 x float]* %3, i64 0, i64 0
%6 = call float @arraySum(i32 11, float* %5)
store float %6, float* %2
%7 = load float, float* %2
%8 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), float %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [11 x float] [float 1.000000e+00, float 0x4014666660000000, float 0x4014CCCCC0000000, float 0x3FF4CCCCC0000000, float 0x3FD99999A0000000, float 9.500000e+00, float 0x401ACCCCC0000000, float 0x40239999A0000000, float 0x4021CCCCC0000000, float 2.000000e+00, float 0x4020333340000000]
@.str = [47 x i8] c"\C2\B8\C3\83\C3\8A\C3\BD\C3\97\C3\A9\C3\8B\C3\B9\C3\93\C3\90\C3\94\C2\AA\C3\8B\C3\98\C2\B5\C3\84\C2\BA\C3\8D\C3\8E\C2\AA:%.2f\0A\00"
define i32 @main() {
%1 = alloca [11 x float]
%2 = bitcast [11 x float]* %1 to i8*
%3 = getelementptr inbounds [11 x float], [11 x float]* %1, i64 0, i64 0
%4 = call float @arraySum(i32 11, float* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
unsigned short g(void) { return 0x1234; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1234,%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
mov    $0x1234,%ax
ret

LLVM IR (-O0):
define zeroext i16 @g() {
ret i16 4660
}

LLVM IR (-O2):
define zeroext i16 @g() {
ret i16 4660
}
/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_bus_error_set_errnof(void *e, int error, const char *format, ...) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_bus_error_set_errnof>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%eax
neg    %eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_bus_error_set_errnof>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_bus_error_set_errnof(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
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_bus_error_set_errnof(i8* nocapture readnone %0, i32 %1, i8* nocapture readnone %2, ...) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void count(void) {
  static int counter = 2;
  counter = counter * 2;
  printf("%d\n", counter);
}


x86 assembly (clang, -O0):
<count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0e(%rip),%eax
shl    $0x1,%eax
mov    %eax,0x2f05(%rip)
mov    0x2eff(%rip),%esi
lea    0xed0(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<count>:
mov    0x2f12(%rip),%esi
add    %esi,%esi
mov    %esi,0x2f0a(%rip)
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@count.counter = internal global i32 2
@.str = [4 x i8] c"%d\0A\00"
define void @count() {
%1 = load i32, i32* @count.counter
%2 = mul nsw i32 %1, 2
store i32 %2, i32* @count.counter
%3 = load i32, i32* @count.counter
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@count.counter = internal unnamed_addr global i32 2
@.str = [4 x i8] c"%d\0A\00"
define void @count() {
%1 = load i32, i32* @count.counter
%2 = shl nsw i32 %1, 1
store i32 %2, i32* @count.counter
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void scrollup(int times) {
  if (times > 0)
    printf("\e["
           "%dS",
           times);
}


x86 assembly (clang, -O0):
<scrollup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1134 <scrollup+0x24>
mov    -0x4(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scrollup>:
test   %edi,%edi
jle    1122 <scrollup+0x12>
mov    %edi,%esi
lea    0xee3(%rip),%rdi
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dS\00"
define void @scrollup(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
adrreg0adrx1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{
  if ((p0[10000000]) <= (((short *)(11111111 & ~(__alignof__(short) - 1)))[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrreg0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movswl 0x1312d00(%rax),%eax
movslq -0x10(%rbp),%rdx
mov    $0xa98ac6,%ecx
movswl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114b <adrreg0adrx1+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1152 <adrreg0adrx1+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrreg0adrx1>:
movzwl 0x1312d00(%r8),%edx
01
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac6(%rcx,%rcx,1),%dx
setle  %al
ret

LLVM IR (-O0):
define i32 @adrreg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* %4, i16* %5) {
%7 = alloca i32
%8 = alloca i16
%9 = alloca i16
%10 = alloca i32
%11 = alloca i32
%12 = alloca i16*
%13 = alloca i16*
%14 = trunc i32 %0 to i16
%15 = trunc i32 %1 to i16
store i16 %14, i16* %8
store i16 %15, i16* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i16* %4, i16** %12
store i16* %5, i16** %13
%16 = load i16*, i16** %12
%17 = getelementptr inbounds i16, i16* %16, i64 10000000
%18 = load i16, i16* %17
%19 = sext i16 %18 to i32
%20 = load i32, i32* %11
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i16, i16* inttoptr (i64 11111110 to i16*), i64 %21
%23 = load i16, i16* %22
%24 = sext i16 %23 to i32
%25 = icmp sle i32 %19, %24
br i1 %25, label %26, label %27
26: ; preds = %6
store i32 1, i32* %7
br label %28
27: ; preds = %6
store i32 0, i32* %7
br label %28
28: ; preds = %27, %26
%29 = load i32, i32* %7
ret i32 %29
}

LLVM IR (-O2):
define i32 @adrreg0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture readnone %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* inttoptr (i64 11111110 to i16*), i64 %9
%11 = load i16, i16* %10
%12 = icmp sle i16 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
long f5(long a) { return a & 0x0000ffffL; }


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

x86 assembly (clang, -O2):
<f5>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i64 @f5(i64 %0) {
%2 = and i64 %0, 65535
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void error(const char *msg) { printf("FW LOGGER ERROR: %s\r\n", msg); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"FW LOGGER ERROR: %s\0D\0A\00"
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"FW LOGGER ERROR: %s\0D\0A\00"
define void @error(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
AR0AR1(r0, r1, x0, x1, p0, p1) double r0, r1;
double *p0, *p1;
{
  if ((p0[10000000]) <= (p1[1111111 / 4]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0AR1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsd  0x4c4b400(%rax),%xmm1
04
mov    -0x30(%rbp),%rax
movsd  0x21e888(%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     114a <AR0AR1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <AR0AR1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0AR1>:
movsd  0x21e888(%rcx),%xmm0
xor    %eax,%eax
ucomisd 0x4c4b400(%rdx),%xmm0
04
setae  %al
ret

LLVM IR (-O0):
define i32 @AR0AR1(double %0, double %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca i32
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
store double %0, double* %8
store double %1, double* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store double* %4, double** %12
store double* %5, double** %13
%14 = load double*, double** %12
%15 = getelementptr inbounds double, double* %14, i64 10000000
%16 = load double, double* %15
%17 = load double*, double** %13
%18 = getelementptr inbounds double, double* %17, i64 277777
%19 = load double, double* %18
%20 = fcmp ole double %16, %19
br i1 %20, label %21, label %22
21: ; preds = %6
store i32 1, i32* %7
br label %23
22: ; preds = %6
store i32 0, i32* %7
br label %23
23: ; preds = %22, %21
%24 = load i32, i32* %7
ret i32 %24
}

LLVM IR (-O2):
define i32 @AR0AR1(double %0, double %1, i32 %2, i32 %3, double* nocapture %4, double* nocapture %5) {
%7 = getelementptr inbounds double, double* %4, i64 10000000
%8 = load double, double* %7
%9 = getelementptr inbounds double, double* %5, i64 277777
%10 = load double, double* %9
%11 = fcmp ole double %8, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
int test_int_9(int a, int b, int c, int d, int e, int f, int g, int h, int i) {
  return -2482;
}


x86 assembly (clang, -O0):
<test_int_9>:
push   %rbp
mov    %rsp,%rbp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0xfffff64e,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_int_9(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 %0, i32* %10
store i32 %1, i32* %11
store i32 %2, i32* %12
store i32 %3, i32* %13
store i32 %4, i32* %14
store i32 %5, i32* %15
store i32 %6, i32* %16
store i32 %7, i32* %17
store i32 %8, i32* %18
ret i32 -2482
}

LLVM IR (-O2):
define i32 @test_int_9(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8) {
ret i32 -2482
}
/* Variables and functions */
int fifo_write(char *);
int fifo_quit() { return fifo_write("quit\n"); }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"quit\0A\00"
define i32 @fifo_quit() {
%1 = call i32 @fifo_write(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"quit\0A\00"
define i32 @fifo_quit() {
%1 = tail call i32 @fifo_write(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int ice_cmp_float(const void *a, const void *b) {
  double ia = *(float *)a;
  double ib = *(float *)b;
  if (ia < ib)
    return -1;
  if (ia > ib)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<ice_cmp_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    114e <ice_cmp_float+0x4e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <ice_cmp_float+0x71>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    116a <ice_cmp_float+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1171 <ice_cmp_float+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ice_cmp_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ice_cmp_float(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to float*
%10 = load float, float* %9
%11 = fpext float %10 to double
store double %11, double* %6
%12 = load i8*, i8** %5
%13 = bitcast i8* %12 to float*
%14 = load float, float* %13
%15 = fpext float %14 to double
store double %15, double* %7
%16 = load double, double* %6
%17 = load double, double* %7
%18 = fcmp olt double %16, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %26
20: ; preds = %2
%21 = load double, double* %6
%22 = load double, double* %7
%23 = fcmp ogt double %21, %22
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 1, i32* %3
br label %26
25: ; preds = %20
store i32 0, i32* %3
br label %26
26: ; preds = %25, %24, %19
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @ice_cmp_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int media(int *, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int vet[5] = {4, 2, 1, 6, 7};
  printf("%d", media(vet, 5));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecc(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1040 <media@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xee6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xecb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1040 <media@plt>
lea    0xec7(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.vet = [5 x i32] [i32 4, i32 2, i32 1, i32 6, i32 7]
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @media(i32* %3, i32 5)
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void *thread_routine(void *restrict arg) { return arg; }


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

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

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

LLVM IR (-O2):
define i8* @thread_routine(i8* noalias readnone returned %0) {
ret i8* %0
}
int baz(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @baz() {
ret i32 0
}
void __attribute__((destructor)) final() {
  printf("%s [%s]\n", __func__, "destructor");
}


x86 assembly (clang, -O0):
<final>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xee7(%rip),%rsi
lea    0xee6(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<final>:
lea    0xee9(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xeea(%rip),%rdx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.final = [6 x i8] c"final\00"
@.str.1 = [11 x i8] c"destructor\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @final, i8* null }]
define void @final() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.final, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"%s [%s]\0A\00"
@__func__.final = [6 x i8] c"final\00"
@.str.1 = [11 x i8] c"destructor\00"
@llvm.global_dtors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @final, i8* null }]
define void @final() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @__func__.final, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int umbrellaHeaderFlat() {
  int a = 5;
  int b = a;
  a = b;
  return a;
}


x86 assembly (clang, -O0):
<umbrellaHeaderFlat>:
push   %rbp
mov    %rsp,%rbp
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @umbrellaHeaderFlat() {
ret i32 5
}
void kvm_pmu_vcpu_reset(struct kvm_vcpu *vcpu) {}


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

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

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

LLVM IR (-O2):
%struct.kvm_vcpu = type opaque
define void @kvm_pmu_vcpu_reset(%struct.kvm_vcpu* nocapture %0) {
ret void
}
void make_packet() {}


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

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

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

LLVM IR (-O2):
define void @make_packet() {
ret void
}
/* Variables and functions */
int AMI_Up_RegisterBit8(void *, int, int);
int AMI_DRDY_Enable(void *i2c_hnd) {
  return AMI_Up_RegisterBit8(i2c_hnd, 0x1c, 0x08);
}


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

x86 assembly (clang, -O2):
<AMI_DRDY_Enable>:
mov    $0x1c,%esi
mov    $0x8,%edx
jmp    1030 <AMI_Up_RegisterBit8@plt>

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

LLVM IR (-O2):
define i32 @AMI_DRDY_Enable(i8* %0) {
%2 = tail call i32 @AMI_Up_RegisterBit8(i8* %0, i32 28, i32 8)
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ int16_t;

/* Variables and functions */
int16_t constrain(int16_t high, int16_t low, int16_t value) {
  if (value > high)
    value = high;
  if (value < low)
    value = low;
  return value;
}


x86 assembly (clang, -O0):
<constrain>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jle    1126 <constrain+0x26>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    113c <constrain+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @constrain(i64 %0, i64 %1, i64 %2) {
%4 = icmp sgt i64 %2, %0
%5 = select i1 %4, i64 %0, i64 %2
%6 = icmp slt i64 %5, %1
%7 = select i1 %6, i64 %1, i64 %5
ret i64 %7
}