xunge/DecIR huggingface dataset:
/* Type definitions */
struct str {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *b_to_s(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ str_data(struct str *);
void output_str(FILE *outfile, struct str *str) {
  char *s = b_to_s(str_data(str));
  fprintf(outfile, "%s", s);
  free(s);
}


x86 assembly (clang, -O0):
<output_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <str_data@plt>
mov    %eax,%edi
call   1060 <b_to_s@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <str_data@plt>
mov    %eax,%edi
call   1060 <b_to_s@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.str = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @output_str(i32* %0, %struct.str* %1) {
%3 = alloca i32*
%4 = alloca %struct.str*
%5 = alloca i8*
store i32* %0, i32** %3
store %struct.str* %1, %struct.str** %4
%6 = load %struct.str*, %struct.str** %4
%7 = call i32 @str_data(%struct.str* %6)
%8 = call i8* @b_to_s(i32 %7)
store i8* %8, i8** %5
%9 = load i32*, i32** %3
%10 = load i8*, i8** %5
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i8*, i8** %5
%13 = call i32 @free(i8* %12)
ret void
}

LLVM IR (-O2):
%struct.str = type { i32 }
define void @output_str(i32* nocapture %0, %struct.str* %1) {
%3 = tail call i32 @str_data(%struct.str* %1)
%4 = tail call i8* @b_to_s(i32 %3)
%5 = tail call i32 @fputs(i8* %4, i32* %0)
%6 = tail call i32 @free(i8* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
void check(int test, const char *message) {
  if (!test) {
    perror(message);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114c <check+0x2c>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check>:
test   %edi,%edi
je     1125 <check+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @check(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = call i32 @exit(i32 1)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @check(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ CompileAgain(int);
void DoRepeat(void) { CompileAgain(29); }


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

x86 assembly (clang, -O2):
<DoRepeat>:
mov    $0x1d,%edi
jmp    1030 <CompileAgain@plt>

LLVM IR (-O0):
define void @DoRepeat() {
%1 = call i32 @CompileAgain(i32 29)
ret void
}

LLVM IR (-O2):
define void @DoRepeat() {
%1 = tail call i32 @CompileAgain(i32 29)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int *, int, int);
void bad_bar_one() {
  int buf[50];
  foo(buf, 50, 50);
}


x86 assembly (clang, -O0):
<bad_bar_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
lea    -0xd0(%rbp),%rdi
mov    $0x32,%edx
mov    %edx,%esi
call   1030 <foo@plt>
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_bar_one>:
sub    $0xc8,%rsp
mov    %rsp,%rdi
mov    $0x32,%esi
mov    $0x32,%edx
call   1030 <foo@plt>
add    $0xc8,%rsp
ret

LLVM IR (-O0):
define void @bad_bar_one() {
%1 = alloca [50 x i32]
%2 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%3 = call i32 @foo(i32* %2, i32 50, i32 50)
ret void
}

LLVM IR (-O2):
define void @bad_bar_one() {
%1 = alloca [50 x i32]
%2 = bitcast [50 x i32]* %1 to i8*
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %1, i64 0, i64 0
%4 = call i32 @foo(i32* %3, i32 50, i32 50)
ret void
}
unsigned int mem_get_be32_as_int(const void *vmem) {
  unsigned int val;
  const unsigned char *mem = (const unsigned char *)vmem;
  val = mem[0] << 24;
  val |= mem[1] << 16;
  val |= mem[2] << 8;
  val |= mem[3];
  return val;
}


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

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

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

LLVM IR (-O2):
define i32 @mem_get_be32_as_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl nuw nsw i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 3
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = or i32 %14, %17
ret i32 %18
}
int _isupper(char c) { return (c >= 'A' && c <= 'Z'); }


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

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

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

LLVM IR (-O2):
define i32 @_isupper(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ inb(int);
void u_sleep(int usec) {
  int i = 0;
  for (; i < usec; i++) {
    inb(0x80);
    inb(0x80);
  }
}


x86 assembly (clang, -O0):
<u_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1150 <u_sleep+0x40>
mov    $0x80,%edi
call   1030 <inb@plt>
mov    $0x80,%edi
call   1030 <inb@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <u_sleep+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_sleep>:
push   %rbx
test   %edi,%edi
jle    1139 <u_sleep+0x29>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x80,%edi
call   1030 <inb@plt>
mov    $0x80,%edi
call   1030 <inb@plt>
add    $0xffffffff,%ebx
jne    1120 <u_sleep+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @u_sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %11, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = call i32 @inb(i32 128)
%10 = call i32 @inb(i32 128)
br label %11
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @u_sleep(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = tail call i32 @inb(i32 128)
%6 = tail call i32 @inb(i32 128)
%7 = add nuw nsw i32 %4, 1
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %3
9: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
scalar_t__ imports_ar_read_signature(int /*<<< orphan*/ *, int);
int imports_ar_verify(uint8_t *buffer, int file_size) {
  if (imports_ar_read_signature(buffer, file_size) != 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<imports_ar_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <imports_ar_read_signature@plt>
cmp    $0x0,%rax
je     1141 <imports_ar_verify+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <imports_ar_verify+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imports_ar_verify>:
push   %rax
call   1030 <imports_ar_read_signature@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @imports_ar_verify(i32* %0, i32 %1) {
%3 = tail call i64 @imports_ar_read_signature(i32* %0, i32 %1)
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ UART1_DriverIRQHandler();
__attribute__((weak, section(".after_vectors"))) void UART1_IRQHandler(void) {
  UART1_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @UART1_IRQHandler() section ".after_vectors" {
%1 = call i32 (...) @UART1_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @UART1_IRQHandler() section ".after_vectors" {
%1 = tail call i32 (...) @UART1_DriverIRQHandler()
ret void
}
/* Type definitions */
struct text_tag_list {
  int dummy;
};
struct text_tag {
  int dummy;
};
struct genlist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ genlist_prepend(struct genlist *, struct text_tag *);
void text_tag_list_prepend(struct text_tag_list *tthis, struct text_tag *pfoo) {
  genlist_prepend(((struct genlist *)(tthis)), pfoo);
}


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

x86 assembly (clang, -O2):
<text_tag_list_prepend>:
jmp    1030 <genlist_prepend@plt>

LLVM IR (-O0):
%struct.text_tag_list = type { i32 }
%struct.text_tag = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_prepend(%struct.text_tag_list* %0, %struct.text_tag* %1) {
%3 = alloca %struct.text_tag_list*
%4 = alloca %struct.text_tag*
store %struct.text_tag_list* %0, %struct.text_tag_list** %3
store %struct.text_tag* %1, %struct.text_tag** %4
%5 = load %struct.text_tag_list*, %struct.text_tag_list** %3
%6 = bitcast %struct.text_tag_list* %5 to %struct.genlist*
%7 = load %struct.text_tag*, %struct.text_tag** %4
%8 = call i32 @genlist_prepend(%struct.genlist* %6, %struct.text_tag* %7)
ret void
}

LLVM IR (-O2):
%struct.text_tag_list = type { i32 }
%struct.text_tag = type { i32 }
%struct.genlist = type { i32 }
define void @text_tag_list_prepend(%struct.text_tag_list* %0, %struct.text_tag* %1) {
%3 = bitcast %struct.text_tag_list* %0 to %struct.genlist*
%4 = tail call i32 @genlist_prepend(%struct.genlist* %3, %struct.text_tag* %1)
ret void
}
int _cups_isalnum(int ch) {
  return ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') ||
          (ch >= 'a' && ch <= 'z'));
}


x86 assembly (clang, -O0):
<_cups_isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <_cups_isalnum+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <_cups_isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <_cups_isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <_cups_isalnum+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <_cups_isalnum+0x52>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cups_isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @_cups_isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 122
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @_cups_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_uint16_le(const uint8_t *buf) {
  uint16_t res;
  res = buf[1] << 8 | buf[0];
  return res;
}


x86 assembly (clang, -O0):
<get_uint16_le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     (%rcx),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_uint16_le>:
mov    0x4(%rdi),%eax
shl    $0x8,%eax
or     (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @get_uint16_le(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 8
%5 = load i32, i32* %0
%6 = or i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ GPTLerror(char *, char const *);
double utr_clock_gettime() {
  static const char *thisfunc = "utr_clock_gettime";
  (void)GPTLerror("%s: not enabled\n", thisfunc);
  return -1.;
}


x86 assembly (clang, -O0):
<utr_clock_gettime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rsi
lea    0xef8(%rip),%rdi
call   1030 <GPTLerror@plt>
movsd  0xed1(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<utr_clock_gettime>:
push   %rax
lea    0xf02(%rip),%rdi
lea    0xee9(%rip),%rsi
call   1030 <GPTLerror@plt>
movsd  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@utr_clock_gettime.thisfunc = internal global i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i32 0, i32 0)
@.str = [18 x i8] c"utr_clock_gettime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define double @utr_clock_gettime() {
%1 = load i8*, i8** @utr_clock_gettime.thisfunc
%2 = call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret double -1.000000e+00
}

LLVM IR (-O2):
@.str = [18 x i8] c"utr_clock_gettime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define double @utr_clock_gettime() {
%1 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
ret double -1.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ cgcmp(char *);
void cggt() { cgcmp("jle"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"jle\00"
define void @cggt() {
%1 = tail call i32 @cgcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Score();
void Delay(long double k) {
  Score();
  long double i;
  for (i = 0; i <= (10000000); i++)
    ;
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
xor    %eax,%eax
call   1030 <Score@plt>
fldz
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
flds   0xecd(%rip)
fucomip %st(1),%st
fstp   %st(0)
jb     1156 <Delay+0x46>
jmp    1142 <Delay+0x32>
jmp    1147 <Delay+0x37>
fldt   -0x20(%rbp)
fld1
faddp  %st,%st(1)
fstpt  -0x20(%rbp)
jmp    112a <Delay+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Delay(x86_fp80 %0) {
%2 = alloca x86_fp80
%3 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%4 = call i32 (...) @Score()
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
br label %5
5: ; preds = %9, %1
%6 = load x86_fp80, x86_fp80* %3
%7 = fcmp ole x86_fp80 %6, 0xK40169896800000000000
br i1 %7, label %8, label %12
8: ; preds = %5
br label %9
9: ; preds = %8
%10 = load x86_fp80, x86_fp80* %3
%11 = fadd x86_fp80 %10, 0xK3FFF8000000000000000
store x86_fp80 %11, x86_fp80* %3
br label %5
12: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @Delay(x86_fp80 %0) {
%2 = tail call i32 (...) @Score()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error_clear_text();
int /*<<< orphan*/ error_reason(char *);
scalar_t__ geteuid();
int check_for_root(void) {
  if (geteuid() != 0) {
    error_clear_text();
    error_reason("Must be root to perform this operation");
    return -1;
  } else
    return 0;
}


x86 assembly (clang, -O0):
<check_for_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <geteuid@plt>
cmp    $0x0,%rax
je     1168 <check_for_root+0x38>
mov    $0x0,%al
call   1040 <error_clear_text@plt>
lea    0xea9(%rip),%rdi
call   1030 <error_reason@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116f <check_for_root+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_for_root>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
test   %rax,%rax
je     1157 <check_for_root+0x27>
xor    %eax,%eax
call   1040 <error_clear_text@plt>
lea    0xeb3(%rip),%rdi
call   1030 <error_reason@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Must be root to perform this operation\00"
define i32 @check_for_root() {
%1 = alloca i32
%2 = call i64 (...) @geteuid()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call i32 (...) @error_clear_text()
%6 = call i32 @error_reason(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [39 x i8] c"Must be root to perform this operation\00"
define i32 @check_for_root() {
%1 = tail call i64 (...) @geteuid()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @error_clear_text()
%5 = tail call i32 @error_reason(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int rand();
int random_number(int min_num, int max_num) {
  int result = 0, low_num = 0, hi_num = 0;
  if (min_num < max_num) {
    low_num = min_num;
    hi_num = max_num + 1;
  } else {
    low_num = max_num + 1;
    hi_num = min_num;
  }
  result = (rand() % (hi_num - low_num)) + low_num;
  return result;
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1153 <random_number+0x43>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1162 <random_number+0x52>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x14(%rbp),%ecx
sub    -0x10(%rbp),%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%edx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rbp
push   %rbx
push   %rax
lea    0x1(%rsi),%ebp
cmp    %esi,%edi
mov    %ebp,%ebx
cmovl  %edi,%ebx
cmovge %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebx,%ebp
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @random_number(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = add nsw i32 %1, 1
%5 = select i1 %3, i32 %0, i32 %4
%6 = select i1 %3, i32 %4, i32 %0
%7 = tail call i32 (...) @rand()
%8 = sub nsw i32 %6, %5
%9 = srem i32 %7, %8
%10 = add nsw i32 %9, %5
ret i32 %10
}
/* Variables and functions */
int SNDRV_PCM_HW_PARAM_FIRST_INTERVAL;
int SNDRV_PCM_HW_PARAM_LAST_INTERVAL;
int param_is_interval(int p) {
  return (p >= SNDRV_PCM_HW_PARAM_FIRST_INTERVAL) &&
         (p <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL);
}


x86 assembly (clang, -O0):
<param_is_interval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2ebd(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x5(%rbp)
jl     1130 <param_is_interval+0x30>
mov    -0x4(%rbp),%eax
mov    0x2ec0(%rip),%rcx
cmp    (%rcx),%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<param_is_interval>:
mov    0x2ec9(%rip),%rax
cmp    %edi,(%rax)
setle  %al
mov    0x2ed5(%rip),%rcx
cmp    %edi,(%rcx)
setge  %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
@SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = global i32 0
@SNDRV_PCM_HW_PARAM_LAST_INTERVAL = global i32 0
define i32 @param_is_interval(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SNDRV_PCM_HW_PARAM_FIRST_INTERVAL
%5 = icmp sge i32 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %2
%8 = load i32, i32* @SNDRV_PCM_HW_PARAM_LAST_INTERVAL
%9 = icmp sle i32 %7, %8
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = global i32 0
@SNDRV_PCM_HW_PARAM_LAST_INTERVAL = global i32 0
define i32 @param_is_interval(i32 %0) {
%2 = load i32, i32* @SNDRV_PCM_HW_PARAM_FIRST_INTERVAL
%3 = icmp sle i32 %2, %0
%4 = load i32, i32* @SNDRV_PCM_HW_PARAM_LAST_INTERVAL
%5 = icmp sge i32 %4, %0
%6 = select i1 %3, i1 %5, i1 false
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int fun1(short x) {
  printf("this is fun1.\n");
  if (x < 0) {
    return 0;
  } else if (x > 0) {
    return 1;
  }
}


x86 assembly (clang, -O0):
<fun1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movswl -0x6(%rbp),%eax
cmp    $0x0,%eax
jge    1144 <fun1+0x34>
movl   $0x0,-0x4(%rbp)
jmp    1162 <fun1+0x52>
movswl -0x6(%rbp),%eax
cmp    $0x0,%eax
jle    115d <fun1+0x4d>
movl   $0x1,-0x4(%rbp)
jmp    1162 <fun1+0x52>
jmp    1162 <fun1+0x52>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun1>:
push   %rbx
mov    %edi,%ebx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
not    %ebx
movzwl %bx,%eax
shr    $0xf,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"this is fun1.\0A\00"
define i32 @fun1(i16 signext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %15
9: ; preds = %1
%10 = load i16, i16* %3
%11 = sext i16 %10 to i32
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %9
store i32 1, i32* %2
br label %15
14: ; preds = %9
br label %15
15: ; preds = %8, %13, %14
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [14 x i8] c"this is fun1.\00"
define i32 @fun1(i16 signext %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%3 = xor i16 %0, -1
%4 = lshr i16 %3, 15
%5 = zext i16 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exec_ror(int, int, int);
void test_ror(void) {
  int i;
  for (i = 0; i < 32; i++)
    exec_ror(0x21ad3d34, 0x12345678, i);
  for (i = 0; i < 32; i++)
    exec_ror(0x813f3421, 0x82345678, i);
}


x86 assembly (clang, -O0):
<test_ror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    1149 <test_ror+0x39>
mov    -0x4(%rbp),%edx
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
call   1030 <exec_ror@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test_ror+0xf>
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    117a <test_ror+0x6a>
mov    -0x4(%rbp),%edx
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
call   1030 <exec_ror@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <test_ror+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ror>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x21ad3d34,%edi
mov    $0x12345678,%esi
mov    %ebx,%edx
call   1030 <exec_ror@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1120 <test_ror+0x10>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x813f3421,%edi
mov    $0x82345678,%esi
mov    %ebx,%edx
call   1030 <exec_ror@plt>
add    $0x1,%ebx
cmp    $0x20,%ebx
jne    1140 <test_ror+0x30>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_ror() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @exec_ror(i32 565001524, i32 305419896, i32 %6)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
store i32 0, i32* %1
br label %12
12: ; preds = %18, %11
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %21
15: ; preds = %12
%16 = load i32, i32* %1
%17 = call i32 @exec_ror(i32 -2126564319, i32 -2110499208, i32 %16)
br label %18
18: ; preds = %15
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %12
21: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @test_ror() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @exec_ror(i32 565001524, i32 305419896, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 32
br i1 %5, label %6, label %1
6: ; preds = %1, %6
%7 = phi i32 [ %9, %6 ], [ 0, %1 ]
%8 = tail call i32 @exec_ror(i32 -2126564319, i32 -2110499208, i32 %7)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 32
br i1 %10, label %11, label %6
11: ; preds = %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char const *);
FILE *Sys_FOpen(const char *ospath, const char *mode) {
  return fopen(ospath, mode);
}


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

x86 assembly (clang, -O2):
<Sys_FOpen>:
jmp    1030 <fopen@plt>

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

LLVM IR (-O2):
define noalias i32* @Sys_FOpen(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
void foo(int *p, int q) {
  if (p == 0) {
    if (q == 0) {
      int *r = &p[q];
      if (r != 0)
        link_error();
    }
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1163 <foo+0x53>
cmpl   $0x0,-0xc(%rbp)
jne    115e <foo+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <foo+0x49>
mov    $0x0,%al
call   1030 <link_error@plt>
jmp    115e <foo+0x4e>
jmp    1163 <foo+0x53>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo(i32* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *);
int /*<<< orphan*/ stderr;
void error(const char *msg, const char *file, int line) {
  fprintf(stderr, "ERROR [file: %s, line: %d] %s\n", file, line, msg);
  exit(-1);
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%r8
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<error>:
push   %rax
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%r8
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xec7(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR [file: %s, line: %d] %s\0A\00"
define void @error(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i8*, i8** %4
%11 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %8, i32 %9, i8* %10)
%12 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c"ERROR [file: %s, line: %d] %s\0A\00"
define void @error(i8* %0, i8* %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %0)
%6 = tail call i32 @exit(i32 -1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int idade;
  scanf("%d", &idade);
  if (idade >= 18) {
    printf("maior de idade\n");
  }
  printf("menor de idade\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x12,-0x8(%rbp)
jl     1155 <main+0x35>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x12,0x4(%rsp)
jl     1145 <main+0x25>
lea    0xed2(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [16 x i8] c"maior de idade\0A\00"
@.str.2 = [16 x i8] c"menor de idade\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 18
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [15 x i8] c"menor de idade\00"
@str.3 = [15 x i8] c"maior de idade\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 17
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.3, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pwr_disable_backup_write_protection();
int /*<<< orphan*/ pwr_enable_backup_write_protection();
int /*<<< orphan*/ rcc_rtc_disable();
int /*<<< orphan*/ rcc_rtc_is_enabled();
int /*<<< orphan*/ rcc_rtc_reset();
void rtc_disable() {
  if (!rcc_rtc_is_enabled()) {
    return;
  }
  pwr_disable_backup_write_protection();
  rcc_rtc_reset();
  rcc_rtc_disable();
  pwr_enable_backup_write_protection();
}


x86 assembly (clang, -O0):
<rtc_disable>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <rcc_rtc_is_enabled@plt>
cmp    $0x0,%eax
jne    1169 <rtc_disable+0x19>
jmp    1185 <rtc_disable+0x35>
mov    $0x0,%al
call   1060 <pwr_disable_backup_write_protection@plt>
mov    $0x0,%al
call   1030 <rcc_rtc_reset@plt>
mov    $0x0,%al
call   1040 <rcc_rtc_disable@plt>
mov    $0x0,%al
call   1070 <pwr_enable_backup_write_protection@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtc_disable>:
push   %rax
xor    %eax,%eax
call   1050 <rcc_rtc_is_enabled@plt>
test   %eax,%eax
je     1179 <rtc_disable+0x29>
xor    %eax,%eax
call   1060 <pwr_disable_backup_write_protection@plt>
xor    %eax,%eax
call   1030 <rcc_rtc_reset@plt>
xor    %eax,%eax
call   1040 <rcc_rtc_disable@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <pwr_enable_backup_write_protection@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @rtc_disable() {
%1 = call i32 (...) @rcc_rtc_is_enabled()
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %9
4: ; preds = %0
%5 = call i32 (...) @pwr_disable_backup_write_protection()
%6 = call i32 (...) @rcc_rtc_reset()
%7 = call i32 (...) @rcc_rtc_disable()
%8 = call i32 (...) @pwr_enable_backup_write_protection()
br label %9
9: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
define void @rtc_disable() {
%1 = tail call i32 (...) @rcc_rtc_is_enabled()
%2 = icmp eq i32 %1, 0
br i1 %2, label %8, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pwr_disable_backup_write_protection()
%5 = tail call i32 (...) @rcc_rtc_reset()
%6 = tail call i32 (...) @rcc_rtc_disable()
%7 = tail call i32 (...) @pwr_enable_backup_write_protection()
br label %8
8: ; preds = %0, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SendMsg253();
void sendmsg() { SendMsg253(); }


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

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

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

LLVM IR (-O2):
define void @sendmsg() {
%1 = tail call i32 (...) @SendMsg253()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UPnPResponse_AVTransport_SetAVTransportURI(void *);
int /*<<< orphan*/ printf(char *, unsigned int, char *, char *);
void UPnPAVTransport_SetAVTransportURI(void *upnptoken, unsigned int InstanceID,
                                       char *CurrentURI,
                                       char *CurrentURIMetaData) {
  printf("Invoke: UPnPAVTransport_SetAVTransportURI(%u,%s,%s);\r\n", InstanceID,
         CurrentURI, CurrentURIMetaData);
  UPnPResponse_AVTransport_SetAVTransportURI(upnptoken);
}


x86 assembly (clang, -O0):
<UPnPAVTransport_SetAVTransportURI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <UPnPResponse_AVTransport_SetAVTransportURI@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UPnPAVTransport_SetAVTransportURI>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <UPnPResponse_AVTransport_SetAVTransportURI@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Invoke: UPnPAVTransport_SetAVTransportURI(%u,%s,%s);\0D\0A\00"
define void @UPnPAVTransport_SetAVTransportURI(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i32, i32* %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @UPnPResponse_AVTransport_SetAVTransportURI(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Invoke: UPnPAVTransport_SetAVTransportURI(%u,%s,%s);\0D\0A\00"
define void @UPnPAVTransport_SetAVTransportURI(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %1, i8* %2, i8* %3)
%6 = tail call i32 @UPnPResponse_AVTransport_SetAVTransportURI(i8* %0)
ret void
}
int test_imm_1Euint32_reg(unsigned int val) {
  return ((val) & (0x1E << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_1Euint32_reg(i32 %0) {
%2 = and i32 %0, 30
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ set_bit(int *, int);
void add(int *set, int x) {
  int d = x >> 5;
  set_bit(set + d, x - (d << 5));
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
sub    %eax,%esi
call   1030 <set_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %esi,%eax
sar    $0x5,%eax
cltq
lea    (%rdi,%rax,4),%rdi
and    $0x1f,%esi
jmp    1030 <set_bit@plt>

LLVM IR (-O0):
define void @add(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = ashr i32 %6, 5
store i32 %7, i32* %5
%8 = load i32*, i32** %3
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = shl i32 %13, 5
%15 = sub nsw i32 %12, %14
%16 = call i32 @set_bit(i32* %11, i32 %15)
ret void
}

LLVM IR (-O2):
define void @add(i32* %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = and i32 %1, 31
%7 = tail call i32 @set_bit(i32* %5, i32 %6)
ret void
}
int test_imm_C7int64_lowword_reg(long long val) {
  return ((val) & (0xC7 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_C7int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 199
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void __DELETE_java_nio_Buffer(void *me, void *client_data) {}


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

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

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

LLVM IR (-O2):
define void @__DELETE_java_nio_Buffer(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ setresuid(int, int, int);
int main(int argc, char **argv) {
  setresuid(2004, 2004, 2004);
  execv("/wargame/bin/tmpserver3.sh", argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x7d4,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1030 <setresuid@plt>
mov    -0x10(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1040 <execv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    $0x7d4,%edi
mov    $0x7d4,%esi
mov    $0x7d4,%edx
call   1030 <setresuid@plt>
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <execv@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"/wargame/bin/tmpserver3.sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @setresuid(i32 2004, i32 2004, i32 2004)
%6 = load i8**, i8*** %4
%7 = call i32 @execv(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"/wargame/bin/tmpserver3.sh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @setresuid(i32 2004, i32 2004, i32 2004)
%4 = tail call i32 @execv(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8** %1)
ret i32 0
}
test00(const char *s1, const char *s2) { return __builtin_strcmp(s1, s2); }


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

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

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

LLVM IR (-O2):
define i32 @test00(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}