xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0xfe() {
  Assert_real((isalnum(254) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              1275, ("isalnum should be 0 for 0xfe"));
}


x86 assembly (clang, -O0):
<t_isalnum_0xfe>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfe,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x4fb,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0xfe>:
push   %rax
mov    $0xfe,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x4fb,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xfe\00"
define void @t_isalnum_0xfe() {
%1 = call i64 @isalnum(i32 254)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1275, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [29 x i8] c"isalnum should be 0 for 0xfe\00"
define void @t_isalnum_0xfe() {
%1 = tail call i64 @isalnum(i32 254)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1275, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double __nv_rcbrt(double);
double rcbrt(double __a) { return __nv_rcbrt(__a); }


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

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

LLVM IR (-O0):
define double @rcbrt(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @__nv_rcbrt(double %3)
ret double %4
}

LLVM IR (-O2):
define double @rcbrt(double %0) {
%2 = tail call double @__nv_rcbrt(double %0)
ret double %2
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool UARTSpaceAvail(uint32_t ui32Base) {
  ;
  return (((*((volatile unsigned long *)(ui32Base + 0x00000018))) & 0x00000020)
              ? false
              : true);
}


x86 assembly (clang, -O0):
<UARTSpaceAvail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rdx
and    $0x20,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTSpaceAvail>:
mov    0x18(%rdi),%rcx
xor    %eax,%eax
test   $0x20,%cl
sete   %al
ret

LLVM IR (-O0):
define i32 @UARTSpaceAvail(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 24
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = and i64 %6, 32
%8 = icmp ne i64 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 0, i32 1
ret i32 %10
}

LLVM IR (-O2):
define i32 @UARTSpaceAvail(i64 %0) {
%2 = add nsw i64 %0, 24
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = lshr i32 %5, 5
%7 = and i32 %6, 1
%8 = xor i32 %7, 1
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freebytes(void *fatso, size_t nbytes) { free(fatso); }


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

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

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

LLVM IR (-O2):
define void @freebytes(i8* nocapture %0, i64 %1) {
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
void after_tag(WINDOW *win) { wattroff(win, COLOR_PAIR(2)); }


x86 assembly (clang, -O0):
<after_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x2,%edi
call   1030 <COLOR_PAIR@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <wattroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<after_tag>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2,%edi
call   1030 <COLOR_PAIR@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <wattroff@plt>

LLVM IR (-O0):
define void @after_tag(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @COLOR_PAIR(i32 2)
%5 = call i32 @wattroff(i32* %3, i32 %4)
ret void
}

LLVM IR (-O2):
define void @after_tag(i32* %0) {
%2 = tail call i32 @COLOR_PAIR(i32 2)
%3 = tail call i32 @wattroff(i32* %0, i32 %2)
ret void
}
int Judge(char IN_NAME[11]) {
  if (IN_NAME[0] == 'q') {
    if (IN_NAME[1] == '\0') {
      return 0;
    }
  } else if (IN_NAME[0] == 0x00)
    return 1;
  else
    return 2;
  return 0;
}


x86 assembly (clang, -O0):
<Judge>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x71,%eax
jne    113a <Judge+0x3a>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1135 <Judge+0x35>
movl   $0x0,-0x4(%rbp)
jmp    1169 <Judge+0x69>
jmp    1162 <Judge+0x62>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1156 <Judge+0x56>
movl   $0x1,-0x4(%rbp)
jmp    1169 <Judge+0x69>
movl   $0x2,-0x4(%rbp)
jmp    1169 <Judge+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Judge>:
mov    (%rdi),%cl
cmp    $0x1,%cl
mov    $0x2,%edx
sbb    $0x0,%edx
xor    %eax,%eax
cmp    $0x71,%cl
cmovne %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @Judge(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 1, i32 2
%5 = icmp eq i8 %2, 113
%6 = select i1 %5, i32 0, i32 %4
ret i32 %6
}
unsigned int modulo_inc(const unsigned int value, const unsigned int modulus) {
  unsigned int my_value = value + 1;
  if (my_value >= modulus) {
    my_value = 0;
  }
  return my_value;
}


x86 assembly (clang, -O0):
<modulo_inc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1126 <modulo_inc+0x26>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modulo_inc>:
lea    0x1(%rdi),%ecx
xor    %eax,%eax
cmp    %esi,%ecx
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @modulo_inc(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 = add i32 %6, 1
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp uge i32 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %5
br label %12
12: ; preds = %11, %2
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @modulo_inc(i32 %0, i32 %1) {
%3 = add i32 %0, 1
%4 = icmp ult i32 %3, %1
%5 = select i1 %4, i32 %3, i32 0
ret i32 %5
}
/* Variables and functions */
char getc(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
void my_pause() {
  printf("\n****** Press RETURN to continue ******");
  while (getc(stdin) != '\n')
    ;
  return;
}


x86 assembly (clang, -O0):
<my_pause>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114f <my_pause+0x2f>
jmp    1130 <my_pause+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_pause>:
push   %rbx
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb4(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%edi
call   1040 <getc@plt>
cmp    $0xa,%al
jne    1140 <my_pause+0x20>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [40 x i8] c"\0A****** Press RETURN to continue ******\00"
@stdin = global i32 0
define void @my_pause() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %7, %0
%3 = load i32, i32* @stdin
%4 = call signext i8 @getc(i32 %3)
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 10
br i1 %6, label %7, label %8
7: ; preds = %2
br label %2
8: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"\0A****** Press RETURN to continue ******\00"
@stdin = global i32 0
define void @my_pause() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = load i32, i32* @stdin
%4 = tail call signext i8 @getc(i32 %3)
%5 = icmp eq i8 %4, 10
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
struct link *list_back(struct link *);
int /*<<< orphan*/ list_take(struct link *);
struct link *list_take_back(struct link *__restrict list) {
  struct link *link;
  link = list_back(list);
  list_take(link);
  return link;
}


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

x86 assembly (clang, -O2):
<list_take_back>:
push   %rbx
call   1030 <list_back@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <list_take@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.link = type { i32 }
define %struct.link* @list_take_back(%struct.link* noalias %0) {
%2 = alloca %struct.link*
%3 = alloca %struct.link*
store %struct.link* %0, %struct.link** %2
%4 = load %struct.link*, %struct.link** %2
%5 = call %struct.link* @list_back(%struct.link* %4)
store %struct.link* %5, %struct.link** %3
%6 = load %struct.link*, %struct.link** %3
%7 = call i32 @list_take(%struct.link* %6)
%8 = load %struct.link*, %struct.link** %3
ret %struct.link* %8
}

LLVM IR (-O2):
%struct.link = type { i32 }
define %struct.link* @list_take_back(%struct.link* noalias %0) {
%2 = tail call %struct.link* @list_back(%struct.link* %0)
%3 = tail call i32 @list_take(%struct.link* %2)
ret %struct.link* %2
}
double foo(void) { return 0.0; }


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

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

LLVM IR (-O0):
define double @foo() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @foo() {
ret double 0.000000e+00
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char *argv[], char *envp[]) {
  int year = 2015;
  char greeting[] = "Hello";
  printf("%s, the world of %d!\n", greeting, year);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x7df,-0x1c(%rbp)
mov    0xec9(%rip),%eax
mov    %eax,-0x22(%rbp)
mov    0xec3(%rip),%ax
mov    %ax,-0x1e(%rbp)
lea    -0x22(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6548,(%rsp)
lea    0xee0(%rip),%rdi
mov    %rsp,%rsi
mov    $0x7df,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.greeting = [6 x i8] c"Hello\00"
@.str = [22 x i8] c"%s, the world of %d!\0A\00"
define i32 @main(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32
%9 = alloca [6 x i8]
store i32 0, i32* %4
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32 2015, i32* %8
%10 = bitcast [6 x i8]* %9 to i8*
%11 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%12 = load i32, i32* %8
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.greeting = [6 x i8] c"Hello\00"
@.str = [22 x i8] c"%s, the world of %d!\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1, i8** nocapture readnone %2) {
%4 = alloca [6 x i8]
%5 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%6 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i32 2015)
ret i32 0
}
/* Type definitions */
struct ship {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Write(int, struct ship *, long, long, int /*<<< orphan*/,
                         int /*<<< orphan*/);
void send_ungrap(struct ship *ship, long a, long b) {
  Write(19, ship, a, b, 0, 0);
}


x86 assembly (clang, -O0):
<send_ungrap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x13,%edi
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <Write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_ungrap>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x13,%edi
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <Write@plt>

LLVM IR (-O0):
%struct.ship = type { i32 }
define void @send_ungrap(%struct.ship* %0, i64 %1, i64 %2) {
%4 = alloca %struct.ship*
%5 = alloca i64
%6 = alloca i64
store %struct.ship* %0, %struct.ship** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load %struct.ship*, %struct.ship** %4
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = call i32 @Write(i32 19, %struct.ship* %7, i64 %8, i64 %9, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
%struct.ship = type { i32 }
define void @send_ungrap(%struct.ship* %0, i64 %1, i64 %2) {
%4 = tail call i32 @Write(i32 19, %struct.ship* %0, i64 %1, i64 %2, i32 0, i32 0)
ret void
}
int free_scalar(const void *aux, struct futhark_context *ctx, void *p) {
  (void)aux;
  (void)ctx;
  (void)p;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.futhark_context = type opaque
define i32 @free_scalar(i8* %0, %struct.futhark_context* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.futhark_context*
%6 = alloca i8*
store i8* %0, i8** %4
store %struct.futhark_context* %1, %struct.futhark_context** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load %struct.futhark_context*, %struct.futhark_context** %5
%9 = load i8*, i8** %6
ret i32 0
}

LLVM IR (-O2):
%struct.futhark_context = type opaque
define i32 @free_scalar(i8* nocapture readnone %0, %struct.futhark_context* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void INT_Excep_RIIC0_RXI0(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_RIIC0_RXI0() {
ret void
}
char *strcpy(register char *s1, const register char *s2) {
  register char *p;
  register unsigned ch;
  p = s1;
  do {
    ch = *s2++;
    *p++ = ch;
  } while (ch);
  return s1;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
cmpl   $0x0,-0x1c(%rbp)
jne    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %8, %3 ]
%5 = phi i8* [ %1, %2 ], [ %6, %3 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %5
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %7, i8* %4
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
char *malloc(size_t);
void string_init(char **string, size_t length) {
  if (length > 0)
    *string = malloc(length);
  else
    *string = 0;
}


x86 assembly (clang, -O0):
<string_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jbe    1143 <string_init+0x33>
mov    -0x10(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    114e <string_init+0x3e>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_init>:
push   %rbx
mov    %rdi,%rbx
test   %rsi,%rsi
je     1123 <string_init+0x13>
mov    %rsi,%rdi
call   1030 <malloc@plt>
jmp    1125 <string_init+0x15>
xor    %eax,%eax
mov    %rax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @string_init(i8** nocapture writeonly %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i8* @malloc(i64 %1)
br label %6
6: ; preds = %2, %4
%7 = phi i8* [ %5, %4 ], [ null, %2 ]
store i8* %7, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RAND_bytes(unsigned char *, size_t);
int /*<<< orphan*/ die(char *);
void get_random_bytes(unsigned char *buf, size_t len) {
  if (!RAND_bytes(buf, len))
    die("Could not generate random bytes.");
}


x86 assembly (clang, -O0):
<get_random_bytes>:
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 <RAND_bytes@plt>
cmp    $0x0,%eax
jne    1152 <get_random_bytes+0x32>
lea    0xeb3(%rip),%rdi
call   1040 <die@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_random_bytes>:
push   %rax
call   1030 <RAND_bytes@plt>
test   %eax,%eax
je     112c <get_random_bytes+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1040 <die@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Could not generate random bytes.\00"
define void @get_random_bytes(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i32 @RAND_bytes(i8* %5, i64 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Could not generate random bytes.\00"
define void @get_random_bytes(i8* %0, i64 %1) {
%3 = tail call i32 @RAND_bytes(i8* %0, i64 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
long atol(char *);
char *get_next_argp(char ***, char *);
long get_next_argpl(char ***argv, char *arg) {
  char *tmp = get_next_argp(argv, arg);
  return atol(tmp);
}


x86 assembly (clang, -O0):
<get_next_argpl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_next_argp@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <atol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_argpl>:
push   %rax
call   1030 <get_next_argp@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <atol@plt>

LLVM IR (-O0):
define i64 @get_next_argpl(i8*** %0, i8* %1) {
%3 = alloca i8***
%4 = alloca i8*
%5 = alloca i8*
store i8*** %0, i8**** %3
store i8* %1, i8** %4
%6 = load i8***, i8**** %3
%7 = load i8*, i8** %4
%8 = call i8* @get_next_argp(i8*** %6, i8* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i64 @atol(i8* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @get_next_argpl(i8*** %0, i8* %1) {
%3 = tail call i8* @get_next_argp(i8*** %0, i8* %1)
%4 = tail call i64 @atol(i8* %3)
ret i64 %4
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_sec;
  int tv_usec;
};

/* Variables and functions */
bool __is_timeval_valid_timeout(struct timeval tv) {
  return tv.tv_sec >= 0 && tv.tv_usec >= 0 && tv.tv_usec < 1000 * 1000;
}


x86 assembly (clang, -O0):
<__is_timeval_valid_timeout>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jl     1137 <__is_timeval_valid_timeout+0x37>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
jl     1137 <__is_timeval_valid_timeout+0x37>
cmpl   $0xf4240,-0x8(%rbp)
setl   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__is_timeval_valid_timeout>:
test   %rdi,%rdi
setns  %al
test   %esi,%esi
setns  %cl
and    %al,%cl
cmp    $0xf4240,%esi
setl   %al
and    %cl,%al
movzbl %al,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i32 @__is_timeval_valid_timeout(i64 %0, i32 %1) {
%3 = alloca %struct.timeval
%4 = bitcast %struct.timeval* %3 to { i64, i32 }*
%5 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %4, i32 0, i32 0
store i64 %0, i64* %5
%6 = getelementptr inbounds { i64, i32 }, { i64, i32 }* %4, i32 0, i32 1
store i32 %1, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
%8 = load i64, i64* %7
%9 = icmp sge i64 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%12 = load i32, i32* %11
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
%16 = load i32, i32* %15
%17 = icmp slt i32 %16, 1000000
br label %18
18: ; preds = %14, %10, %2
%19 = phi i1 [ false, %10 ], [ false, %2 ], [ %17, %14 ]
%20 = zext i1 %19 to i32
ret i32 %20
}

LLVM IR (-O2):
define i32 @__is_timeval_valid_timeout(i64 %0, i32 %1) {
%3 = icmp sgt i64 %0, -1
%4 = icmp sgt i32 %1, -1
%5 = select i1 %3, i1 %4, i1 false
%6 = icmp slt i32 %1, 1000000
%7 = select i1 %5, i1 %6, i1 false
%8 = zext i1 %7 to i32
ret i32 %8
}
const char *VID_MenuKey(int k) { return ((void *)0); }


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

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

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

LLVM IR (-O2):
define noalias i8* @VID_MenuKey(i32 %0) {
ret i8* null
}
void write_global_settings() {}


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

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

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

LLVM IR (-O2):
define void @write_global_settings() {
ret void
}
/* Variables and functions */
int comp_uni(char const *, char const *, int, int);
int comp_size(const char *a, const char *b) { return comp_uni(a, b, 100, 10); }


x86 assembly (clang, -O0):
<comp_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x64,%edx
mov    $0xa,%ecx
call   1030 <comp_uni@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_size>:
mov    $0x64,%edx
mov    $0xa,%ecx
jmp    1030 <comp_uni@plt>

LLVM IR (-O0):
define i32 @comp_size(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 @comp_uni(i8* %5, i8* %6, i32 100, i32 10)
ret i32 %7
}

LLVM IR (-O2):
define i32 @comp_size(i8* %0, i8* %1) {
%3 = tail call i32 @comp_uni(i8* %0, i8* %1, i32 100, i32 10)
ret i32 %3
}
/* Variables and functions */
int fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int c_save() { return fputs("[s", stdout); }


x86 assembly (clang, -O0):
<c_save>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%esi
lea    0xedc(%rip),%rdi
call   1030 <fputs@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_save>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[s\00"
@stdout = global i32 0
define i32 @c_save() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[s\00"
@stdout = global i32 0
define i32 @c_save() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
int cmock_expectcalls_eq(int expectCalls, int called) {
  if (called < expectCalls) {
    return (0x01);
  } else if (called == expectCalls) {
    return (0x02);
  } else {
    return (0x03);
  }
}


x86 assembly (clang, -O0):
<cmock_expectcalls_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1122 <cmock_expectcalls_eq+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1141 <cmock_expectcalls_eq+0x41>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113a <cmock_expectcalls_eq+0x3a>
movl   $0x2,-0x4(%rbp)
jmp    1141 <cmock_expectcalls_eq+0x41>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmock_expectcalls_eq>:
xor    %ecx,%ecx
cmp    %edi,%esi
sete   %cl
xor    $0x3,%ecx
cmp    %edi,%esi
mov    $0x1,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmock_expectcalls_eq(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* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = load i32, i32* %4
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10
store i32 2, i32* %3
br label %16
15: ; preds = %10
store i32 3, i32* %3
br label %16
16: ; preds = %15, %14, %9
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @cmock_expectcalls_eq(i32 %0, i32 %1) {
%3 = icmp slt i32 %1, %0
%4 = icmp eq i32 %1, %0
%5 = select i1 %4, i32 2, i32 3
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
int main() {
  int *x, *y;
  int *res = &x;
  res = noprotofun(&x + 1, &y);
  if (res != &x + 1) {
    {
      printf("Error %d\n", (int)1);
      exit(1);
    };
  }
  {
    printf("Success\n");
    exit(0);
  };
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rdi
add    $0x8,%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1030 <noprotofun@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
lea    -0x10(%rbp),%rcx
add    $0x8,%rcx
cmp    %rcx,%rax
je     1192 <main+0x62>
lea    0xe84(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <noprotofun@plt>
cltq
cmp    %rbx,%rax
jne    1171 <main+0x31>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>
lea    0xe88(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Error %d\0A\00"
@.str.1 = [9 x i8] c"Success\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = bitcast i32** %2 to i32*
store i32* %5, i32** %4
%6 = getelementptr inbounds i32*, i32** %2, i64 1
%7 = call i32 (i32**, i32**, ...) bitcast (i32 (...)* @noprotofun to i32 (i32**, i32**, ...)*)(i32** %6, i32** %3)
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %4
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32*, i32** %2, i64 1
%12 = bitcast i32** %11 to i32*
%13 = icmp ne i32* %10, %12
br i1 %13, label %14, label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
unreachable
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
unreachable
}

LLVM IR (-O2):
@.str = [10 x i8] c"Error %d\0A\00"
@str = [8 x i8] c"Success\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = bitcast i32** %1 to i8*
%4 = bitcast i32** %2 to i8*
%5 = getelementptr inbounds i32*, i32** %1, i64 1
%6 = call i32 (i32**, i32**, ...) bitcast (i32 (...)* @noprotofun to i32 (i32**, i32**, ...)*)(i32** %5, i32** %2)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = bitcast i32** %5 to i32*
%10 = icmp eq i32* %8, %9
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
unreachable
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ parameters(int, char);
main() {
  int num = 5;
  char letter = 'A';
  parameters(num, letter);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 5, i32* %1
store i8 65, i8* %2
%3 = load i32, i32* %1
%4 = load i8, i8* %2
%5 = call i32 @parameters(i32 %3, i8 signext %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @parameters(i32 5, i8 signext 65)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int usage(const char argv0[]) {
  fprintf(stderr,
          "Usage: %s -m mx[,my[,mz]] [-L Lx[,Ly[,Lz]]] [-n iterations] [-w "
          "omega] [-v]\n",
          argv0);
  return 1;
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [77 x i8] c"Usage: %s -m mx[,my[,mz]] [-L Lx[,Ly[,Lz]]] [-n iterations] [-w omega] [-v]\0A\00"
define i32 @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [77 x i8] c"Usage: %s -m mx[,my[,mz]] [-L Lx[,Ly[,Lz]]] [-n iterations] [-w omega] [-v]\0A\00"
define i32 @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 1
}
int checkLoop(int source) {
  static int FLAG = 0;
  if (source == 0) {
    FLAG = 1;
  }
  if (source == 1) {
    return FLAG;
  }
  return -1;
}


x86 assembly (clang, -O0):
<checkLoop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111b <checkLoop+0x1b>
movl   $0x1,0x2f09(%rip)
cmpl   $0x1,-0x8(%rbp)
jne    1133 <checkLoop+0x33>
mov    0x2ef9(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <checkLoop+0x3a>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkLoop>:
cmp    $0x1,%edi
je     1116 <checkLoop+0x16>
mov    $0xffffffff,%eax
test   %edi,%edi
jne    111d <checkLoop+0x1d>
movb   $0x1,0x2f0f(%rip)
ret
movzbl 0x2f07(%rip),%eax
ret

LLVM IR (-O0):
@checkLoop.FLAG = internal global i32 0
define i32 @checkLoop(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* @checkLoop.FLAG
br label %7
7: ; preds = %6, %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = load i32, i32* @checkLoop.FLAG
store i32 %11, i32* %2
br label %13
12: ; preds = %7
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %10
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@checkLoop.FLAG = internal unnamed_addr global i1 false
define i32 @checkLoop(i32 %0) {
switch i32 %0, label %6 [
i32 0, label %2
i32 1, label %3
]
2: ; preds = %1
store i1 true, i1* @checkLoop.FLAG
br label %6
3: ; preds = %1
%4 = load i1, i1* @checkLoop.FLAG
%5 = zext i1 %4 to i32
br label %6
6: ; preds = %2, %1, %3
%7 = phi i32 [ %5, %3 ], [ -1, %1 ], [ -1, %2 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *applet(char *const);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void usage(FILE *f, char *const arg0) {
  fprintf(f,
          "Usage: %s [OPTIONS] DEVICE\n\n"
          "Options:\n"
          " -t or --timeout SECOND Set time-out in seconds [default=-1].\n"
          " -s or --script         Set script [default=/usr/share/reboot].\n"
          " -v or --verbose        Turn on verbosity.\n"
          " -V or --version        Display the version.\n"
          " -h or --help           Display this message.\n"
          "",
          applet(arg0));
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <applet@plt>
mov    -0x18(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb1(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <applet@plt>
lea    0xecd(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@.str = [298 x i8] c"Usage: %s [OPTIONS] DEVICE\0A\0AOptions:\0A -t or --timeout SECOND Set time-out in seconds [default=-1].\0A -s or --script Set script [default=/usr/share/reboot].\0A -v or --verbose Turn on verbosity.\0A -V or --version Display the version.\0A -h or --help Display this message.\0A\00"
define void @usage(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 = load i8*, i8** %4
%7 = call i8* @applet(i8* %6)
%8 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([298 x i8], [298 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@.str = [298 x i8] c"Usage: %s [OPTIONS] DEVICE\0A\0AOptions:\0A -t or --timeout SECOND Set time-out in seconds [default=-1].\0A -s or --script Set script [default=/usr/share/reboot].\0A -v or --verbose Turn on verbosity.\0A -V or --version Display the version.\0A -h or --help Display this message.\0A\00"
define void @usage(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @applet(i8* %1)
%4 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([298 x i8], [298 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}
/* Variables and functions */
int rand();
int gerar_aleatorio(char lugar) {
  int r;
  if (lugar == 'L') {
    r = 1 + rand() % (6 - 2);
  } else if (lugar == 'C') {
    r = 1 + rand() % (6 - 2);
  }
  return r;
}


x86 assembly (clang, -O0):
<gerar_aleatorio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x4c,%eax
jne    1145 <gerar_aleatorio+0x35>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
jmp    116c <gerar_aleatorio+0x5c>
movsbl -0x1(%rbp),%eax
cmp    $0x43,%eax
jne    1167 <gerar_aleatorio+0x57>
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
jmp    116c <gerar_aleatorio+0x5c>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gerar_aleatorio>:
cmp    $0x4c,%dil
je     111c <gerar_aleatorio+0xc>
cmp    $0x43,%dil
jne    113a <gerar_aleatorio+0x2a>
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @gerar_aleatorio(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 76
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 4
%10 = add nsw i32 1, %9
store i32 %10, i32* %3
br label %20
11: ; preds = %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 67
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 4
%18 = add nsw i32 1, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %11
br label %20
20: ; preds = %19, %7
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @gerar_aleatorio(i8 signext %0) {
switch i8 %0, label %6 [
i8 76, label %2
i8 67, label %2
]
2: ; preds = %1, %1
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 4
%5 = add nsw i32 %4, 1
br label %6
6: ; preds = %2, %1
%7 = phi i32 [ undef, %1 ], [ %5, %2 ]
ret i32 %7
}
/* Variables and functions */
int tcpDelayCtl(char *, int, int /*<<< orphan*/);
int disableTcpNoDelay(char *err, int fd) { return tcpDelayCtl(err, fd, 0); }


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

x86 assembly (clang, -O2):
<disableTcpNoDelay>:
xor    %edx,%edx
jmp    1030 <tcpDelayCtl@plt>

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

LLVM IR (-O2):
define i32 @disableTcpNoDelay(i8* %0, i32 %1) {
%3 = tail call i32 @tcpDelayCtl(i8* %0, i32 %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int f288(int *);
int f289(int *p) { return f288(p); }


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

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

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

LLVM IR (-O2):
define i32 @f289(i32* %0) {
%2 = tail call i32 @f288(i32* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, size_t);
size_t j64_false_encode(char *buf, size_t len) {
  len = ((len) < (5) ? (len) : (5));
  memcpy(buf, "false", len);
  return len;
}


x86 assembly (clang, -O0):
<j64_false_encode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x5,-0x10(%rbp)
jae    1138 <j64_false_encode+0x28>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_false_encode+0x36>
mov    $0x5,%eax
mov    %rax,-0x18(%rbp)
jmp    1146 <j64_false_encode+0x36>
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xea3(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j64_false_encode>:
push   %rbx
cmp    $0x5,%rsi
mov    $0x5,%ebx
cmovb  %rsi,%rbx
lea    0xedb(%rip),%rsi
mov    %rbx,%rdx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"false\00"
define i64 @j64_false_encode(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ult i64 %5, 5
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i64, i64* %4
br label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %7
%11 = phi i64 [ %8, %7 ], [ 5, %9 ]
store i64 %11, i64* %4
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i32 @memcpy(i8* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %13)
%15 = load i64, i64* %4
ret i64 %15
}

LLVM IR (-O2):
@.str = [6 x i8] c"false\00"
define i64 @j64_false_encode(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 5
%4 = select i1 %3, i64 %1, i64 5
%5 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %4)
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void err_use(const char *progname) {
  fprintf(stderr, "Usage: %s [-d]\n", progname);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<err_use>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<err_use>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s [-d]\0A\00"
@EXIT_FAILURE = global i32 0
define void @err_use(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @EXIT_FAILURE
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Usage: %s [-d]\0A\00"
@EXIT_FAILURE = global i32 0
define void @err_use(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @EXIT_FAILURE
%5 = tail call i32 @exit(i32 %4)
unreachable
}
int test_imm_50int16_mem(short *val) {
  return ((*val) & (0x50 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_50int16_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, 80
%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_50int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 80
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
char *langDbgDevFdcMicrosol() { return "Microsol FDC"; }


x86 assembly (clang, -O0):
<langDbgDevFdcMicrosol>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Microsol FDC\00"
define i8* @langDbgDevFdcMicrosol() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [13 x i8] c"Microsol FDC\00"
define i8* @langDbgDevFdcMicrosol() {
ret i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0)
}