xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ test_cmp();
int /*<<< orphan*/ test_encdec();
int /*<<< orphan*/ test_int();
int /*<<< orphan*/ test_real();
int /*<<< orphan*/ test_string();
int /*<<< orphan*/ test_to_str();
int main(void) {
  test_int();
  test_real();
  test_string();
  test_encdec();
  test_to_str();
  test_cmp();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1080 <test_int@plt>
mov    $0x0,%al
call   1030 <test_real@plt>
mov    $0x0,%al
call   1050 <test_string@plt>
mov    $0x0,%al
call   1060 <test_encdec@plt>
mov    $0x0,%al
call   1040 <test_to_str@plt>
mov    $0x0,%al
call   1070 <test_cmp@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1080 <test_int@plt>
xor    %eax,%eax
call   1030 <test_real@plt>
xor    %eax,%eax
call   1050 <test_string@plt>
xor    %eax,%eax
call   1060 <test_encdec@plt>
xor    %eax,%eax
call   1040 <test_to_str@plt>
xor    %eax,%eax
call   1070 <test_cmp@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @test_int()
%3 = call i32 (...) @test_real()
%4 = call i32 (...) @test_string()
%5 = call i32 (...) @test_encdec()
%6 = call i32 (...) @test_to_str()
%7 = call i32 (...) @test_cmp()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_int()
%2 = tail call i32 (...) @test_real()
%3 = tail call i32 (...) @test_string()
%4 = tail call i32 (...) @test_encdec()
%5 = tail call i32 (...) @test_to_str()
%6 = tail call i32 (...) @test_cmp()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printArray(int array[], int arrayLen) {
  int i;
  for (i = 0; i < arrayLen; i++) {
    printf("%d ", array[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <printArray+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <printArray+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <printArray+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <printArray+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printArray(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @printArray(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
int security_init(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @security_init() {
ret i32 0
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createOrExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x02, expression1, expression2);
}


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

x86 assembly (clang, -O2):
<createOrExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <createExpression@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createOrExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = alloca %struct.memorycontainer*
%4 = alloca %struct.memorycontainer*
store %struct.memorycontainer* %0, %struct.memorycontainer** %3
store %struct.memorycontainer* %1, %struct.memorycontainer** %4
%5 = load %struct.memorycontainer*, %struct.memorycontainer** %3
%6 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%7 = call %struct.memorycontainer* @createExpression(i32 2, %struct.memorycontainer* %5, %struct.memorycontainer* %6)
ret %struct.memorycontainer* %7
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createOrExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 2, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
int is_end(char c) { return (c == 46 || c == 63 || c == 33) ? 1 : 0; }


x86 assembly (clang, -O0):
<is_end>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2e,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_end+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x3f,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_end+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x21,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_end>:
mov    $0x1,%eax
cmp    $0x2e,%dil
je     1111 <is_end+0x11>
cmp    $0x3f,%dil
jne    1112 <is_end+0x12>
ret
xor    %eax,%eax
cmp    $0x21,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_end(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 46
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 63
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 33
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 1, i32 0
ret i32 %17
}

LLVM IR (-O2):
define i32 @is_end(i8 signext %0) {
switch i8 %0, label %2 [
i8 63, label %5
i8 46, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 33
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xe0() {
  Assert_real((isascii(224) == 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_isascii.c",
              1125, ("isascii should be 0 for 0xe0"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xe0>:
push   %rax
mov    $0xe0,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x465,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe0\00"
define void @t_isascii_0xe0() {
%1 = call i64 @isascii(i32 224)
%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 1125, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xe0\00"
define void @t_isascii_0xe0() {
%1 = tail call i64 @isascii(i32 224)
%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 1125, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mark_success(void) { printf("SUCCESS\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"SUCCESS\00"
define void @mark_success() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ execvp(char *, char **);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ usleep(int);
void *func4(void *param) {
  char *argv[3] = {"echo", "42", NULL};
  usleep(600000);
  execvp("./echo", argv);
  perror("execvp");
  return NULL;
}


x86 assembly (clang, -O0):
<func4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2cbd(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cba(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cb7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    $0x927c0,%edi
call   1050 <usleep@plt>
lea    -0x20(%rbp),%rsi
lea    0xe91(%rip),%rdi
call   1040 <execvp@plt>
lea    0xe8c(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func4>:
sub    $0x18,%rsp
mov    0x2cd5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0x2cb9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x927c0,%edi
call   1050 <usleep@plt>
lea    0xea7(%rip),%rdi
mov    %rsp,%rsi
call   1040 <execvp@plt>
lea    0xe9f(%rip),%rdi
call   1030 <perror@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"echo\00"
@.str.1 = [3 x i8] c"42\00"
@__const.func4.argv = [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [7 x i8] c"./echo\00"
@.str.3 = [7 x i8] c"execvp\00"
define i8* @func4(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8*]
store i8* %0, i8** %2
%4 = bitcast [3 x i8*]* %3 to i8*
%5 = call i32 @usleep(i32 600000)
%6 = getelementptr inbounds [3 x i8*], [3 x i8*]* %3, i64 0, i64 0
%7 = call i32 @execvp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %6)
%8 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [5 x i8] c"echo\00"
@.str.1 = [3 x i8] c"42\00"
@__const.func4.argv = [3 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str.2 = [7 x i8] c"./echo\00"
@.str.3 = [7 x i8] c"execvp\00"
define noalias i8* @func4(i8* nocapture readnone %0) {
%2 = alloca [3 x i8*]
%3 = bitcast [3 x i8*]* %2 to i8*
%4 = tail call i32 @usleep(i32 600000)
%5 = getelementptr inbounds [3 x i8*], [3 x i8*]* %2, i64 0, i64 0
%6 = call i32 @execvp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %5)
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ RegWriteA_lc898122(int, int);
void GyOutSignal_lc898122(void) {
  RegWriteA_lc898122(0x0283, 0x43);
  RegWriteA_lc898122(0x0284, 0x45);
  RegWriteA_lc898122(0x0280, 0x02);
}


x86 assembly (clang, -O0):
<GyOutSignal_lc898122>:
push   %rbp
mov    %rsp,%rbp
mov    $0x283,%edi
mov    $0x43,%esi
call   1030 <RegWriteA_lc898122@plt>
mov    $0x284,%edi
mov    $0x45,%esi
call   1030 <RegWriteA_lc898122@plt>
mov    $0x280,%edi
mov    $0x2,%esi
call   1030 <RegWriteA_lc898122@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<GyOutSignal_lc898122>:
push   %rax
mov    $0x283,%edi
mov    $0x43,%esi
call   1030 <RegWriteA_lc898122@plt>
mov    $0x284,%edi
mov    $0x45,%esi
call   1030 <RegWriteA_lc898122@plt>
mov    $0x280,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <RegWriteA_lc898122@plt>

LLVM IR (-O0):
define void @GyOutSignal_lc898122() {
%1 = call i32 @RegWriteA_lc898122(i32 643, i32 67)
%2 = call i32 @RegWriteA_lc898122(i32 644, i32 69)
%3 = call i32 @RegWriteA_lc898122(i32 640, i32 2)
ret void
}

LLVM IR (-O2):
define void @GyOutSignal_lc898122() {
%1 = tail call i32 @RegWriteA_lc898122(i32 643, i32 67)
%2 = tail call i32 @RegWriteA_lc898122(i32 644, i32 69)
%3 = tail call i32 @RegWriteA_lc898122(i32 640, i32 2)
ret void
}
void do___manual_list(void) {}


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

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

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

LLVM IR (-O2):
define void @do___manual_list() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int volatile);
void SYS_FIQ_Shell(void) {
  printf("ISR not found! ISNR=%d\n",
         (*((volatile unsigned int *)((0xB0042000 + 0x124)))));
}


x86 assembly (clang, -O0):
<SYS_FIQ_Shell>:
push   %rbp
mov    %rsp,%rbp
mov    $0xb0042124,%eax
mov    (%rax),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SYS_FIQ_Shell>:
mov    $0xb0042124,%eax
mov    (%rax),%esi
lea    0xee2(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"ISR not found! ISNR=%d\0A\00"
define void @SYS_FIQ_Shell() {
%1 = load volatile i32, i32* inttoptr (i64 2953060644 to i32*)
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"ISR not found! ISNR=%d\0A\00"
define void @SYS_FIQ_Shell() {
%1 = load volatile i32, i32* inttoptr (i64 2953060644 to i32*)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void crash(char *filename) {
  perror(filename);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<crash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<crash>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @crash(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @crash(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ halt();
int /*<<< orphan*/ idt_init();
int /*<<< orphan*/ irq_init();
int /*<<< orphan*/ keyboard_init();
int /*<<< orphan*/ kprintln(char *);
int /*<<< orphan*/ syscall_init();
void kmain() {
  clear_screen();
  kprintln("Loading Vermilion");
  idt_init();
  syscall_init();
  keyboard_init();
  irq_init();
  while (1) {
    halt();
  }
}


x86 assembly (clang, -O0):
<kmain>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <clear_screen@plt>
lea    0xe7e(%rip),%rdi
call   1080 <kprintln@plt>
mov    $0x0,%al
call   1060 <idt_init@plt>
mov    $0x0,%al
call   1090 <syscall_init@plt>
mov    $0x0,%al
call   1030 <keyboard_init@plt>
mov    $0x0,%al
call   1040 <irq_init@plt>
mov    $0x0,%al
call   1050 <halt@plt>
jmp    11a3 <kmain+0x33>

x86 assembly (clang, -O2):
<kmain>:
push   %rax
xor    %eax,%eax
call   1070 <clear_screen@plt>
lea    0xe81(%rip),%rdi
call   1080 <kprintln@plt>
xor    %eax,%eax
call   1060 <idt_init@plt>
xor    %eax,%eax
call   1090 <syscall_init@plt>
xor    %eax,%eax
call   1030 <keyboard_init@plt>
xor    %eax,%eax
call   1040 <irq_init@plt>
xor    %eax,%eax
call   1050 <halt@plt>
jmp    11a0 <kmain+0x30>

LLVM IR (-O0):
@.str = [18 x i8] c"Loading Vermilion\00"
define void @kmain() {
%1 = call i32 (...) @clear_screen()
%2 = call i32 @kprintln(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @idt_init()
%4 = call i32 (...) @syscall_init()
%5 = call i32 (...) @keyboard_init()
%6 = call i32 (...) @irq_init()
br label %7
7: ; preds = %0, %7
%8 = call i32 (...) @halt()
br label %7
}

LLVM IR (-O2):
@.str = [18 x i8] c"Loading Vermilion\00"
define void @kmain() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @kprintln(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @idt_init()
%4 = tail call i32 (...) @syscall_init()
%5 = tail call i32 (...) @keyboard_init()
%6 = tail call i32 (...) @irq_init()
br label %7
7: ; preds = %0, %7
%8 = tail call i32 (...) @halt()
br label %7
}
__attribute__((no)) void worker(void) {}


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

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

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

LLVM IR (-O2):
define void @worker() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sse_test();
void __attribute__((no)) do_test(void) { sse_test(); }


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

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

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

LLVM IR (-O2):
define void @do_test() {
%1 = tail call i32 (...) @sse_test()
ret void
}
/* Variables and functions */
void *request_new_pages(int);
void *request_new_page() { return request_new_pages(1); }


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

x86 assembly (clang, -O2):
<request_new_page>:
mov    $0x1,%edi
jmp    1030 <request_new_pages@plt>

LLVM IR (-O0):
define i8* @request_new_page() {
%1 = call i8* @request_new_pages(i32 1)
ret i8* %1
}

LLVM IR (-O2):
define i8* @request_new_page() {
%1 = tail call i8* @request_new_pages(i32 1)
ret i8* %1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int i;
  i = __VERIFIER_nondet_int();
  while (i != 0) {
    if (i < 0) {
      i = i + 2;
      if (i < 0) {
        i = i * (-1);
      }
    } else {
      i = i - 2;
      if (i > 0) {
        i = i * (-1);
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1180 <main+0x70>
cmpl   $0x0,-0x8(%rbp)
jge    115c <main+0x4c>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1157 <main+0x47>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    117b <main+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1176 <main+0x66>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    117b <main+0x6b>
jmp    1129 <main+0x19>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
void usage() {
  fputs("Usage: rmdir [OPTION(S)] OCTAL-MODE FILE\n\n"
        "OPTIONS:\n"
        "  -v, --verbose      print a message for every touched FILE\n"
        "    --help           print this message and exit\n"
        "    --version        print version and exit\n",
        stdout);
  exit(EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <fputs@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [205 x i8] c"Usage: rmdir [OPTION(S)] OCTAL-MODE FILE\0A\0AOPTIONS:\0A -v, --verbose print a message for every touched FILE\0A --help print this message and exit\0A --version print version and exit\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = call i32 @fputs(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@.str = [205 x i8] c"Usage: rmdir [OPTION(S)] OCTAL-MODE FILE\0A\0AOPTIONS:\0A -v, --verbose print a message for every touched FILE\0A --help print this message and exit\0A --version print version and exit\0A\00"
@stdout = global i32 0
@EXIT_SUCCESS = global i32 0
define void @usage() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fputs(i8* getelementptr inbounds ([205 x i8], [205 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
%4 = tail call i32 @exit(i32 %3)
unreachable
}
void UARTTxEmptyIntControl(unsigned int baseAdd, unsigned int controlFlag) {
  (*((volatile unsigned int *)(baseAdd + (0x40)))) &= ~((0x00000008u));
  (*((volatile unsigned int *)(baseAdd + (0x40)))) |=
      (controlFlag & (0x00000008u));
}


x86 assembly (clang, -O0):
<UARTTxEmptyIntControl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
and    $0xfffffff7,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%edx
and    $0x8,%edx
mov    -0x4(%rbp),%eax
add    $0x40,%eax
mov    %eax,%eax
mov    (%rax),%ecx
or     %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTTxEmptyIntControl>:
add    $0x40,%edi
andl   $0xfffffff7,(%rdi)
and    $0x8,%esi
or     %esi,(%rdi)
ret

LLVM IR (-O0):
define void @UARTTxEmptyIntControl(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = add i32 %5, 64
%7 = zext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -9
store volatile i32 %10, i32* %8
%11 = load i32, i32* %4
%12 = and i32 %11, 8
%13 = load i32, i32* %3
%14 = add i32 %13, 64
%15 = zext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
%17 = load volatile i32, i32* %16
%18 = or i32 %17, %12
store volatile i32 %18, i32* %16
ret void
}

LLVM IR (-O2):
define void @UARTTxEmptyIntControl(i32 %0, i32 %1) {
%3 = add i32 %0, 64
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, -9
store volatile i32 %7, i32* %5
%8 = and i32 %1, 8
%9 = load volatile i32, i32* %5
%10 = or i32 %9, %8
store volatile i32 %10, i32* %5
ret void
}
int symbolic_link(const char *path) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @symbolic_link(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int STC3115_ReadUnsignedWord(int, unsigned short *);
int STC3115_GetRunningCounter(void) {
  unsigned short value;
  int status;
  status = STC3115_ReadUnsignedWord(0x04, &value);
  if (status < 0)
    value = -1;
  return ((int)value);
}


x86 assembly (clang, -O0):
<STC3115_GetRunningCounter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
lea    -0x2(%rbp),%rsi
call   1030 <STC3115_ReadUnsignedWord@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    1139 <STC3115_GetRunningCounter+0x29>
movw   $0xffff,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STC3115_GetRunningCounter>:
push   %rax
lea    0x6(%rsp),%rsi
mov    $0x4,%edi
call   1030 <STC3115_ReadUnsignedWord@plt>
test   %eax,%eax
movzwl 0x6(%rsp),%ecx
mov    $0xffff,%eax
cmovns %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @STC3115_GetRunningCounter() {
%1 = alloca i16
%2 = alloca i32
%3 = call i32 @STC3115_ReadUnsignedWord(i32 4, i16* %1)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i16 -1, i16* %1
br label %7
7: ; preds = %6, %0
%8 = load i16, i16* %1
%9 = zext i16 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @STC3115_GetRunningCounter() {
%1 = alloca i16
%2 = bitcast i16* %1 to i8*
%3 = call i32 @STC3115_ReadUnsignedWord(i32 4, i16* %1)
%4 = icmp slt i32 %3, 0
%5 = load i16, i16* %1
%6 = zext i16 %5 to i32
%7 = select i1 %4, i32 65535, i32 %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ uart_putc(char const);
int uart_puts(const char *str) {
  while (*str) {
    uart_putc(*str);
    str += 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <uart_puts+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <uart_putc@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <uart_puts+0xc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <uart_puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <uart_putc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <uart_puts+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @uart_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @uart_putc(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void delete_data(void *data) { free(data); }


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

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

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

LLVM IR (-O2):
define void @delete_data(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int puts(const char *s) {
  while (*s) {
    putchar(*s++);
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <puts+0x35>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
call   1030 <putchar@plt>
jmp    111c <puts+0xc>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <puts+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <puts+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define i32 @puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = tail call i32 @putchar(i8 signext %5)
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = tail call i32 @putchar(i8 signext 10)
ret i32 undef
}
OP(op, f6) { OR(ARG()); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <ARG@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <OR@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OP>:
push   %rax
xor    %eax,%eax
call   1030 <ARG@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <OR@plt>

LLVM IR (-O0):
define i32 @OP(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (...) @ARG()
%7 = call i32 (i32, ...) bitcast (i32 (...)* @OR to i32 (i32, ...)*)(i32 %6)
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @ARG()
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @OR to i32 (i32, ...)*)(i32 %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ sleep(unsigned int);
int test_sleep(unsigned int msec_len) {
  sleep(msec_len / 1000);
  return 0;
}


x86 assembly (clang, -O0):
<test_sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sleep>:
push   %rax
mov    %edi,%eax
imul   $0x10624dd3,%rax,%rdi
shr    $0x26,%rdi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @test_sleep(i32 %0) {
%2 = udiv i32 %0, 1000
%3 = tail call i32 @sleep(i32 %2)
ret i32 0
}
/* Variables and functions */
char getchar();
char __() { return getchar() != '\n' ? __() : getchar(); }


x86 assembly (clang, -O0):
<__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     114b <__+0x2b>
call   1030 <__@plt>
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <__+0x38>
mov    $0x0,%al
call   1040 <getchar@plt>
movsbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <__+0x10>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getchar@plt>

LLVM IR (-O0):
define signext i8 @__() {
%1 = call signext i8 (...) @getchar()
%2 = sext i8 %1 to i32
%3 = icmp ne i32 %2, 10
br i1 %3, label %4, label %7
4: ; preds = %0
%5 = call signext i8 @__()
%6 = sext i8 %5 to i32
br label %10
7: ; preds = %0
%8 = call signext i8 (...) @getchar()
%9 = sext i8 %8 to i32
br label %10
10: ; preds = %7, %4
%11 = phi i32 [ %6, %4 ], [ %9, %7 ]
%12 = trunc i32 %11 to i8
ret i8 %12
}

LLVM IR (-O2):
define signext i8 @__() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
%5 = tail call signext i8 (...) @getchar()
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ assem_debug(char *, int, int);
int /*<<< orphan*/ output_w32(int);
void emit_fcvtds(int s, int d) {
  assem_debug("fcvtds d%d,s%d\n", d, s);
  output_w32(0xeeb70ac0 | ((d & 7) << 12) | ((s & 14) >> 1) | ((s & 1) << 5));
}


x86 assembly (clang, -O0):
<emit_fcvtds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xec5(%rip),%rdi
call   1030 <assem_debug@plt>
mov    -0x8(%rbp),%edi
and    $0x7,%edi
shl    $0xc,%edi
or     $0xeeb70ac0,%edi
mov    -0x4(%rbp),%eax
and    $0xe,%eax
sar    $0x1,%eax
or     %eax,%edi
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x5,%eax
or     %eax,%edi
call   1040 <output_w32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_fcvtds>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xed2(%rip),%rdi
mov    %ebp,%edx
call   1030 <assem_debug@plt>
and    $0x7,%ebx
shl    $0xc,%ebx
mov    %ebp,%eax
shr    %eax
and    $0x7,%eax
shl    $0x5,%ebp
movzbl %bpl,%edi
or     %eax,%edi
or     %ebx,%edi
or     $0xeeb70ac0,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <output_w32@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"fcvtds d%d,s%d\0A\00"
define void @emit_fcvtds(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 = call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %4
%9 = and i32 %8, 7
%10 = shl i32 %9, 12
%11 = or i32 -289994048, %10
%12 = load i32, i32* %3
%13 = and i32 %12, 14
%14 = ashr i32 %13, 1
%15 = or i32 %11, %14
%16 = load i32, i32* %3
%17 = and i32 %16, 1
%18 = shl i32 %17, 5
%19 = or i32 %15, %18
%20 = call i32 @output_w32(i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"fcvtds d%d,s%d\0A\00"
define void @emit_fcvtds(i32 %0, i32 %1) {
%3 = tail call i32 @assem_debug(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %0)
%4 = shl i32 %1, 12
%5 = and i32 %4, 28672
%6 = lshr i32 %0, 1
%7 = and i32 %6, 7
%8 = shl i32 %0, 5
%9 = and i32 %8, 32
%10 = or i32 %7, %9
%11 = or i32 %10, %5
%12 = or i32 %11, -289994048
%13 = tail call i32 @output_w32(i32 %12)
ret void
}
int main() {
  int shu_zi_1 = 2, shu_zi_2 = 3, shu_zi;
  shu_zi_1 = shu_zi_1 + shu_zi_2;
  shu_zi_2 = shu_zi_1 - shu_zi_2;
  shu_zi_1 = shu_zi_1 - shu_zi_2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
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
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = add nsw i32 %5, %6
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = sub nsw i32 %11, %12
store i32 %13, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
imm0adrx1(r0, r1, x0, x1, p0, p1) int r0, r1;
int *p0, *p1;
{
  if (22 <= (((int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<imm0adrx1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x14(%rbp),%rdx
mov    $0x16,%eax
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
jg     113b <imm0adrx1+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <imm0adrx1+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imm0adrx1>:
movslq %ecx,%rcx
xor    %eax,%eax
cmpl   $0x16,0xa98ac7(,%rcx,4)
16
setge  %al
ret

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

LLVM IR (-O2):
define i32 @imm0adrx1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = icmp sgt i32 %9, 21
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int _plnorm(double);
int /*<<< orphan*/ printf(char *, int, int);
int offset(double x, double y) {
  printf("^%d %d\n", _plnorm(x), _plnorm(y));
  return (0);
}


x86 assembly (clang, -O0):
<offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <_plnorm@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <_plnorm@plt>
mov    -0x14(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<offset>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1030 <_plnorm@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1030 <_plnorm@plt>
lea    0xebc(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"^%d %d\0A\00"
define i32 @offset(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = call i32 @_plnorm(double %5)
%7 = load double, double* %4
%8 = call i32 @_plnorm(double %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"^%d %d\0A\00"
define i32 @offset(double %0, double %1) {
%3 = tail call i32 @_plnorm(double %0)
%4 = tail call i32 @_plnorm(double %1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
double floating_point_bit_fields_message1_signal1_decode(double value) {
  return ((double)value);
}


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

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

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

LLVM IR (-O2):
define double @floating_point_bit_fields_message1_signal1_decode(double returned %0) {
ret double %0
}
int test_imm_4Fint8_mem(signed char *val) {
  return ((*val) & (-0x4F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_4Fint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -79
%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_4Fint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -79
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((no, noclone)) unsigned __int128 t102_1sub(signed char x,
                                                         unsigned short y) {
  unsigned __int128 r;
  if (__builtin_sub_overflow(x, y, &r))
    bar();
  return r;
}


x86 assembly (clang, -O0):
<t102_1sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x11(%rbp)
mov    %ax,-0x14(%rbp)
movsbq -0x11(%rbp),%rdx
mov    %rdx,%r9
sar    $0x3f,%r9
movzwl -0x14(%rbp),%eax
sub    %rax,%rdx
mov    %r9,%rcx
sbb    $0x0,%rcx
mov    %r9,%r8
sbb    $0x0,%r8
sbb    $0x0,%r9
mov    %r8d,%eax
and    $0x1,%eax
mov    %eax,%esi
mov    %rsi,%rax
neg    %rax
mov    %rax,%rdi
xor    %r9,%rdi
xor    %r8,%rax
or     %rdi,%rax
or     %rsi,%rax
setne  %al
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x28(%rbp)
test   $0x1,%al
jne    117f <t102_1sub+0x6f>
jmp    1186 <t102_1sub+0x76>
mov    $0x0,%al
call   1030 <bar@plt>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,-0x8(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rdx
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t102_1sub>:
push   %r14
push   %rbx
push   %rax
movslq %edi,%rbx
mov    %rbx,%rax
sar    $0x3f,%rax
mov    %esi,%ecx
sub    %rcx,%rbx
mov    %rax,%r14
sbb    $0x0,%r14
sbb    $0x0,%rax
and    $0x1,%eax
neg    %rax
jns    113d <t102_1sub+0x2d>
xor    %eax,%eax
call   1030 <bar@plt>
mov    %rbx,%rax
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define { i64, i64 } @t102_1sub(i8 signext %0, i16 zeroext %1) {
%3 = alloca i128
%4 = alloca i8
%5 = alloca i16
%6 = alloca i128
store i8 %0, i8* %4
store i16 %1, i16* %5
%7 = load i8, i8* %4
%8 = load i16, i16* %5
%9 = sext i8 %7 to i129
%10 = zext i16 %8 to i129
%11 = call { i129, i1 } @llvm.ssub.with.overflow.i129(i129 %9, i129 %10)
%12 = extractvalue { i129, i1 } %11, 1
%13 = extractvalue { i129, i1 } %11, 0
%14 = trunc i129 %13 to i128
%15 = zext i128 %14 to i129
%16 = icmp ne i129 %13, %15
%17 = or i1 %12, %16
store i128 %14, i128* %6
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 (...) @bar()
br label %20
20: ; preds = %18, %2
%21 = load i128, i128* %6
store i128 %21, i128* %3
%22 = bitcast i128* %3 to { i64, i64 }*
%23 = load { i64, i64 }, { i64, i64 }* %22
ret { i64, i64 } %23
}

LLVM IR (-O2):
define { i64, i64 } @t102_1sub(i8 signext %0, i16 zeroext %1) {
%3 = sext i8 %0 to i129
%4 = zext i16 %1 to i129
%5 = sub nsw i129 %3, %4
%6 = icmp slt i129 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 (...) @bar()
br label %9
9: ; preds = %7, %2
%10 = trunc i129 %5 to i64
%11 = lshr i129 %5, 64
%12 = trunc i129 %11 to i64
%13 = insertvalue { i64, i64 } poison, i64 %10, 0
%14 = insertvalue { i64, i64 } %13, i64 %12, 1
ret { i64, i64 } %14
}
void f(a) int a;
{}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0) {
ret void
}