xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_conditions(void) {
  fprintf(stderr, "\n");
  fprintf(stderr, "see the License file in the directory or see "
                  "<http://www.gnu.org/licenses/");
  fprintf(stderr, "\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<print_conditions>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xeb9(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xea2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_conditions>:
push   %r14
push   %rbx
push   %rax
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [75 x i8] c"see the License file in the directory or see <http://www.gnu.org/licenses/\00"
@EXIT_FAILURE = global i32 0
define void @print_conditions() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [2 x i8] c"\0A\00"
@.str.1 = [75 x i8] c"see the License file in the directory or see <http://www.gnu.org/licenses/\00"
@EXIT_FAILURE = global i32 0
define void @print_conditions() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void deny(void) { printf("Which nobody can deny!\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"Which nobody can deny!\0A\00"
define void @deny() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [23 x i8] c"Which nobody can deny!\00"
define void @deny() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int quadrado(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n = 0;
  while (1 == 1) {
    scanf("%d", &n);
    if (n == 0)
      break;
    printf("%d\n", quadrado(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    1165 <main+0x35>
jmp    1180 <main+0x50>
mov    -0x8(%rbp),%edi
call   1030 <quadrado@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xeb8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1192 <main+0x62>
lea    0xea2(%rip),%r14
lea    0xe98(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   (%rax)
call   1030 <quadrado@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%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 eq i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ %4, %0 ]
%8 = call i32 @quadrado(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %6
13: ; preds = %6, %0
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_push_front(struct list_head *, struct list_head *);
int /*<<< orphan*/ sys_list_del_node(struct list_head *);
void list_move_to_front(struct list_head *node, struct list_head *head) {
  sys_list_del_node(node);
  list_push_front(node, head);
}


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

x86 assembly (clang, -O2):
<list_move_to_front>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <sys_list_del_node@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <list_push_front@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_move_to_front(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @sys_list_del_node(%struct.list_head* %5)
%7 = load %struct.list_head*, %struct.list_head** %3
%8 = load %struct.list_head*, %struct.list_head** %4
%9 = call i32 @list_push_front(%struct.list_head* %7, %struct.list_head* %8)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_move_to_front(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @sys_list_del_node(%struct.list_head* %0)
%4 = tail call i32 @list_push_front(%struct.list_head* %0, %struct.list_head* %1)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void write_quad(uint8_t *ptr, uint32_t value) {
  ptr[0] = value;
  ptr[1] = value >> 8;
  ptr[2] = value >> 16;
  ptr[3] = value >> 24;
}


x86 assembly (clang, -O0):
<write_quad>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_quad>:
mov    %esi,(%rdi)
mov    %esi,%eax
sar    $0x8,%eax
mov    %eax,0x4(%rdi)
mov    %esi,%eax
sar    $0x10,%eax
mov    %eax,0x8(%rdi)
sar    $0x18,%esi
mov    %esi,0xc(%rdi)
ret

LLVM IR (-O0):
define void @write_quad(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
store i32 %5, i32* %7
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32, i32* %4
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %3
%15 = getelementptr inbounds i32, i32* %14, i64 2
store i32 %13, i32* %15
%16 = load i32, i32* %4
%17 = ashr i32 %16, 24
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @write_quad(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
%3 = ashr i32 %1, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %4
%5 = ashr i32 %1, 16
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %5, i32* %6
%7 = ashr i32 %1, 24
%8 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %7, i32* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void f3(int a[1]) {
  if (*a != 222222) {
    abort();
  }
  *a = 333333;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x3640e,(%rax)
je     1133 <f3+0x23>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
movl   $0x51615,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rax
cmpl   $0x3640e,(%rdi)
jne    1121 <f3+0x11>
movl   $0x51615,(%rdi)
pop    %rax
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @f3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 222222
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 (...) @abort()
unreachable
8: ; preds = %1
%9 = load i32*, i32** %2
store i32 333333, i32* %9
ret void
}

LLVM IR (-O2):
define void @f3(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp eq i32 %2, 222222
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
store i32 333333, i32* %0
ret void
}
unsigned long atolz(char *s) {
  unsigned long val;
  int c;
  if (*s == '-')
    return 1;
  val = 0;
  while (1) {
    c = *s++;
    if (c < '0' || c > '9')
      return val;
    val = val * 10 + c - '0';
  }
  return 1;
}


x86 assembly (clang, -O0):
<atolz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1125 <atolz+0x25>
movq   $0x1,-0x8(%rbp)
jmp    117c <atolz+0x7c>
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x30,-0x1c(%rbp)
jl     1156 <atolz+0x56>
cmpl   $0x39,-0x1c(%rbp)
jle    1163 <atolz+0x63>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <atolz+0x7c>
imul   $0xa,-0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x18(%rbp)
jmp    112d <atolz+0x2d>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atolz>:
mov    (%rdi),%cl
mov    $0x1,%eax
cmp    $0x2d,%cl
je     113e <atolz+0x3e>
lea    -0x3a(%rcx),%eax
cmp    $0xf6,%al
jae    1116 <atolz+0x16>
xor    %eax,%eax
ret
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
lea    (%rax,%rax,4),%rax
movzbl %cl,%ecx
lea    (%rcx,%rax,2),%rax
add    $0xffffffffffffffd0,%rax
movzbl (%rdi),%ecx
lea    -0x3a(%rcx),%edx
add    $0x1,%rdi
cmp    $0xf5,%dl
ja     1120 <atolz+0x20>
ret

LLVM IR (-O0):
define i64 @atolz(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 1, i64* %2
br label %31
11: ; preds = %1
store i64 0, i64* %4
br label %12
12: ; preds = %11, %24
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %3
%15 = load i8, i8* %13
%16 = sext i8 %15 to i32
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = icmp slt i32 %17, 48
br i1 %18, label %22, label %19
19: ; preds = %12
%20 = load i32, i32* %5
%21 = icmp sgt i32 %20, 57
br i1 %21, label %22, label %24
22: ; preds = %19, %12
%23 = load i64, i64* %4
store i64 %23, i64* %2
br label %31
24: ; preds = %19
%25 = load i64, i64* %4
%26 = mul i64 %25, 10
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = add i64 %26, %28
%30 = sub i64 %29, 48
store i64 %30, i64* %4
br label %12
31: ; preds = %22, %10
%32 = load i64, i64* %2
ret i64 %32
}

LLVM IR (-O2):
define i64 @atolz(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
br i1 %3, label %19, label %4
4: ; preds = %1
%5 = add i8 %2, -58
%6 = icmp ult i8 %5, -10
br i1 %6, label %19, label %7
7: ; preds = %4, %7
%8 = phi i8 [ %16, %7 ], [ %2, %4 ]
%9 = phi i64 [ %15, %7 ], [ 0, %4 ]
%10 = phi i8* [ %11, %7 ], [ %0, %4 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = mul i64 %9, 10
%13 = zext i8 %8 to i64
%14 = add i64 %12, -48
%15 = add i64 %14, %13
%16 = load i8, i8* %11
%17 = add i8 %16, -58
%18 = icmp ult i8 %17, -10
br i1 %18, label %19, label %7
19: ; preds = %7, %4, %1
%20 = phi i64 [ 1, %1 ], [ 0, %4 ], [ %15, %7 ]
ret i64 %20
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t crc32c_ppc(uint32_t crc, unsigned char const *data, unsigned len) {
  return 0;
}


x86 assembly (clang, -O0):
<crc32c_ppc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @crc32c_ppc(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @crc32c_ppc(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int my_str_islower(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    if (!(str[i] >= 'a' && str[i] <= 'z'))
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <my_str_islower+0x68>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x61,%eax
jl     114e <my_str_islower+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7a,%eax
jle    115a <my_str_islower+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    116f <my_str_islower+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_islower+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_islower>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_islower+0x23>
add    $0x1,%rdi
nop
add    $0x9f,%cl
cmp    $0x1a,%cl
jae    1124 <my_str_islower+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_islower+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_islower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -97
%12 = icmp ult i8 %11, 26
%13 = add nuw i64 %9, 1
br i1 %12, label %4, label %14
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void wrz_32(uint32_t addr, uint32_t data) { *((uint32_t *)addr) = data; }


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

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

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

LLVM IR (-O2):
define void @wrz_32(i64 %0, i64 %1) {
%3 = inttoptr i64 %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compile_expresions(char *, char *);
int prepare() {
  compile_expresions(
      "(m=[a-z]+ [0-9]{1,5} )",
      "(c=IN IP4 [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}( |\n|\r))");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"(m=[a-z]+ [0-9]{1,5} )\00"
@.str.1 = [62 x i8] c"(c=IN IP4 [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}( |\0A|\0D))\00"
define i32 @prepare() {
%1 = call i32 @compile_expresions(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"(m=[a-z]+ [0-9]{1,5} )\00"
@.str.1 = [62 x i8] c"(c=IN IP4 [0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}( |\0A|\0D))\00"
define i32 @prepare() {
%1 = tail call i32 @compile_expresions(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ write(int, char *, int);
void _Unwind_SetIP() {
  char msg[] = "Aborting: "
               "_Unwind_SetIP"
               " called "
               "(C++ exception handling is disabled)\n";
  write(2, msg, sizeof(msg) - 1);
  abort();
}


x86 assembly (clang, -O0):
<_Unwind_SetIP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x45,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2,%edi
mov    $0x44,%edx
call   1040 <write@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<_Unwind_SetIP>:
sub    $0x48,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0xa2964656c6261,%rax
mov    %rax,0x3d(%rsp)
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x44,%edx
call   1040 <write@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@__const._Unwind_SetIP.msg = [69 x i8] c"Aborting: _Unwind_SetIP called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_SetIP() {
%1 = alloca [69 x i8]
%2 = bitcast [69 x i8]* %1 to i8*
%3 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 0, i64 0
%4 = call i32 @write(i32 2, i8* %3, i32 68)
%5 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@__const._Unwind_SetIP.msg = [69 x i8] c"Aborting: _Unwind_SetIP called (C++ exception handling is disabled)\0A\00"
define void @_Unwind_SetIP() {
%1 = alloca [69 x i8]
%2 = getelementptr inbounds [69 x i8], [69 x i8]* %1, i64 0, i64 0
%3 = call i32 @write(i32 2, i8* %2, i32 68)
%4 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
void Parrot_sleep(unsigned int seconds) { sleep(seconds); }


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

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

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

LLVM IR (-O2):
define void @Parrot_sleep(i32 %0) {
%2 = tail call i32 @sleep(i32 %0)
ret void
}
void cprop_result9(int *data) {
  int i;
  int stop = data[0];
  for (i = 1; i < stop; i++)
    ;
  data[1] = 21;
  data[2] = i;
}


x86 assembly (clang, -O0):
<cprop_result9>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1137 <cprop_result9+0x37>
jmp    1129 <cprop_result9+0x29>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1118 <cprop_result9+0x18>
mov    -0x8(%rbp),%rax
movl   $0x15,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<cprop_result9>:
mov    (%rdi),%eax
cmp    $0x2,%eax
mov    $0x1,%ecx
cmovge %eax,%ecx
movl   $0x15,0x4(%rdi)
mov    %ecx,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @cprop_result9(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = call i32 @llvm.smax.i32(i32 %2, i32 1)
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 21, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %3, i32* %5
ret void
}
int main(void) {
  int counter = 0;
  while (counter < 5) {
    counter++;
  }
  while (counter < 10) {
    counter++;
  }
  while (counter < 15) {
    counter++;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    112a <main+0x2a>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1112 <main+0x12>
jmp    112f <main+0x2f>
cmpl   $0xa,-0x8(%rbp)
jge    1147 <main+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112f <main+0x2f>
jmp    114c <main+0x4c>
cmpl   $0xf,-0x8(%rbp)
jge    1164 <main+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114c <main+0x4c>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int FileExists(const char *filename) {
  FILE *f = fopen(filename, "rb");
  if (f == NULL)
    return 0;
  fclose(f);
  return 1;
}


x86 assembly (clang, -O0):
<FileExists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1157 <FileExists+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1167 <FileExists+0x47>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileExists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <FileExists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @FileExists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Die(char *, size_t, char *, int);
void *realloc(void *, size_t);
void *sre_realloc(char *file, int line, void *p, size_t size) {
  void *ptr;
  if ((ptr = realloc(p, size)) == NULL)
    Die("realloc of %ld bytes failed: file %s line %d", size, file, line);
  return ptr;
}


x86 assembly (clang, -O0):
<sre_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1169 <sre_realloc+0x49>
mov    -0x20(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xe9c(%rip),%rdi
call   1030 <Die@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sre_realloc>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbx
mov    %esi,%r14d
mov    %rdi,%r15
mov    %rdx,%rdi
mov    %rcx,%rsi
call   1040 <realloc@plt>
mov    %rax,%rbp
test   %rax,%rax
jne    1158 <sre_realloc+0x38>
lea    0xeb6(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <Die@plt>
mov    %rbp,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [45 x i8] c"realloc of %ld bytes failed: file %s line %d\00"
define i8* @sre_realloc(i8* %0, i32 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%10 = load i8*, i8** %7
%11 = load i64, i64* %8
%12 = call i8* @realloc(i8* %10, i64 %11)
store i8* %12, i8** %9
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %19
14: ; preds = %4
%15 = load i64, i64* %8
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = call i32 @Die(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %15, i8* %16, i32 %17)
br label %19
19: ; preds = %14, %4
%20 = load i8*, i8** %9
ret i8* %20
}

LLVM IR (-O2):
@.str = [45 x i8] c"realloc of %ld bytes failed: file %s line %d\00"
define noalias i8* @sre_realloc(i8* %0, i32 %1, i8* nocapture %2, i64 %3) {
%5 = tail call i8* @realloc(i8* %2, i64 %3)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 @Die(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i64 %3, i8* %0, i32 %1)
br label %9
9: ; preds = %7, %4
ret i8* %5
}
void ux500_ci_dbg_wake_latency(int ctarget, int sleep_time) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define void @ux500_ci_dbg_wake_latency(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int isLegal(int startAddr, int length) {
  if (startAddr < 0) {
    printf("-------startAddr CANNOT be lower than 0.\n");
    return 0;
  } else if (length < 1) {
    printf("-------length CANNOT be smaller than 1.\n");
    return 0;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<isLegal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1140 <isLegal+0x30>
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1169 <isLegal+0x59>
cmpl   $0x1,-0xc(%rbp)
jge    1162 <isLegal+0x52>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1169 <isLegal+0x59>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLegal>:
test   %edi,%edi
js     111e <isLegal+0xe>
mov    $0x1,%eax
test   %esi,%esi
jle    1127 <isLegal+0x17>
ret
lea    0xf03(%rip),%rdi
jmp    112e <isLegal+0x1e>
lea    0xed2(%rip),%rdi
push   %rax
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c"-------startAddr CANNOT be lower than 0.\0A\00"
@.str.1 = [41 x i8] c"-------length CANNOT be smaller than 1.\0A\00"
define i32 @isLegal(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 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %16
10: ; preds = %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %16
15: ; preds = %10
store i32 1, i32* %3
br label %16
16: ; preds = %15, %13, %8
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@str = [40 x i8] c"-------length CANNOT be smaller than 1.\00"
@str.2 = [41 x i8] c"-------startAddr CANNOT be lower than 0.\00"
define i32 @isLegal(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp slt i32 %1, 1
br i1 %5, label %6, label %9
6: ; preds = %4, %2
%7 = phi i8* [ getelementptr inbounds ([41 x i8], [41 x i8]* @str.2, i64 0, i64 0), %2 ], [ getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0), %4 ]
%8 = tail call i32 @puts(i8* dereferenceable(1) %7)
br label %9
9: ; preds = %6, %4
%10 = phi i32 [ 1, %4 ], [ 0, %6 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ sqr(double);
int sqrt(scalar_t__);
double calc_gamma(double beta) { return 1 / sqrt(1 - sqr(beta)); }


x86 assembly (clang, -O0):
<calc_gamma>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqr@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_gamma>:
push   %rax
call   1030 <sqr@plt>
mov    $0x1,%edi
sub    %rax,%rdi
call   1040 <sqrt@plt>
lea    0x1(%rax),%ecx
xor    %edx,%edx
cmp    $0x3,%ecx
cmovb  %eax,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @calc_gamma(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @sqr(double %3)
%5 = sub nsw i64 1, %4
%6 = call i32 @sqrt(i64 %5)
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @calc_gamma(double %0) {
%2 = tail call i64 @sqr(double %0)
%3 = sub nsw i64 1, %2
%4 = tail call i32 @sqrt(i64 %3)
%5 = add i32 %4, 1
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
void LedsP$Led0$set(void) { ReverseGPIOP$0$Out$set(); }


x86 assembly (clang, -O0):
<LedsP$Led0$set>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ReverseGPIOP$0$Out$set@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedsP$Led0$set>:
xor    %eax,%eax
jmp    1030 <ReverseGPIOP$0$Out$set@plt>

LLVM IR (-O0):
define void @"LedsP$Led0$set"() {
%1 = call i32 (...) @"ReverseGPIOP$0$Out$set"()
ret void
}

LLVM IR (-O2):
define void @"LedsP$Led0$set"() {
%1 = tail call i32 (...) @"ReverseGPIOP$0$Out$set"()
ret void
}
/* Variables and functions */
int __get_array_size(char const *);
int __infer_nondet_int();
int unlink(const char *filename) {
  int size1;
  int success = __infer_nondet_int();
  size1 = __get_array_size(filename);
  return (success > 0) ? 0 : -1;
}


x86 assembly (clang, -O0):
<unlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__get_array_size@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edx
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovg  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unlink>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1040 <__get_array_size@plt>
xor    %eax,%eax
test   %ebp,%ebp
setle  %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @unlink(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = call i32 (...) @__infer_nondet_int()
store i32 %5, i32* %4
%6 = load i8*, i8** %2
%7 = call i32 @__get_array_size(i8* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 0, i32 -1
ret i32 %11
}

LLVM IR (-O2):
define i32 @unlink(i8* %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
%3 = tail call i32 @__get_array_size(i8* %0)
%4 = icmp slt i32 %2, 1
%5 = sext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int geteuid();
int getuid();
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  printf("real uid=%d, effective uid=%d\n", getuid(), geteuid());
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <geteuid@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <getuid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <geteuid@plt>
lea    0xea8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"real uid=%d, effective uid=%d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @getuid()
%3 = call i32 (...) @geteuid()
%4 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [31 x i8] c"real uid=%d, effective uid=%d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getuid()
%2 = tail call i32 (...) @geteuid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%4 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_8Auint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x8A << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_8Auint64_highword_reg>:
movabs $0x8a00000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Auint64_highword_reg(i64 %0) {
%2 = and i64 %0, 592705486848
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void tcp_syn(struct Seaper *seap, struct NetFrame *frame) {
  seap;
  frame;
}


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

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

LLVM IR (-O0):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @tcp_syn(%struct.Seaper* %0, %struct.NetFrame* %1) {
%3 = alloca %struct.Seaper*
%4 = alloca %struct.NetFrame*
store %struct.Seaper* %0, %struct.Seaper** %3
store %struct.NetFrame* %1, %struct.NetFrame** %4
%5 = load %struct.Seaper*, %struct.Seaper** %3
%6 = load %struct.NetFrame*, %struct.NetFrame** %4
ret void
}

LLVM IR (-O2):
%struct.Seaper = type opaque
%struct.NetFrame = type opaque
define void @tcp_syn(%struct.Seaper* nocapture %0, %struct.NetFrame* nocapture %1) {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int check_mem(char *mem) {
  if (!mem) {
    printf("Memory error\n");
    return EXIT_FAILURE;
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<check_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1144 <check_mem+0x34>
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1150 <check_mem+0x40>
mov    0x2e8d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_mem>:
push   %rax
test   %rdi,%rdi
je     111f <check_mem+0xf>
mov    0x2ebb(%rip),%rax
jmp    1132 <check_mem+0x22>
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Memory error\0A\00"
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @check_mem(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
store i32 %8, i32* %2
br label %11
9: ; preds = %1
%10 = load i32, i32* @EXIT_SUCCESS
store i32 %10, i32* %2
br label %11
11: ; preds = %9, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
@str = [13 x i8] c"Memory error\00"
define i32 @check_mem(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %1, %3
%6 = phi i32* [ @EXIT_FAILURE, %3 ], [ @EXIT_SUCCESS, %1 ]
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void strcpy_overflow(char *y) {
  char x[4];
  if (strlen(y) == 4)
    strcpy(x, y);
}


x86 assembly (clang, -O0):
<strcpy_overflow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    114b <strcpy_overflow+0x2b>
lea    -0xc(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy_overflow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    $0x4,%eax
jne    113f <strcpy_overflow+0x1f>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @strcpy_overflow(i8* %0) {
%2 = alloca i8*
%3 = alloca [4 x i8]
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = icmp eq i32 %5, 4
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @strcpy_overflow(i8* %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @strcpy(i8* %3, i8* %0)
br label %8
8: ; preds = %6, %1
ret void
}
void g_utf8_collate() {}


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

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

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

LLVM IR (-O2):
define void @g_utf8_collate() {
ret void
}
/* Variables and functions */
char __strnlen(int);
int strlen(char *);
char *strnlen(char *str) {
  int i;
  for (i = 0; i < strlen(str); i++) {
    str[i] = __strnlen((int)str[i]);
  }
  return str;
}


x86 assembly (clang, -O0):
<strnlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <strnlen+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <__strnlen@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strnlen+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strnlen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <strnlen+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <__strnlen@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <strnlen+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strnlen(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1, %4
%5 = phi i64 [ %10, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call signext i8 @__strnlen(i32 %8)
store i8 %9, i8* %6
%10 = add nuw nsw i64 %5, 1
%11 = tail call i32 @strlen(i8* %0)
%12 = sext i32 %11 to i64
%13 = icmp slt i64 %10, %12
br i1 %13, label %4, label %14
14: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
struct lrt_trans {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ lrt_trans_gt2id(struct lrt_trans *);
struct lrt_trans *lrt_trans_id2lt(int /*<<< orphan*/);
struct lrt_trans *lrt_trans_gt2lt(struct lrt_trans *gt) {
  return lrt_trans_id2lt(lrt_trans_gt2id(gt));
}


x86 assembly (clang, -O0):
<lrt_trans_gt2lt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <lrt_trans_gt2id@plt>
mov    %eax,%edi
call   1030 <lrt_trans_id2lt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lrt_trans_gt2lt>:
push   %rax
call   1040 <lrt_trans_gt2id@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <lrt_trans_id2lt@plt>

LLVM IR (-O0):
%struct.lrt_trans = type { i32 }
define %struct.lrt_trans* @lrt_trans_gt2lt(%struct.lrt_trans* %0) {
%2 = alloca %struct.lrt_trans*
store %struct.lrt_trans* %0, %struct.lrt_trans** %2
%3 = load %struct.lrt_trans*, %struct.lrt_trans** %2
%4 = call i32 @lrt_trans_gt2id(%struct.lrt_trans* %3)
%5 = call %struct.lrt_trans* @lrt_trans_id2lt(i32 %4)
ret %struct.lrt_trans* %5
}

LLVM IR (-O2):
%struct.lrt_trans = type { i32 }
define %struct.lrt_trans* @lrt_trans_gt2lt(%struct.lrt_trans* %0) {
%2 = tail call i32 @lrt_trans_gt2id(%struct.lrt_trans* %0)
%3 = tail call %struct.lrt_trans* @lrt_trans_id2lt(i32 %2)
ret %struct.lrt_trans* %3
}