xunge/DecIR huggingface dataset:
/* Type definitions */
typedef size_t ssize_t;

/* Variables and functions */
ssize_t fuzz_send(int sockfd, const void *buf, size_t len, int flags) {
  return len;
}


x86 assembly (clang, -O0):
<fuzz_send>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fuzz_send>:
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @fuzz_send(i32 %0, i8* %1, i64 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32 %3, i32* %8
%9 = load i64, i64* %7
ret i64 %9
}

LLVM IR (-O2):
define i64 @fuzz_send(i32 %0, i8* nocapture readnone %1, i64 returned %2, i32 %3) {
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *myself) {
  fprintf(stderr, "Usage: %s <disk file> <master boot record file>\n", myself);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s <disk file> <master boot record file>\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"Usage: %s <disk file> <master boot record file>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char *);
void bzero3_char_ptr_null() {
  char *str = "abcd";
  clang_analyzer_eval(strlen(str) == 4);
  bzero(str + 2, 2);
  clang_analyzer_eval(strlen(str) == 0);
}


x86 assembly (clang, -O0):
<bzero3_char_ptr_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
mov    $0x2,%esi
call   1040 <bzero@plt>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bzero3_char_ptr_null>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1050 <clang_analyzer_eval@plt>
lea    0xead(%rip),%rdi
mov    $0x2,%esi
call   1040 <bzero@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
pop    %rbx
jmp    1050 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
define void @bzero3_char_ptr_null() {
%1 = alloca i8*
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @strlen(i8* %2)
%4 = icmp eq i32 %3, 4
%5 = zext i1 %4 to i32
%6 = call i32 @clang_analyzer_eval(i32 %5)
%7 = load i8*, i8** %1
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = call i32 @bzero(i8* %8, i32 2)
%10 = load i8*, i8** %1
%11 = call i32 @strlen(i8* %10)
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
define void @bzero3_char_ptr_null() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
%5 = tail call i32 @bzero(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 2), i32 2)
%6 = tail call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @clang_analyzer_eval(i32 %8)
ret void
}
int getvalue(char digit) {
  if (digit >= '0' && digit <= '9')
    return digit - '0';
  if (digit >= 'A' && digit <= 'F')
    return digit - 'A' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<getvalue>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <getvalue+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <getvalue+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <getvalue+0x66>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     115f <getvalue+0x5f>
movsbl -0x5(%rbp),%eax
cmp    $0x46,%eax
jg     115f <getvalue+0x5f>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1166 <getvalue+0x66>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getvalue>:
mov    %edi,%eax
lea    -0x30(%rax),%ecx
cmp    $0x9,%cl
ja     110e <getvalue+0xe>
add    $0xffffffd0,%eax
ret
lea    -0x41(%rax),%ecx
add    $0xffffffc9,%eax
cmp    $0x6,%cl
mov    $0xffffffff,%ecx
cmovb  %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @getvalue(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %29
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 70
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 65
%27 = add nsw i32 %26, 10
store i32 %27, i32* %2
br label %29
28: ; preds = %19, %15
store i32 -1, i32* %2
br label %29
29: ; preds = %28, %23, %11
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @getvalue(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i32 %2, -48
br label %12
7: ; preds = %1
%8 = add i8 %0, -65
%9 = icmp ult i8 %8, 6
%10 = add nsw i32 %2, -55
%11 = select i1 %9, i32 %10, i32 -1
br label %12
12: ; preds = %7, %5
%13 = phi i32 [ %6, %5 ], [ %11, %7 ]
ret i32 %13
}
/* Variables and functions */
unsigned long callthru2(int, unsigned long, unsigned long);
unsigned long callthru_tcl(const char *str, int strlen) {
  return callthru2(86, (unsigned long)str, (unsigned long)strlen);
}


x86 assembly (clang, -O0):
<callthru_tcl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
mov    $0x56,%edi
call   1030 <callthru2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callthru_tcl>:
mov    %rdi,%rax
movslq %esi,%rdx
mov    $0x56,%edi
mov    %rax,%rsi
jmp    1030 <callthru2@plt>

LLVM IR (-O0):
define i64 @callthru_tcl(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = ptrtoint i8* %5 to i64
%7 = load i32, i32* %4
%8 = sext i32 %7 to i64
%9 = call i64 @callthru2(i32 86, i64 %6, i64 %8)
ret i64 %9
}

LLVM IR (-O2):
define i64 @callthru_tcl(i8* %0, i32 %1) {
%3 = ptrtoint i8* %0 to i64
%4 = sext i32 %1 to i64
%5 = tail call i64 @callthru2(i32 86, i64 %3, i64 %4)
ret i64 %5
}
/* Type definitions */
struct termios {
  int /*<<< orphan*/ c_ospeed;
};
typedef int /*<<< orphan*/ speed_t;

/* Variables and functions */
speed_t _cfgetospeed(const struct termios *termios_p) {
  return termios_p->c_ospeed;
}


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

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

LLVM IR (-O0):
%struct.termios = type { i32 }
define i32 @_cfgetospeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @_cfgetospeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fgetc(int /*<<< orphan*/ *);
int skip_to_end(FILE *fp) {
  int c;
  do {
    c = fgetc(fp);
  } while (c != EOF && c != '\n');
  return c;
}


x86 assembly (clang, -O0):
<skip_to_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    0x2eb4(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xd(%rbp)
je     1149 <skip_to_end+0x39>
cmpl   $0xa,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    111c <skip_to_end+0xc>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_to_end>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eca(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1030 <fgetc@plt>
cmp    $0xa,%eax
je     1132 <skip_to_end+0x22>
cmp    (%r14),%eax
jne    1120 <skip_to_end+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @skip_to_end(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
br label %4
4: ; preds = %14, %1
%5 = load i32*, i32** %2
%6 = call i32 @fgetc(i32* %5)
store i32 %6, i32* %3
br label %7
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 10
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %4, label %16
16: ; preds = %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @skip_to_end(i32* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 @fgetc(i32* %0)
%4 = load i32, i32* @EOF
%5 = icmp ne i32 %3, %4
%6 = icmp ne i32 %3, 10
%7 = and i1 %6, %5
br i1 %7, label %2, label %8
8: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, void *,
                           void *);
int /*<<< orphan*/ stderr;
__attribute__((hcos_noinstrument)) void
check_ptr(const char *name, void *reported, void *expected) {
  if (reported != expected)
    do {
      fprintf(
          stderr,
          "FAIL: "
          "Reported %s did not match expected. Reported: %p, Expected: %p\n",
          name, reported, expected);
      exit(1);
    } while (1);
}


x86 assembly (clang, -O0):
<check_ptr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     1172 <check_ptr+0x52>
jmp    1147 <check_ptr+0x27>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
lea    0xe9d(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ptr>:
mov    %rdx,%r8
cmp    %rdx,%rsi
jne    1129 <check_ptr+0x9>
ret
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [70 x i8] c"FAIL: Reported %s did not match expected. Reported: %p, Expected: %p\0A\00"
define void @check_ptr(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = icmp ne i8* %7, %8
br i1 %9, label %10, label %20
10: ; preds = %3
br label %11
11: ; preds = %18, %10
%12 = load i32, i32* @stderr
%13 = load i8*, i8** %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %6
%16 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
18: ; No predecessors!
br i1 true, label %11, label %19
19: ; preds = %18
br label %20
20: ; preds = %19, %3
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [70 x i8] c"FAIL: Reported %s did not match expected. Reported: %p, Expected: %p\0A\00"
define void @check_ptr(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, %2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
unsigned short interpret_uint16(unsigned char *);
unsigned short read_uint16(FILE *in) {
  unsigned char buffer[2];
  fread(buffer, 1, 2, in);
  return interpret_uint16(buffer);
}


x86 assembly (clang, -O0):
<read_uint16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
lea    -0xa(%rbp),%rdi
call   1040 <interpret_uint16@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_uint16>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rcx
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <fread@plt>
mov    %rbx,%rdi
call   1040 <interpret_uint16@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @read_uint16(i32* %0) {
%2 = alloca i32*
%3 = alloca [2 x i8]
store i32* %0, i32** %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%5 = load i32*, i32** %2
%6 = call i32 @fread(i8* %4, i32 1, i32 2, i32* %5)
%7 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%8 = call zeroext i16 @interpret_uint16(i8* %7)
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @read_uint16(i32* nocapture %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
%4 = call i32 @fread(i8* %3, i32 1, i32 2, i32* %0)
%5 = call zeroext i16 @interpret_uint16(i8* %3)
ret i16 %5
}
/* Variables and functions */
int /*<<< orphan*/ perfect(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  int j;
  for (j = 1;; j++) {
    printf("Enetr a positive integer number (a negative number to End): ");
    scanf("%d", &num);
    perfect(num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <perfect@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%r14
lea    0xef6(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <perfect@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [61 x i8] c"Enetr a positive integer number (a negative number to End): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %4
4: ; preds = %9, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 @perfect(i32 %7)
br label %9
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
}

LLVM IR (-O2):
@.str = [61 x i8] c"Enetr a positive integer number (a negative number to End): \00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = call i32 @perfect(i32 %6)
br label %3
}
multiplicar_matrices(int x[][100], int y[][100], int z[][100], int a) {}


x86 assembly (clang, -O0):
<multiplicar_matrices>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @multiplicar_matrices([100 x i32]* %0, [100 x i32]* %1, [100 x i32]* %2, i32 %3) {
%5 = alloca i32
%6 = alloca [100 x i32]*
%7 = alloca [100 x i32]*
%8 = alloca [100 x i32]*
%9 = alloca i32
store [100 x i32]* %0, [100 x i32]** %6
store [100 x i32]* %1, [100 x i32]** %7
store [100 x i32]* %2, [100 x i32]** %8
store i32 %3, i32* %9
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @multiplicar_matrices([100 x i32]* nocapture readnone %0, [100 x i32]* nocapture readnone %1, [100 x i32]* nocapture readnone %2, i32 %3) {
ret i32 undef
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *strdup(const char *source_str) {
  char *dest_str = malloc(strlen(source_str) + 1);
  if (dest_str != NULL)
    strcpy(dest_str, source_str);
  return dest_str;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdup+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdup+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
struct dat {
  int dummy;
};

/* Variables and functions */
int __insert_pattern(struct dat *, unsigned char *, unsigned long,
                     unsigned long, int, void *);
int insert_reverse_pattern(struct dat *d, unsigned char *key,
                           unsigned long key_len, unsigned long attr,
                           void *data) {
  return __insert_pattern(d, key, key_len, attr, 1, data);
}


x86 assembly (clang, -O0):
<insert_reverse_pattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r9
mov    $0x1,%r8d
call   1030 <__insert_pattern@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_reverse_pattern>:
mov    %r8,%r9
mov    $0x1,%r8d
jmp    1030 <__insert_pattern@plt>

LLVM IR (-O0):
%struct.dat = type { i32 }
define i32 @insert_reverse_pattern(%struct.dat* %0, i8* %1, i64 %2, i64 %3, i8* %4) {
%6 = alloca %struct.dat*
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i8*
store %struct.dat* %0, %struct.dat** %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i8* %4, i8** %10
%11 = load %struct.dat*, %struct.dat** %6
%12 = load i8*, i8** %7
%13 = load i64, i64* %8
%14 = load i64, i64* %9
%15 = load i8*, i8** %10
%16 = call i32 @__insert_pattern(%struct.dat* %11, i8* %12, i64 %13, i64 %14, i32 1, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
%struct.dat = type { i32 }
define i32 @insert_reverse_pattern(%struct.dat* %0, i8* %1, i64 %2, i64 %3, i8* %4) {
%6 = tail call i32 @__insert_pattern(%struct.dat* %0, i8* %1, i64 %2, i64 %3, i32 1, i8* %4)
ret i32 %6
}
int fts3_isalnum(int x) {
  return (x >= '0' && x <= '9') || (x >= 'A' && x <= 'Z') ||
         (x >= 'a' && x <= 'z');
}


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

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

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

LLVM IR (-O2):
define i32 @fts3_isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
unsigned long simple_strtoul(char const *, char **, unsigned int);
unsigned long strtoul(const char *cp, char **endp, unsigned int base) {
  return simple_strtoul(cp, endp, base);
}


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

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

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

LLVM IR (-O2):
define i64 @strtoul(i8* %0, i8** %1, i32 %2) {
%4 = tail call i64 @simple_strtoul(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
/* Variables and functions */
scalar_t__ mm_vtop(unsigned long);
extern unsigned long virt_to_phys(volatile void *address) {
  return (unsigned long)mm_vtop((unsigned long)address);
}


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

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

LLVM IR (-O0):
define i64 @virt_to_phys(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = call i64 @mm_vtop(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @virt_to_phys(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = tail call i64 @mm_vtop(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ clear_screen();
int /*<<< orphan*/ print_string(char *);
void main() {
  clear_screen();
  char *str = "awesome ";
  print_string(str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <clear_screen@plt>
lea    0xeca(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <print_string@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <clear_screen@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <print_string@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"awesome \00"
define void @main() {
%1 = alloca i8*
%2 = call i32 (...) @clear_screen()
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @print_string(i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"awesome \00"
define void @main() {
%1 = tail call i32 (...) @clear_screen()
%2 = tail call i32 @print_string(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
scalar_t__ fork();
int /*<<< orphan*/ setsid();
int make_daemon() {
  if (fork() > 0) {
    exit(0);
  }
  setsid();
  if (fork() > 0) {
    exit(0);
  }
  return 0;
}


x86 assembly (clang, -O0):
<make_daemon>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jle    114c <make_daemon+0x1c>
xor    %edi,%edi
call   1040 <exit@plt>
mov    $0x0,%al
call   1030 <setsid@plt>
mov    $0x0,%al
call   1050 <fork@plt>
cmp    $0x0,%rax
jle    116b <make_daemon+0x3b>
xor    %edi,%edi
call   1040 <exit@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_daemon>:
push   %rax
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jg     1154 <make_daemon+0x24>
xor    %eax,%eax
call   1030 <setsid@plt>
xor    %eax,%eax
call   1050 <fork@plt>
test   %rax,%rax
jg     1154 <make_daemon+0x24>
xor    %eax,%eax
pop    %rcx
ret
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @make_daemon() {
%1 = call i64 (...) @fork()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = call i32 (...) @setsid()
%7 = call i64 (...) @fork()
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
define i32 @make_daemon() {
%1 = tail call i64 (...) @fork()
%2 = icmp sgt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 0)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @setsid()
%7 = tail call i64 (...) @fork()
%8 = icmp sgt i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @exit(i32 0)
unreachable
11: ; preds = %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("Szymon\n"
         "Miodowa 1\n"
         "Grabce Jozefpolskie\n"
         "96-320 Mszczonow\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [55 x i8] c"Szymon\0AMiodowa 1\0AGrabce Jozefpolskie\0A96-320 Mszczonow\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [54 x i8] c"Szymon\0AMiodowa 1\0AGrabce Jozefpolskie\0A96-320 Mszczonow\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errx(int, char *);
void xnomem(void) { errx(1, "Cannot allocate memory"); }


x86 assembly (clang, -O0):
<xnomem>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
lea    0xee0(%rip),%rsi
call   1030 <errx@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xnomem>:
lea    0xee9(%rip),%rsi
mov    $0x1,%edi
jmp    1030 <errx@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Cannot allocate memory\00"
define void @xnomem() {
%1 = call i32 @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Cannot allocate memory\00"
define void @xnomem() {
%1 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outb(char, int);
void counterA0DataRegister(char var) { outb(var, 0x0260 + 0x14); }


x86 assembly (clang, -O0):
<counterA0DataRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x274,%esi
movsbl -0x1(%rbp),%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<counterA0DataRegister>:
mov    $0x274,%esi
jmp    1030 <outb@plt>

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

LLVM IR (-O2):
define void @counterA0DataRegister(i8 signext %0) {
%2 = tail call i32 @outb(i8 signext %0, i32 628)
ret void
}
/* Variables and functions */
int system(void *);
int myfunc(void *arg) { return system(arg); }


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

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

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

LLVM IR (-O2):
define i32 @myfunc(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
void api_utilities_debug_log(const char *msg) { ; }


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

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

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

LLVM IR (-O2):
define void @api_utilities_debug_log(i8* nocapture %0) {
ret void
}
int sys$rewind(struct _fab *fab, void *err, void *suc) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(suc);
    register long int _a2 asm("rsi") = (long)(err);
    register long int _a1 asm("rdi") = (long)(fab);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x82\n\t"
                 : "=a"(resultvar)
                 : "i"(23), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$rewind>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x17,%rax
int    $0x82
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$rewind>:
mov    $0x17,%rax
int    $0x82
ret

LLVM IR (-O0):
%struct._fab = type opaque
define i32 @"sys$rewind"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca %struct._fab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._fab* %0, %struct._fab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%12 = load i8*, i8** %6
%13 = ptrtoint i8* %12 to i64
store i64 %13, i64* %8
%14 = load i8*, i8** %5
%15 = ptrtoint i8* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._fab*, %struct._fab** %4
%17 = ptrtoint %struct._fab* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 23, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._fab = type opaque
define i32 @"sys$rewind"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = ptrtoint i8* %2 to i64
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint %struct._fab* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x82\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 23, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;
typedef int uint16_t;

/* Variables and functions */
uint32_t to_minutes(uint16_t cdn, uint8_t h, uint8_t m) {
  uint32_t t;
  t = cdn;
  t *= 24;
  t += h;
  t *= 60;
  t += m;
  return t;
}


x86 assembly (clang, -O0):
<to_minutes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
imul   $0x18,-0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
imul   $0x3c,-0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_minutes>:
lea    (%rdi,%rdi,2),%eax
lea    (%rsi,%rax,8),%eax
imul   $0x3c,%eax,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @to_minutes(i32 %0, i64 %1, i64 %2) {
%4 = mul nsw i32 %0, 24
%5 = trunc i64 %1 to i32
%6 = add i32 %4, %5
%7 = mul nsw i32 %6, 60
%8 = trunc i64 %2 to i32
%9 = add i32 %7, %8
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  void intToStr(int value, char result[]);
  char result[81];
  intToStr(-867, result);
  printf("%s", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rsi
mov    $0xfffffc9d,%edi
call   1040 <intToStr@plt>
lea    -0x60(%rbp),%rsi
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    %rsp,%rbx
mov    $0xfffffc9d,%edi
mov    %rbx,%rsi
call   1040 <intToStr@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [81 x i8]
%2 = getelementptr inbounds [81 x i8], [81 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
char *calloc(int, int);
int /*<<< orphan*/ printError();
int /*<<< orphan*/ resetStr(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
char *intToStr(int x) {
  char *str = calloc(15, sizeof(char));
  if (str == NULL) {
    printError();
  }
  resetStr(str);
  str[14] = '\0';
  sprintf(str, "%d", x);
  return str;
}


x86 assembly (clang, -O0):
<intToStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xf,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1170 <intToStr+0x30>
mov    $0x0,%al
call   1050 <printError@plt>
mov    -0x10(%rbp),%rdi
call   1030 <resetStr@plt>
mov    -0x10(%rbp),%rax
movb   $0x0,0xe(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe71(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intToStr>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
mov    $0xf,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1163 <intToStr+0x23>
xor    %eax,%eax
call   1050 <printError@plt>
mov    %rbx,%rdi
call   1030 <resetStr@plt>
movb   $0x0,0xe(%rbx)
lea    0xe8a(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1060 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i8* @intToStr(i32 %0) {
%2 = tail call dereferenceable_or_null(15) i8* @calloc(i32 15, i32 1)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @printError()
br label %6
6: ; preds = %4, %1
%7 = tail call i32 @resetStr(i8* %2)
%8 = getelementptr inbounds i8, i8* %2, i64 14
store i8 0, i8* %8
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* %2
}
void BTIC1H_Range_Unlock() {}


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

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

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

LLVM IR (-O2):
define void @BTIC1H_Range_Unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  int i = 15;
  printf("The value: %.2f\n", (float)i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xf,-0x8(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"The value: %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 15, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to float
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"The value: %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), float 1.500000e+01)
ret i32 0
}
/* Variables and functions */
scalar_t__ notend(char const);
char *strcpy(char *dest, const char *src) {
  char *origin = dest;
  while (notend(*src)) {
    *dest++ = *src++;
  }
  *dest = '\0';
  return origin;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <notend@plt>
cmp    $0x0,%rax
je     1165 <strcpy+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1128 <strcpy+0x18>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
movsbl (%rsi),%edi
call   1030 <notend@plt>
mov    %r14,%rbx
test   %rax,%rax
je     115d <strcpy+0x4d>
add    $0x1,%r15
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl -0x1(%r15),%eax
mov    %al,(%rbx)
add    $0x1,%rbx
movsbl (%r15),%edi
call   1030 <notend@plt>
add    $0x1,%r15
test   %rax,%rax
jne    1140 <strcpy+0x30>
movb   $0x0,(%rbx)
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = tail call i64 @notend(i8 signext %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = phi i8* [ %9, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %8
%11 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %10, i8* %7
%12 = load i8, i8* %9
%13 = tail call i64 @notend(i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %2
%16 = phi i8* [ %0, %2 ], [ %11, %6 ]
store i8 0, i8* %16
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ cs2scbx(void *, void *);
void cs2scbx_(void *icbfnx, void *data) { cs2scbx(icbfnx, data); }


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

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

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

LLVM IR (-O2):
define void @cs2scbx_(i8* %0, i8* %1) {
%3 = tail call i32 @cs2scbx(i8* %0, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ turn_led_off_tir(int);
int /*<<< orphan*/ turn_led_on_tir(int);
void switch_green(bool state) {
  if (state) {
    turn_led_on_tir(0x20);
  } else {
    turn_led_off_tir(0x20);
  }
}


x86 assembly (clang, -O0):
<switch_green>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <switch_green+0x24>
mov    $0x20,%edi
call   1030 <turn_led_on_tir@plt>
jmp    114e <switch_green+0x2e>
mov    $0x20,%edi
call   1040 <turn_led_off_tir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_green>:
test   %edi,%edi
je     112e <switch_green+0xe>
mov    $0x20,%edi
jmp    1030 <turn_led_on_tir@plt>
mov    $0x20,%edi
jmp    1040 <turn_led_off_tir@plt>

LLVM IR (-O0):
define void @switch_green(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @turn_led_on_tir(i32 32)
br label %9
7: ; preds = %1
%8 = call i32 @turn_led_off_tir(i32 32)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @switch_green(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @turn_led_on_tir(i32 32)
br label %7
5: ; preds = %1
%6 = tail call i32 @turn_led_off_tir(i32 32)
br label %7
7: ; preds = %5, %3
ret void
}