xunge/DecIR huggingface dataset:
int idris_utf8_strlen(char *s) {
  int i = 0, j = 0;
  while (s[i]) {
    if ((s[i] & 0xc0) != 0x80)
      j++;
    i++;
  }
  return j;
}


x86 assembly (clang, -O0):
<idris_utf8_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115b <idris_utf8_strlen+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
and    $0xc0,%eax
cmp    $0x80,%eax
je     114d <idris_utf8_strlen+0x4d>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <idris_utf8_strlen+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<idris_utf8_strlen>:
mov    (%rdi),%cl
test   %cl,%cl
je     1129 <idris_utf8_strlen+0x29>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
and    $0xc0,%cl
xor    %edx,%edx
cmp    $0x80,%cl
setne  %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <idris_utf8_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @idris_utf8_strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %12, %4 ], [ 0, %1 ]
%6 = phi i8 [ %14, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = and i8 %6, -64
%9 = icmp ne i8 %8, -128
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = add nuw nsw i64 %5, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %4, %1
%17 = phi i32 [ 0, %1 ], [ %11, %4 ]
ret i32 %17
}
int fci_hpi_deinit(void *handle) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fci_hpi_deinit(i8* nocapture readnone %0) {
ret i32 0
}
int main(int argc, char **argv) {
bad:
  1 + (int __attribute__((unit(m))))2;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void C1Mod2Function2() { printf("Expected message: C1Mod2Function2.\n"); }


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

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

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

LLVM IR (-O2):
@str = [35 x i8] c"Expected message: C1Mod2Function2.\00"
define void @C1Mod2Function2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ post(char *);
int /*<<< orphan*/ sys_listmididevs();
void sys_listdevs(void) {
  post("unknown API");
  sys_listmididevs();
}


x86 assembly (clang, -O0):
<sys_listdevs>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <post@plt>
mov    $0x0,%al
call   1030 <sys_listmididevs@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"unknown API\00"
define void @sys_listdevs() {
%1 = call i32 @post(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @sys_listmididevs()
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"unknown API\00"
define void @sys_listdevs() {
%1 = tail call i32 @post(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @sys_listmididevs()
ret void
}
int test_isLessOrEqual(int x, int y) { return x <= y; }


x86 assembly (clang, -O0):
<test_isLessOrEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isLessOrEqual>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @test_isLessOrEqual(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_isLessOrEqual(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
yyerror(char *s) { printf("%s", s); }


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

x86 assembly (clang, -O2):
<yyerror>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @yyerror(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ txt_fill_screen(int, int /*<<< orphan*/);
void txt_clear_screen(void) { txt_fill_screen(0x20, 0); }


x86 assembly (clang, -O0):
<txt_clear_screen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <txt_fill_screen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<txt_clear_screen>:
mov    $0x20,%edi
xor    %esi,%esi
jmp    1030 <txt_fill_screen@plt>

LLVM IR (-O0):
define void @txt_clear_screen() {
%1 = call i32 @txt_fill_screen(i32 32, i32 0)
ret void
}

LLVM IR (-O2):
define void @txt_clear_screen() {
%1 = tail call i32 @txt_fill_screen(i32 32, i32 0)
ret void
}
unsigned char inb(unsigned short port) {
  unsigned char tmp;
  __asm__("inb %1,%0" : "=a"(tmp) : "d"(port));
  return tmp;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm "inb $1,$0", "={ax},{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
double strtod(char const *, int /*<<< orphan*/ *);
double atof(const char *str) { return strtod(str, NULL); }


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

x86 assembly (clang, -O2):
<atof>:
xor    %esi,%esi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define double @atof(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call double @strtod(i8* %3, i32* null)
ret double %4
}

LLVM IR (-O2):
define double @atof(i8* nocapture %0) {
%2 = tail call double @strtod(i8* nocapture %0, i32* null)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void print_usage(char *program_name) {
  fprintf(stderr, "Usage: %s device\n", program_name);
  fprintf(
      stderr,
      "\tdevice - path to serial device (e.g. /dev/ttyS0 or /dev/ttyUSB0)\n");
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xef5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2ec5(%rip),%rbx
mov    (%rbx),%edi
lea    0xedc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xede(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xf0f(%rip),%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s device\0A\00"
@.str.1 = [67 x i8] c"\09device - path to serial device (e.g. /dev/ttyS0 or /dev/ttyUSB0)\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Usage: %s device\0A\00"
@.str.1 = [67 x i8] c"\09device - path to serial device (e.g. /dev/ttyS0 or /dev/ttyUSB0)\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int _chmod_error(char *, int);
scalar_t__ chmod(char *, int /*<<< orphan*/);
int _chmod_do(mode_t mode, char *file) {
  if (chmod(file, mode) != 0)
    return _chmod_error(file, 1);
  return 0;
}


x86 assembly (clang, -O0):
<_chmod_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <chmod@plt>
cmp    $0x0,%rax
je     115b <_chmod_do+0x3b>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <_chmod_error@plt>
mov    %eax,-0x4(%rbp)
jmp    1162 <_chmod_do+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_chmod_do>:
push   %rbx
mov    %rsi,%rbx
mov    %edi,%esi
mov    %rbx,%rdi
call   1040 <chmod@plt>
test   %rax,%rax
je     1141 <_chmod_do+0x21>
mov    %rbx,%rdi
mov    $0x1,%esi
pop    %rbx
jmp    1030 <_chmod_error@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @_chmod_do(i32 %0, i8* %1) {
%3 = tail call i64 @chmod(i8* %1, i32 %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @_chmod_error(i8* %1, i32 1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: printenv [name]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"usage: printenv [name]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"usage: printenv [name]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
void r(int *a, int *b, int *c) {
  int t = *a + *b;
  *a = *c;
  *b = t - *b;
  *c = t - *b;
}


x86 assembly (clang, -O0):
<r>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<r>:
mov    (%rsi),%eax
add    (%rdi),%eax
mov    (%rdx),%ecx
mov    %ecx,(%rdi)
mov    (%rsi),%ecx
sub    %ecx,%eax
mov    %eax,(%rsi)
mov    %ecx,(%rdx)
ret

LLVM IR (-O0):
define void @r(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = sub nsw i32 %16, %18
%20 = load i32*, i32** %5
store i32 %19, i32* %20
%21 = load i32, i32* %7
%22 = load i32*, i32** %5
%23 = load i32, i32* %22
%24 = sub nsw i32 %21, %23
%25 = load i32*, i32** %6
store i32 %24, i32* %25
ret void
}

LLVM IR (-O2):
define void @r(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, %4
%7 = load i32, i32* %2
store i32 %7, i32* %0
%8 = load i32, i32* %1
%9 = sub i32 %6, %8
store i32 %9, i32* %1
store i32 %8, i32* %2
ret void
}
float hypotf(float x, float y) { return (float)hypotf(x, y); }


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

x86 assembly (clang, -O2):
<hypotf>:
jmp    1100 <hypotf>

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

LLVM IR (-O2):
define float @hypotf(float %0, float %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int x;
};
typedef TYPE_1__ XGravityEvent;

/* Variables and functions */
void set_XGravityEvent_x(void *_p, int _v) {
  ((XGravityEvent *)_p)->x = (int)_v;
}


x86 assembly (clang, -O0):
<set_XGravityEvent_x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XGravityEvent_x>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XGravityEvent_x(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XGravityEvent_x(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int test_root(int a, int b) {
  if (a == 0)
    return 1;
  while (1) {
    if (a == 1)
      return 1;
    if (a % b)
      return 0;
    a = a / b;
  }
}


x86 assembly (clang, -O0):
<test_root>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1120 <test_root+0x20>
movl   $0x1,-0x4(%rbp)
jmp    1166 <test_root+0x66>
jmp    1125 <test_root+0x25>
cmpl   $0x1,-0x8(%rbp)
jne    113b <test_root+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1166 <test_root+0x66>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
je     1157 <test_root+0x57>
movl   $0x0,-0x4(%rbp)
jmp    1166 <test_root+0x66>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x8(%rbp)
jmp    1125 <test_root+0x25>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_root>:
mov    $0x1,%ecx
cmp    $0x2,%edi
jb     111c <test_root+0x1c>
mov    %edi,%eax
nopl   0x0(%rax)
cltd
idiv   %esi
test   %edx,%edx
jne    111f <test_root+0x1f>
cmp    $0x1,%eax
jne    1110 <test_root+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_root(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 eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %24
9: ; preds = %2
br label %10
10: ; preds = %9, %20
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %10
store i32 1, i32* %3
br label %24
14: ; preds = %10
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = srem i32 %15, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %24
20: ; preds = %14
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sdiv i32 %21, %22
store i32 %23, i32* %4
br label %10
24: ; preds = %19, %13, %8
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @test_root(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, 2
br i1 %3, label %11, label %4
4: ; preds = %2, %9
%5 = phi i32 [ %7, %9 ], [ %0, %2 ]
%6 = srem i32 %5, %1
%7 = sdiv i32 %5, %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = icmp eq i32 %7, 1
br i1 %10, label %11, label %4
11: ; preds = %9, %4, %2
%12 = phi i32 [ 1, %2 ], [ 1, %9 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void const *, size_t);
void __attribute__((weak))
__aeabi_memcpy_impl2(void *dest, const void *src, size_t n) {
  memcpy(dest, src, n);
}


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

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

LLVM IR (-O0):
define weak void @__aeabi_memcpy_impl2(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcpy(i8* %7, i8* %8, i64 %9)
ret void
}

LLVM IR (-O2):
define weak void @__aeabi_memcpy_impl2(i8* %0, i8* %1, i64 %2) {
%4 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
void cvsguiglue_flushconsole(int closeit) {
  fflush(stdout);
  fflush(stderr);
}


x86 assembly (clang, -O0):
<cvsguiglue_flushconsole>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvsguiglue_flushconsole>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
define void @cvsguiglue_flushconsole(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
define void @cvsguiglue_flushconsole(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fflush(i32 %4)
ret void
}
int f(unsigned a) {
  unsigned b = 5;
  unsigned c = a - b;
  return c > a;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
xor    %eax,%eax
cmp    $0x5,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @f(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 5, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = sub i32 %5, %6
store i32 %7, i32* %4
%8 = load i32, i32* %4
%9 = load i32, i32* %2
%10 = icmp ugt i32 %8, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = icmp ult i32 %0, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void err_command(const char *cmd) { printf("unknown command %s\n", cmd); }


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

x86 assembly (clang, -O2):
<err_command>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"unknown command %s\0A\00"
define void @err_command(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"unknown command %s\0A\00"
define void @err_command(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int a = 5;
  int b = 12;
  printf("a is %i and b is %i, swapping.\n", a, b);
  int temp = a;
  a = b;
  b = temp;
  ;
  printf("a is %i and b is %i after swap.\n", a, b);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xc,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x5,%esi
mov    $0xc,%edx
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
mov    $0xc,%esi
mov    $0x5,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"a is %i and b is %i, swapping.\0A\00"
@.str.1 = [33 x i8] c"a is %i and b is %i after swap.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
store i32 12, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
%8 = load i32, i32* %2
store i32 %8, i32* %4
%9 = load i32, i32* %3
store i32 %9, i32* %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"a is %i and b is %i, swapping.\0A\00"
@.str.1 = [33 x i8] c"a is %i and b is %i after swap.\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 5, i32 12)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 12, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ halt(char *, char *);
long strtol(char *, char **, int);
long int str2long(char *str) {
  char *b;
  register long int i = strtol(str, &b, 10);
  if (((*str) == '\0') || ((*b) != '\0'))
    halt("Number expected instead of '%s'.", str);
  return i;
}


x86 assembly (clang, -O0):
<str2long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1162 <str2long+0x42>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1172 <str2long+0x52>
mov    -0x8(%rbp),%rsi
lea    0xe93(%rip),%rdi
call   1040 <halt@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2long>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,%r14
cmpb   $0x0,(%rbx)
je     1145 <str2long+0x25>
mov    (%rsp),%rax
cmpb   $0x0,(%rax)
je     1154 <str2long+0x34>
lea    0xeb4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <halt@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Number expected instead of '%s'.\00"
define i64 @str2long(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtol(i8* %5, i8** %3, i32 10)
store i64 %6, i64* %4
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %11, %1
%17 = load i8*, i8** %2
%18 = call i32 @halt(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %16, %11
%20 = load i64, i64* %4
ret i64 %20
}

LLVM IR (-O2):
@.str = [33 x i8] c"Number expected instead of '%s'.\00"
define i64 @str2long(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtol(i8* %0, i8** %2, i32 10)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %7, %1
%12 = tail call i32 @halt(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %13
13: ; preds = %11, %7
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ iscntrl(int);
void t_iscntrl_0xd2() {
  Assert_real((iscntrl(210) == 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_iscntrl.c",
              1055, ("iscntrl should be 0 for 0xd2"));
}


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

x86 assembly (clang, -O2):
<t_iscntrl_0xd2>:
push   %rax
mov    $0xd2,%edi
call   1030 <iscntrl@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41f,%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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd2\00"
define void @t_iscntrl_0xd2() {
%1 = call i64 @iscntrl(i32 210)
%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 1055, 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_iscntrl.c\00"
@.str.1 = [29 x i8] c"iscntrl should be 0 for 0xd2\00"
define void @t_iscntrl_0xd2() {
%1 = tail call i64 @iscntrl(i32 210)
%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 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(void) { exit(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(
      stderr,
      "usage: disktest [options] [-rwRWt] <device or file>\n"
      "\t-b [bytes]      block size (default 4K)\n"
      "\t-o [bytes]      offset into block (default 0)\n"
      "\t-s [bytes]      size to read/write (default 4K)\n"
      "\t-r [threads]    num read threads\n"
      "\t-w [threads]    num write threads\n"
      "\t-R [count]      total number of reads to do (across all threads)\n"
      "\t-W [count]      total number of writes to do (across all threads)\n"
      "\t-t [seconds]    time to run\n"
      "\t-S [bytes]      seek range limit (default is the size of the "
      "file/device)\n"
      "\t-d              debug on\n"
      "\t-D              use O_DIRECT (bypass page cache)\n"
      "\t-h              print this help\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [605 x i8] c"usage: disktest [options] [-rwRWt] <device or file>\0A\09-b [bytes] block size (default 4K)\0A\09-o [bytes] offset into block (default 0)\0A\09-s [bytes] size to read/write (default 4K)\0A\09-r [threads] num read threads\0A\09-w [threads] num write threads\0A\09-R [count] total number of reads to do (across all threads)\0A\09-W [count] total number of writes to do (across all threads)\0A\09-t [seconds] time to run\0A\09-S [bytes] seek range limit (default is the size of the file/device)\0A\09-d debug on\0A\09-D use O_DIRECT (bypass page cache)\0A\09-h print this help\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([605 x i8], [605 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [605 x i8] c"usage: disktest [options] [-rwRWt] <device or file>\0A\09-b [bytes] block size (default 4K)\0A\09-o [bytes] offset into block (default 0)\0A\09-s [bytes] size to read/write (default 4K)\0A\09-r [threads] num read threads\0A\09-w [threads] num write threads\0A\09-R [count] total number of reads to do (across all threads)\0A\09-W [count] total number of writes to do (across all threads)\0A\09-t [seconds] time to run\0A\09-S [bytes] seek range limit (default is the size of the file/device)\0A\09-d debug on\0A\09-D use O_DIRECT (bypass page cache)\0A\09-h print this help\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([605 x i8], [605 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned short ShortToHost(unsigned short);
unsigned short ShortToMachine(unsigned short shortword) {
  return ShortToHost(shortword);
}


x86 assembly (clang, -O0):
<ShortToMachine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <ShortToHost@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @ShortToMachine(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call zeroext i16 @ShortToHost(i16 zeroext %3)
ret i16 %4
}

LLVM IR (-O2):
define zeroext i16 @ShortToMachine(i16 zeroext %0) {
%2 = tail call zeroext i16 @ShortToHost(i16 zeroext %0)
ret i16 %2
}
/* Variables and functions */
int __mpath_connect(int /*<<< orphan*/);
int mpath_connect(void) { return __mpath_connect(0); }


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

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

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

LLVM IR (-O2):
define i32 @mpath_connect() {
%1 = tail call i32 @__mpath_connect(i32 0)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int iam = 0, np = 1, i = 0;
#pragma omp parallel private(iam, np, i)
  {
    printf("Hello from thread %d out of %d\n", iam, np);
#pragma omp for
    for (i = 0; i < (np * 2); i++) {
      printf("Thread %d, contador %d \n", iam, i);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    117e <main+0x6e>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <main+0x3d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
lea    0xef5(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [32 x i8] c"Hello from thread %d out of %d\0A\00"
@.str.1 = [25 x i8] c"Thread %d, contador %d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 0, i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430InterruptP__Port13__default__fired();
void HplMsp430InterruptP__Port13__fired(void) {
  HplMsp430InterruptP__Port13__default__fired();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430InterruptP__Port13__fired() {
%1 = tail call i32 (...) @HplMsp430InterruptP__Port13__default__fired()
ret void
}
int f(int a0, int a1, int a2, int a3, int a4) {
  int b0, b1, b2, b3, b4, e;
  b4 = a4 + a3 + a2 + a1 + a0;
  b3 = a3 + a2 + a1 + a0;
  b2 = a2 + a1 + a0;
  b1 = a1 + a0;
  e = b4 - b3 + b2 - b1 - a4 - a2;
  return e;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%eax
sub    -0x24(%rbp),%eax
add    -0x20(%rbp),%eax
sub    -0x1c(%rbp),%eax
sub    -0x14(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%17 = load i32, i32* %10
%18 = load i32, i32* %9
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %8
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %6
%25 = add nsw i32 %23, %24
store i32 %25, i32* %15
%26 = load i32, i32* %9
%27 = load i32, i32* %8
%28 = add nsw i32 %26, %27
%29 = load i32, i32* %7
%30 = add nsw i32 %28, %29
%31 = load i32, i32* %6
%32 = add nsw i32 %30, %31
store i32 %32, i32* %14
%33 = load i32, i32* %8
%34 = load i32, i32* %7
%35 = add nsw i32 %33, %34
%36 = load i32, i32* %6
%37 = add nsw i32 %35, %36
store i32 %37, i32* %13
%38 = load i32, i32* %7
%39 = load i32, i32* %6
%40 = add nsw i32 %38, %39
store i32 %40, i32* %12
%41 = load i32, i32* %15
%42 = load i32, i32* %14
%43 = sub nsw i32 %41, %42
%44 = load i32, i32* %13
%45 = add nsw i32 %43, %44
%46 = load i32, i32* %12
%47 = sub nsw i32 %45, %46
%48 = load i32, i32* %10
%49 = sub nsw i32 %47, %48
%50 = load i32, i32* %8
%51 = sub nsw i32 %49, %50
store i32 %51, i32* %16
%52 = load i32, i32* %16
ret i32 %52
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 0
}
unsigned xrop3_56_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D | T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


x86 assembly (clang, -O0):
<xrop3_56_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
and    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x10(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0x10(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_56_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_56_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 8
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = or i32 %13, %15
store i32 %16, i32* %6
%17 = load i8, i8* %4
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8, i8* %4
%21 = zext i8 %20 to i32
%22 = or i32 %19, %21
store i32 %22, i32* %7
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = or i32 %23, %24
store i32 %25, i32* %10
%26 = load i32, i32* %6
%27 = load i32, i32* %10
%28 = and i32 %26, %27
store i32 %28, i32* %9
%29 = load i32, i32* %7
%30 = load i32, i32* %9
%31 = xor i32 %29, %30
store i32 %31, i32* %8
%32 = load i32, i32* %8
%33 = load i32, i32* %6
%34 = xor i32 %33, -1
%35 = and i32 %32, %34
%36 = load i32, i32* %7
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
%39 = load i32, i32* %5
%40 = load i32, i32* %6
%41 = and i32 %39, %40
%42 = or i32 %38, %41
%43 = load i32, i32* %5
%44 = load i32, i32* %7
%45 = and i32 %43, %44
%46 = or i32 %42, %45
ret i32 %46
}

LLVM IR (-O2):
define i32 @xrop3_56_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ step();
int main(int argc, char **argv) { step(); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <step@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @step()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @step()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Reserved68_DriverIRQHandler();
__attribute__((weak)) void Reserved68_IRQHandler(void) {
  Reserved68_DriverIRQHandler();
}


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

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

LLVM IR (-O0):
define weak void @Reserved68_IRQHandler() {
%1 = call i32 (...) @Reserved68_DriverIRQHandler()
ret void
}

LLVM IR (-O2):
define weak void @Reserved68_IRQHandler() {
%1 = tail call i32 (...) @Reserved68_DriverIRQHandler()
ret void
}