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

/* Variables and functions */
int UINT32_C(int);
uint32_t midr_get_implementer(uint32_t midr) {
  return (midr & UINT32_C(0xFF000000)) >> 24;
}


x86 assembly (clang, -O0):
<midr_get_implementer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0xff000000,%edi
call   1030 <UINT32_C@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
sar    $0x18,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<midr_get_implementer>:
push   %rbx
mov    %edi,%ebx
mov    $0xff000000,%edi
call   1030 <UINT32_C@plt>
and    %ebx,%eax
sar    $0x18,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @midr_get_implementer(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @UINT32_C(i32 -16777216)
%5 = and i32 %3, %4
%6 = ashr i32 %5, 24
ret i32 %6
}

LLVM IR (-O2):
define i32 @midr_get_implementer(i32 %0) {
%2 = tail call i32 @UINT32_C(i32 -16777216)
%3 = and i32 %2, %0
%4 = ashr i32 %3, 24
ret i32 %4
}
int str_in_list(const char *list[], char *str) {
  int i = 0;
  while (list[i] != '\0') {
    if (strcmp(list[i], str) == 0) {
      return 1;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<str_in_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1172 <str_in_list+0x62>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    1164 <str_in_list+0x54>
movl   $0x1,-0x4(%rbp)
jmp    1179 <str_in_list+0x69>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1127 <str_in_list+0x17>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_in_list>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbp
mov    (%rdi),%rdi
xor    %r14d,%r14d
test   %rdi,%rdi
je     1151 <str_in_list+0x41>
mov    %rsi,%rbx
add    $0x8,%rbp
nopl   0x0(%rax)
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     114b <str_in_list+0x3b>
mov    0x0(%rbp),%rdi
add    $0x8,%rbp
test   %rdi,%rdi
jne    1130 <str_in_list+0x20>
jmp    1151 <str_in_list+0x41>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @str_in_list(i8** nocapture %0, i8* nocapture %1) {
%3 = load i8*, i8** %0
%4 = icmp eq i8* %3, null
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8*, i8** %0, i64 %14
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %15, label %9
9: ; preds = %2, %5
%10 = phi i64 [ %14, %5 ], [ 0, %2 ]
%11 = phi i8* [ %7, %5 ], [ %3, %2 ]
%12 = tail call i32 @strcmp(i8* %11, i8* dereferenceable(1) %1)
%13 = icmp eq i32 %12, 0
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %5
15: ; preds = %9, %5, %2
%16 = phi i32 [ 0, %2 ], [ 0, %5 ], [ 1, %9 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ irc_quit();
int /*<<< orphan*/ puts(char *);
void handle_SIGINT(int sig) {
  (void)sig;
  puts("Exiting...");
  irc_quit();
}


x86 assembly (clang, -O0):
<handle_SIGINT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <irc_quit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_SIGINT>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <irc_quit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Exiting...\00"
define void @handle_SIGINT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @irc_quit()
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Exiting...\00"
define void @handle_SIGINT(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @irc_quit()
ret void
}
int test_imm_26uint8_mem(unsigned char *val) {
  return ((*val) & (-0x26 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_26uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -38
%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_26uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -38
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void crypto_alloc_aead(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<crypto_alloc_aead>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_alloc_aead>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.crypto_alloc_aead = [18 x i8] c"crypto_alloc_aead\00"
define void @crypto_alloc_aead() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.crypto_alloc_aead, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.crypto_alloc_aead = [18 x i8] c"crypto_alloc_aead\00"
define void @crypto_alloc_aead() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @__func__.crypto_alloc_aead, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pt_decoder {
  int dummy;
};

/* Variables and functions */
int header_psb(struct pt_decoder *);
int read_psb_header(struct pt_decoder *);
int decode_psb(struct pt_decoder *decoder) {
  int errcode;
  errcode = header_psb(decoder);
  if (errcode < 0)
    return errcode;
  errcode = read_psb_header(decoder);
  if (errcode < 0)
    return errcode;
  return 0;
}


x86 assembly (clang, -O0):
<decode_psb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <header_psb@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    114d <decode_psb+0x2d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <decode_psb+0x55>
mov    -0x10(%rbp),%rdi
call   1030 <read_psb_header@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    116e <decode_psb+0x4e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <decode_psb+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_psb>:
push   %rbx
mov    %rdi,%rbx
call   1040 <header_psb@plt>
test   %eax,%eax
js     113c <decode_psb+0x1c>
mov    %rbx,%rdi
call   1030 <read_psb_header@plt>
mov    %eax,%ecx
sar    $0x1f,%eax
and    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.pt_decoder = type { i32 }
define i32 @decode_psb(%struct.pt_decoder* %0) {
%2 = alloca i32
%3 = alloca %struct.pt_decoder*
%4 = alloca i32
store %struct.pt_decoder* %0, %struct.pt_decoder** %3
%5 = load %struct.pt_decoder*, %struct.pt_decoder** %3
%6 = call i32 @header_psb(%struct.pt_decoder* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = load i32, i32* %4
store i32 %10, i32* %2
br label %19
11: ; preds = %1
%12 = load %struct.pt_decoder*, %struct.pt_decoder** %3
%13 = call i32 @read_psb_header(%struct.pt_decoder* %12)
store i32 %13, i32* %4
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = load i32, i32* %4
store i32 %17, i32* %2
br label %19
18: ; preds = %11
store i32 0, i32* %2
br label %19
19: ; preds = %18, %16, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
%struct.pt_decoder = type { i32 }
define i32 @decode_psb(%struct.pt_decoder* %0) {
%2 = tail call i32 @header_psb(%struct.pt_decoder* %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @read_psb_header(%struct.pt_decoder* %0)
%6 = icmp slt i32 %5, 0
%7 = select i1 %6, i32 %5, i32 0
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ %2, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void f4(void) { puts("\nf4"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\0Af4\00"
define void @f4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void test1(int param1, int param2, int x) {
  if (param1)
    x = 3;
  if (param2)
    if (x != 3)
      link_error();
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1132 <test1+0x22>
movl   $0x3,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1152 <test1+0x42>
cmpl   $0x3,-0xc(%rbp)
je     114d <test1+0x3d>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    1152 <test1+0x42>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
test   %esi,%esi
je     1124 <test1+0x14>
test   %edi,%edi
jne    1124 <test1+0x14>
cmp    $0x3,%edx
je     1124 <test1+0x14>
xor    %eax,%eax
jmp    1030 <link_error@plt>
ret

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

LLVM IR (-O2):
define void @test1(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 0
%5 = icmp ne i32 %1, 0
%6 = icmp ne i32 %2, 3
%7 = and i1 %4, %6
%8 = and i1 %5, %7
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = tail call i32 (...) @link_error()
br label %11
11: ; preds = %9, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Welcome();
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int main(int argc, char **argv) {
  Welcome();
  FILE *P8_12Console =
      popen("echo high > /sys/class/gpio/gpio44/direction", "w");
  fclose(P8_12Console);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <Welcome@plt>
lea    0xeb3(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <Welcome@plt>
lea    0xec1(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1040 <popen@plt>
mov    %rax,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [45 x i8] c"echo high > /sys/class/gpio/gpio44/direction\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (...) @Welcome()
%7 = call i32* @popen(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @fclose(i32* %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"echo high > /sys/class/gpio/gpio44/direction\00"
@.str.1 = [2 x i8] c"w\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @Welcome()
%4 = tail call i32* @popen(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @fclose(i32* %4)
ret i32 0
}
void arr_float_sum(float *pfSum, float *pSrc, unsigned long int num,
                   unsigned long int stride) {
  unsigned short int i;
  float fSum = 0;
  for (i = 0; i < num; i++) {
    fSum += pSrc[i * stride];
  }
  *pfSum = fSum;
}


x86 assembly (clang, -O0):
<arr_float_sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x28(%rbp)
movw   $0x0,-0x22(%rbp)
movzwl -0x22(%rbp),%eax
cmp    -0x18(%rbp),%rax
jae    115d <arr_float_sum+0x5d>
mov    -0x10(%rbp),%rax
movzwl -0x22(%rbp),%ecx
imul   -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
addss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x28(%rbp)
mov    -0x22(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x22(%rbp)
jmp    1122 <arr_float_sum+0x22>
movss  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<arr_float_sum>:
test   %rdx,%rdx
je     1139 <arr_float_sum+0x39>
shl    $0x2,%rcx
xorps  %xmm0,%xmm0
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
addss  (%rsi),%xmm0
movzwl %ax,%r8d
add    %rcx,%rsi
add    $0x1,%rax
cmp    %rdx,%r8
jb     1120 <arr_float_sum+0x20>
movss  %xmm0,(%rdi)
ret
xorps  %xmm0,%xmm0
movss  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @arr_float_sum(float* %0, float* %1, i64 %2, i64 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i16
%10 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
store float 0.000000e+00, float* %10
store i16 0, i16* %9
br label %11
11: ; preds = %26, %4
%12 = load i16, i16* %9
%13 = zext i16 %12 to i64
%14 = load i64, i64* %7
%15 = icmp ult i64 %13, %14
br i1 %15, label %16, label %29
16: ; preds = %11
%17 = load float*, float** %6
%18 = load i16, i16* %9
%19 = zext i16 %18 to i64
%20 = load i64, i64* %8
%21 = mul i64 %19, %20
%22 = getelementptr inbounds float, float* %17, i64 %21
%23 = load float, float* %22
%24 = load float, float* %10
%25 = fadd float %24, %23
store float %25, float* %10
br label %26
26: ; preds = %16
%27 = load i16, i16* %9
%28 = add i16 %27, 1
store i16 %28, i16* %9
br label %11
29: ; preds = %11
%30 = load float, float* %10
%31 = load float*, float** %5
store float %30, float* %31
ret void
}

LLVM IR (-O2):
define void @arr_float_sum(float* nocapture writeonly %0, float* nocapture %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %2, 0
br i1 %5, label %16, label %6
6: ; preds = %4, %6
%7 = phi i64 [ %13, %6 ], [ 0, %4 ]
%8 = phi float [ %12, %6 ], [ 0.000000e+00, %4 ]
%9 = mul i64 %7, %3
%10 = getelementptr inbounds float, float* %1, i64 %9
%11 = load float, float* %10
%12 = fadd float %8, %11
%13 = add i64 %7, 1
%14 = and i64 %13, 65535
%15 = icmp ult i64 %14, %2
br i1 %15, label %6, label %16
16: ; preds = %6, %4
%17 = phi float [ 0.000000e+00, %4 ], [ %12, %6 ]
store float %17, float* %0
ret void
}
int ubifs_debugging_init(struct ubifs_info *c) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.ubifs_info = type opaque
define i32 @ubifs_debugging_init(%struct.ubifs_info* nocapture readnone %0) {
ret i32 0
}
int wilink_rxbuf_alloc() {
  int i = 0;
  i = i + 1;
  return 0;
}


x86 assembly (clang, -O0):
<wilink_rxbuf_alloc>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @wilink_rxbuf_alloc() {
ret i32 0
}
/* Variables and functions */
unsigned trans(unsigned row, unsigned col, size_t board_height) {
  return row * board_height + col;
}


x86 assembly (clang, -O0):
<trans>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x10(%rbp),%rax
mov    -0x8(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<trans>:
imul   %edi,%edx
lea    (%rdx,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @trans(i32 %0, i32 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
store i32 %0, i32* %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
%9 = load i64, i64* %6
%10 = mul i64 %8, %9
%11 = load i32, i32* %5
%12 = zext i32 %11 to i64
%13 = add i64 %10, %12
%14 = trunc i64 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
define i32 @trans(i32 %0, i32 %1, i64 %2) {
%4 = trunc i64 %2 to i32
%5 = mul i32 %4, %0
%6 = add i32 %5, %1
ret i32 %6
}
void __attribute__((__warning__(
    "curl_easy_setopt expects a curl_ioctl_callback argument for this option")))
__attribute__((__unused__)) __attribute__((__no__))
_curl_easy_setopt_err_ioctl_cb(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_ioctl_cb() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct utmpx {
  int dummy;
};
struct utmp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __updwtmp(char const *, struct utmp const *);
void __updwtmpx(const char *wtmpx_file, const struct utmpx *utmpx) {
  __updwtmp(wtmpx_file, (const struct utmp *)utmpx);
}


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

x86 assembly (clang, -O2):
<__updwtmpx>:
jmp    1030 <__updwtmp@plt>

LLVM IR (-O0):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @__updwtmpx(i8* %0, %struct.utmpx* %1) {
%3 = alloca i8*
%4 = alloca %struct.utmpx*
store i8* %0, i8** %3
store %struct.utmpx* %1, %struct.utmpx** %4
%5 = load i8*, i8** %3
%6 = load %struct.utmpx*, %struct.utmpx** %4
%7 = bitcast %struct.utmpx* %6 to %struct.utmp*
%8 = call i32 @__updwtmp(i8* %5, %struct.utmp* %7)
ret void
}

LLVM IR (-O2):
%struct.utmpx = type { i32 }
%struct.utmp = type { i32 }
define void @__updwtmpx(i8* %0, %struct.utmpx* %1) {
%3 = bitcast %struct.utmpx* %1 to %struct.utmp*
%4 = tail call i32 @__updwtmp(i8* %0, %struct.utmp* %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int CHAR_BIT;
int ffsll(unsigned long long x) {
  for (unsigned i = 0; i < sizeof(x) * CHAR_BIT; i++)
    if ((x >> i) & 1)
      return i + 1;
  return 0;
}


x86 assembly (clang, -O0):
<ffsll>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ec7(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x3,%rcx
cmp    %rcx,%rax
jae    1162 <ffsll+0x62>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shr    %cl,%rax
and    $0x1,%rax
cmp    $0x0,%rax
je     114f <ffsll+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1169 <ffsll+0x69>
jmp    1154 <ffsll+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <ffsll+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffsll>:
mov    0x2ed9(%rip),%rax
movslq (%rax),%rcx
test   %rcx,%rcx
je     112e <ffsll+0x2e>
shl    $0x3,%rcx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
bt     %rax,%rdi
jb     1131 <ffsll+0x31>
add    $0x1,%eax
cmp    %rax,%rcx
ja     1120 <ffsll+0x20>
xor    %eax,%eax
ret
add    $0x1,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @ffsll(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 0, i32* %4
br label %5
5: ; preds = %23, %1
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = load i32, i32* @CHAR_BIT
%9 = sext i32 %8 to i64
%10 = mul i64 8, %9
%11 = icmp ult i64 %7, %10
br i1 %11, label %12, label %26
12: ; preds = %5
%13 = load i64, i64* %3
%14 = load i32, i32* %4
%15 = zext i32 %14 to i64
%16 = lshr i64 %13, %15
%17 = and i64 %16, 1
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %4
%21 = add i32 %20, 1
store i32 %21, i32* %2
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add i32 %24, 1
store i32 %25, i32* %4
br label %5
26: ; preds = %5
store i32 0, i32* %2
br label %27
27: ; preds = %26, %19
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @ffsll(i64 %0) {
%2 = load i32, i32* @CHAR_BIT
%3 = sext i32 %2 to i64
%4 = shl nsw i64 %3, 3
%5 = icmp eq i32 %2, 0
br i1 %5, label %18, label %6
6: ; preds = %1, %14
%7 = phi i64 [ %16, %14 ], [ 0, %1 ]
%8 = shl nuw i64 1, %7
%9 = and i64 %8, %0
%10 = icmp eq i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %6
%12 = trunc i64 %7 to i32
%13 = add i32 %12, 1
br label %18
14: ; preds = %6
%15 = add nuw nsw i64 %7, 1
%16 = and i64 %15, 4294967295
%17 = icmp ugt i64 %4, %16
br i1 %17, label %6, label %18
18: ; preds = %14, %1, %11
%19 = phi i32 [ %13, %11 ], [ 0, %1 ], [ 0, %14 ]
ret i32 %19
}
main() { printf(&1 ["\021%six\012\0"], (1)["have"] + "fun" - 0x60); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movsbl 0xeee(%rip),%eax
cltq
lea    0xee9(%rip),%rsi
add    %rax,%rsi
add    $0xffffffffffffffa0,%rsi
lea    0xece(%rip),%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"\11%six\0A\00\00"
@.str.1 = [5 x i8] c"have\00"
@.str.2 = [4 x i8] c"fun\00"
define i32 @main() {
%1 = load i8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 1)
%2 = sext i8 %1 to i32
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -96
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1), i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"\11%six\0A\00\00"
@.str.2 = [4 x i8] c"fun\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 1), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1))
ret i32 0
}
int test_imm_23int16_mem(short *val) {
  return ((*val) & (-0x23 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_23int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -35
%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_23int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -35
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void std_free(void *p) { free(p); }


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

x86 assembly (clang, -O2):
<std_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @std_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int system(char *);
int not_called() { return system("/bin/bash"); }


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

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

LLVM IR (-O0):
@.str = [10 x i8] c"/bin/bash\00"
define i32 @not_called() {
%1 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [10 x i8] c"/bin/bash\00"
define i32 @not_called() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() { puts("Hello puts"); }


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"Hello puts\00"
define i32 @main() {
%1 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Hello puts\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int forbidden(char *url) {
  if (strstr(url, "/../"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<forbidden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1142 <forbidden+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <forbidden+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forbidden>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"/../\00"
define i32 @forbidden(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
void *_kmalloc(unsigned int, int, unsigned int *);
void *kmalloc_ap(unsigned size, unsigned *phys) {
  return _kmalloc(size, 1, phys);
}


x86 assembly (clang, -O0):
<kmalloc_ap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <_kmalloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kmalloc_ap>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <_kmalloc@plt>

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

LLVM IR (-O2):
define i8* @kmalloc_ap(i32 %0, i32* %1) {
%3 = tail call i8* @_kmalloc(i32 %0, i32 1, i32* %1)
ret i8* %3
}
/* Variables and functions */
char *copy(char *, char *);
char *off_name(char *file) { return (copy(file, "-o")); }


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

x86 assembly (clang, -O2):
<off_name>:
lea    0xee9(%rip),%rsi
jmp    1030 <copy@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"-o\00"
define i8* @off_name(i8* %0) {
%2 = tail call i8* @copy(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i8* %2
}
void IntProtectionDisable(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x4c)))) &= ~(0x00000001u);
}


x86 assembly (clang, -O0):
<IntProtectionDisable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4820004c,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0x4820004c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntProtectionDisable>:
andl   $0xfffffffe,0x4820004c
fe
ret

LLVM IR (-O0):
define void @IntProtectionDisable() {
%1 = load volatile i32, i32* inttoptr (i64 1210056780 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1210056780 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntProtectionDisable() {
%1 = load volatile i32, i32* inttoptr (i64 1210056780 to i32*)
%2 = and i32 %1, -2
store volatile i32 %2, i32* inttoptr (i64 1210056780 to i32*)
ret void
}
/* Type definitions */
struct battle_char {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ add_status(struct battle_char *, int);
scalar_t__ get_random(int /*<<< orphan*/, int);
scalar_t__ mod6(struct battle_char *, struct battle_char *, int);
void carbunkle(struct battle_char *origin, struct battle_char *target) {
  if (get_random(0, 100) < mod6(origin, target, 150))
    add_status(target, 25);
}


x86 assembly (clang, -O0):
<carbunkle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x96,%edx
call   1040 <mod6@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
jge    1180 <carbunkle+0x50>
mov    -0x10(%rbp),%rdi
mov    $0x19,%esi
call   1050 <add_status@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<carbunkle>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %edi,%edi
mov    $0x64,%esi
call   1030 <get_random@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x96,%edx
call   1040 <mod6@plt>
cmp    %rax,%rbx
jge    1171 <carbunkle+0x41>
mov    %r14,%rdi
mov    $0x19,%esi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <add_status@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.battle_char = type { i32 }
define void @carbunkle(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = alloca %struct.battle_char*
%4 = alloca %struct.battle_char*
store %struct.battle_char* %0, %struct.battle_char** %3
store %struct.battle_char* %1, %struct.battle_char** %4
%5 = call i64 @get_random(i32 0, i32 100)
%6 = load %struct.battle_char*, %struct.battle_char** %3
%7 = load %struct.battle_char*, %struct.battle_char** %4
%8 = call i64 @mod6(%struct.battle_char* %6, %struct.battle_char* %7, i32 150)
%9 = icmp slt i64 %5, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load %struct.battle_char*, %struct.battle_char** %4
%12 = call i32 @add_status(%struct.battle_char* %11, i32 25)
br label %13
13: ; preds = %10, %2
ret void
}

LLVM IR (-O2):
%struct.battle_char = type { i32 }
define void @carbunkle(%struct.battle_char* %0, %struct.battle_char* %1) {
%3 = tail call i64 @get_random(i32 0, i32 100)
%4 = tail call i64 @mod6(%struct.battle_char* %0, %struct.battle_char* %1, i32 150)
%5 = icmp slt i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @add_status(%struct.battle_char* %1, i32 25)
br label %8
8: ; preds = %6, %2
ret void
}
/* Variables and functions */
double exp(double);
double Bbp3a(double x) { return 1.0 - exp(-x); }


x86 assembly (clang, -O0):
<Bbp3a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xeb7(%rip),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bbp3a>:
push   %rax
xorpd  0xee7(%rip),%xmm0
call   1030 <exp@plt>
movsd  0xeea(%rip),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @Bbp3a(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call double @exp(double %4)
%6 = fsub double 1.000000e+00, %5
ret double %6
}

LLVM IR (-O2):
define double @Bbp3a(double %0) {
%2 = fneg double %0
%3 = tail call double @exp(double %2)
%4 = fsub double 1.000000e+00, %3
ret double %4
}
/* Variables and functions */
int __builtin_wasm_trunc_u_i32_f32(float);
int trunc_u_i32_f32(float f) { return __builtin_wasm_trunc_u_i32_f32(f); }


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

x86 assembly (clang, -O2):
<trunc_u_i32_f32>:
jmp    1030 <__builtin_wasm_trunc_u_i32_f32@plt>

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

LLVM IR (-O2):
define i32 @trunc_u_i32_f32(float %0) {
%2 = tail call i32 @__builtin_wasm_trunc_u_i32_f32(float %0)
ret i32 %2
}
/* Variables and functions */
int delete (int /*<<< orphan*/);
int delete_first() { return delete (0); }


x86 assembly (clang, -O0):
<delete_first>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <delete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_first>:
xor    %edi,%edi
jmp    1030 <delete@plt>

LLVM IR (-O0):
define i32 @delete_first() {
%1 = call i32 @delete(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @delete_first() {
%1 = tail call i32 @delete(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ seterr(char *, char *);
char *null_PCAP_LOOKUPDEV(char *errbuf) {
  seterr(errbuf, "libpcap not loaded");
  return "";
}


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

x86 assembly (clang, -O2):
<null_PCAP_LOOKUPDEV>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <seterr@plt>
lea    0xeee(%rip),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"libpcap not loaded\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @null_PCAP_LOOKUPDEV(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @seterr(i8* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"libpcap not loaded\00"
@.str.1 = [1 x i8] zeroinitializer
define i8* @null_PCAP_LOOKUPDEV(i8* %0) {
%2 = tail call i32 @seterr(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ usart3_putc(char);
void task1(void) {
  while (1) {
    usart3_putc('A');
  }
}


x86 assembly (clang, -O0):
<task1>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <task1+0x9>
mov    $0x41,%edi
call   1030 <usart3_putc@plt>
jmp    1119 <task1+0x9>

x86 assembly (clang, -O2):
<task1>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x41,%edi
call   1030 <usart3_putc@plt>
jmp    1120 <task1+0x10>

LLVM IR (-O0):
define void @task1() {
br label %1
1: ; preds = %0, %1
%2 = call i32 @usart3_putc(i8 signext 65)
br label %1
}

LLVM IR (-O2):
define void @task1() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 @usart3_putc(i8 signext 65)
br label %1
}
double dmnsn_max(double a, double b) { return a > b ? a : b; }


x86 assembly (clang, -O0):
<dmnsn_max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    112d <dmnsn_max+0x2d>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1137 <dmnsn_max+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmnsn_max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dmnsn_max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp ogt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dmnsn_max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
scalar_t__ fcntl(int, int /*<<< orphan*/, ...);
int set_flag(int fd, int flag) {
  int org_flag = fcntl(fd, F_GETFL);
  org_flag |= flag;
  if (fcntl(fd, F_SETFL, org_flag) < 0) {
    return -1;
  }
  return org_flag;
}


x86 assembly (clang, -O0):
<set_flag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1030 <fcntl@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%edx
mov    $0x0,%al
call   1030 <fcntl@plt>
cmp    $0x0,%rax
jge    1169 <set_flag+0x59>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <set_flag+0x5f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_flag>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
call   1030 <fcntl@plt>
mov    %rax,%rbx
or     %r14d,%ebx
mov    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    %ebp,%edi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <fcntl@plt>
test   %rax,%rax
mov    $0xffffffff,%eax
cmovns %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @set_flag(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = load i32, i32* @F_GETFL
%9 = call i64 (i32, i32, ...) @fcntl(i32 %7, i32 %8)
%10 = trunc i64 %9 to i32
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = or i32 %12, %11
store i32 %13, i32* %6
%14 = load i32, i32* %4
%15 = load i32, i32* @F_SETFL
%16 = load i32, i32* %6
%17 = call i64 (i32, i32, ...) @fcntl(i32 %14, i32 %15, i32 %16)
%18 = icmp slt i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %22
20: ; preds = %2
%21 = load i32, i32* %6
store i32 %21, i32* %3
br label %22
22: ; preds = %20, %19
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
define i32 @set_flag(i32 %0, i32 %1) {
%3 = load i32, i32* @F_GETFL
%4 = tail call i64 (i32, i32, ...) @fcntl(i32 %0, i32 %3)
%5 = trunc i64 %4 to i32
%6 = or i32 %5, %1
%7 = load i32, i32* @F_SETFL
%8 = tail call i64 (i32, i32, ...) @fcntl(i32 %0, i32 %7, i32 %6)
%9 = icmp slt i64 %8, 0
%10 = select i1 %9, i32 -1, i32 %6
ret i32 %10
}
long grib_op_bit(long a, long b) { return a & (1 << b); }


x86 assembly (clang, -O0):
<grib_op_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
movslq %ecx,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<grib_op_bit>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
and    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @grib_op_bit(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 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = sext i32 %8 to i64
%10 = and i64 %5, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @grib_op_bit(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = and i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/, char, char);
int /*<<< orphan*/ stdscr;
void drawui() { box(stdscr, '|', '-'); }


x86 assembly (clang, -O0):
<drawui>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    $0x7c,%esi
mov    $0x2d,%edx
call   1030 <box@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawui>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    $0x7c,%esi
mov    $0x2d,%edx
jmp    1030 <box@plt>

LLVM IR (-O0):
@stdscr = global i32 0
define void @drawui() {
%1 = load i32, i32* @stdscr
%2 = call i32 @box(i32 %1, i8 signext 124, i8 signext 45)
ret void
}

LLVM IR (-O2):
@stdscr = global i32 0
define void @drawui() {
%1 = load i32, i32* @stdscr
%2 = tail call i32 @box(i32 %1, i8 signext 124, i8 signext 45)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void smpte_fec_clear_d(uint8_t *p_fec) { p_fec[12] &= ~0x40; }


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

x86 assembly (clang, -O2):
<smpte_fec_clear_d>:
andb   $0xbf,0x30(%rdi)
ret

LLVM IR (-O0):
define void @smpte_fec_clear_d(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 12
%5 = load i32, i32* %4
%6 = and i32 %5, -65
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @smpte_fec_clear_d(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 12
%3 = load i32, i32* %2
%4 = and i32 %3, -65
store i32 %4, i32* %2
ret void
}
float calcConta(int diasHospedado) {
  float valor = 0;
  valor = 100 * diasHospedado;
  if (diasHospedado < 10) {
    valor += 15;
  } else {
    valor += 8;
  }
  return valor;
}


x86 assembly (clang, -O0):
<calcConta>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
imul   $0x64,-0x4(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113d <calcConta+0x3d>
movss  0xed6(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    114f <calcConta+0x4f>
movss  0xebb(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<calcConta>:
xor    %eax,%eax
cmp    $0xa,%edi
setl   %al
imul   $0x64,%edi,%ecx
cvtsi2ss %ecx,%xmm0
lea    0xeea(%rip),%rcx
addss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @calcConta(i32 %0) {
%2 = alloca i32
%3 = alloca float
store i32 %0, i32* %2
store float 0.000000e+00, float* %3
%4 = load i32, i32* %2
%5 = mul nsw i32 100, %4
%6 = sitofp i32 %5 to float
store float %6, float* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load float, float* %3
%11 = fadd float %10, 1.500000e+01
store float %11, float* %3
br label %15
12: ; preds = %1
%13 = load float, float* %3
%14 = fadd float %13, 8.000000e+00
store float %14, float* %3
br label %15
15: ; preds = %12, %9
%16 = load float, float* %3
ret float %16
}

LLVM IR (-O2):
define float @calcConta(i32 %0) {
%2 = mul nsw i32 %0, 100
%3 = sitofp i32 %2 to float
%4 = icmp slt i32 %0, 10
%5 = select i1 %4, float 1.500000e+01, float 8.000000e+00
%6 = fadd float %5, %3
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ __u8;
typedef int __u32;

/* Variables and functions */
int /*<<< orphan*/ __put_unaligned_be16(int, int /*<<< orphan*/ *);
void __put_unaligned_be32(__u32 val, __u8 *p) {
  __put_unaligned_be16(val >> 16, p);
  __put_unaligned_be16(val, p + 2);
}


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

x86 assembly (clang, -O2):
<__put_unaligned_be32>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
sar    $0x10,%edi
call   1030 <__put_unaligned_be16@plt>
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <__put_unaligned_be16@plt>

LLVM IR (-O0):
define void @__put_unaligned_be32(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32, i32* %3
%6 = ashr i32 %5, 16
%7 = load i32*, i32** %4
%8 = call i32 @__put_unaligned_be16(i32 %6, i32* %7)
%9 = load i32, i32* %3
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i64 2
%12 = call i32 @__put_unaligned_be16(i32 %9, i32* %11)
ret void
}

LLVM IR (-O2):
define void @__put_unaligned_be32(i32 %0, i32* %1) {
%3 = ashr i32 %0, 16
%4 = tail call i32 @__put_unaligned_be16(i32 %3, i32* %1)
%5 = getelementptr inbounds i32, i32* %1, i64 2
%6 = tail call i32 @__put_unaligned_be16(i32 %0, i32* %5)
ret void
}