xunge/DecIR huggingface dataset:
/* Variables and functions */
char *malloc(int);
size_t snprintf(int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
size_t scim_bridge_string_from_int(char **str, int value) {
  const size_t str_length = snprintf(0, 0, "%d", value);
  *str = malloc(sizeof(char) * (str_length + 1));
  sprintf(*str, "%d", value);
  return str_length;
}


x86 assembly (clang, -O0):
<scim_bridge_string_from_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %esi,%esi
lea    0xeb5(%rip),%rdx
mov    %esi,%edi
call   1030 <snprintf@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%edx
lea    0xe7c(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scim_bridge_string_from_int>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xebd(%rip),%r15
xor    %edi,%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    %ebp,%ecx
call   1030 <snprintf@plt>
mov    %rax,%rbx
lea    0x1(%rax),%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i64 @scim_bridge_string_from_int(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i64
store i8** %0, i8*** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i64 @snprintf(i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %6)
store i64 %7, i64* %5
%8 = load i64, i64* %5
%9 = add i64 %8, 1
%10 = mul i64 1, %9
%11 = trunc i64 %10 to i32
%12 = call i8* @malloc(i32 %11)
%13 = load i8**, i8*** %3
store i8* %12, i8** %13
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = load i32, i32* %4
%17 = call i32 @sprintf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %16)
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i64 @scim_bridge_string_from_int(i8** nocapture writeonly %0, i32 %1) {
%3 = tail call i64 @snprintf(i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%4 = trunc i64 %3 to i32
%5 = add i32 %4, 1
%6 = tail call i8* @malloc(i32 %5)
store i8* %6, i8** %0
%7 = tail call i32 @sprintf(i8* dereferenceable(1) %6, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i64 %3
}
/* Variables and functions */
int O_NOCTTY;
int O_RDWR;
int open(char *, int);
int getpt() { return open("/dev/ptmx", O_RDWR | O_NOCTTY); }


x86 assembly (clang, -O0):
<getpt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%esi
mov    0x2eb4(%rip),%rax
or     (%rax),%esi
lea    0xed3(%rip),%rdi
call   1030 <open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getpt>:
mov    0x2ed1(%rip),%rax
mov    0x2eba(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xed7(%rip),%rdi
jmp    1030 <open@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
define i32 @getpt() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %1, %2
%4 = call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [10 x i8] c"/dev/ptmx\00"
@O_RDWR = global i32 0
@O_NOCTTY = global i32 0
define i32 @getpt() {
%1 = load i32, i32* @O_RDWR
%2 = load i32, i32* @O_NOCTTY
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void platform_releasebuffer(char *buffer) { free(buffer); }


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

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

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

LLVM IR (-O2):
define void @platform_releasebuffer(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ tempString;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int setStandardProcedure(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int /*<<< orphan*/ stderr;
int setUTCOffset(double hours) {
  char tempString[16];
  snprintf(tempString, sizeof(tempString), "#:SG %+03d#", (int)hours);
  fprintf(stderr, "UTC string is %s\n", tempString);
  return (setStandardProcedure(tempString));
}


x86 assembly (clang, -O0):
<setUTCOffset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
cvttsd2si -0x8(%rbp),%ecx
mov    $0x10,%esi
lea    0xeae(%rip),%rdx
call   1040 <snprintf@plt>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
lea    -0x20(%rbp),%rdx
lea    0xea1(%rip),%rsi
call   1050 <fprintf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <setStandardProcedure@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setUTCOffset>:
push   %rbx
sub    $0x10,%rsp
cvttsd2si %xmm0,%ecx
lea    0xec0(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
call   1040 <snprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <setStandardProcedure@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"#:SG %+03d#\00"
@stderr = global i32 0
@.str.1 = [18 x i8] c"UTC string is %s\0A\00"
define i32 @setUTCOffset(double %0) {
%2 = alloca double
%3 = alloca [16 x i8]
store double %0, double* %2
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%5 = load double, double* %2
%6 = fptosi double %5 to i32
%7 = call i32 @snprintf(i8* %4, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* @stderr
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%12 = call i32 @setStandardProcedure(i8* %11)
ret i32 %12
}

LLVM IR (-O2):
@.str = [12 x i8] c"#:SG %+03d#\00"
@stderr = global i32 0
@.str.1 = [18 x i8] c"UTC string is %s\0A\00"
define i32 @setUTCOffset(double %0) {
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = fptosi double %0 to i32
%5 = call i32 @snprintf(i8* %3, i32 16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = call i32 @setStandardProcedure(i8* %3)
ret i32 %8
}
/* Variables and functions */
int int_input();
int /*<<< orphan*/ printf(char *);
int prompt_day(void) {
  int temp_value = 0;
  printf("Enter Day: ");
  temp_value = int_input();
  return temp_value;
}


x86 assembly (clang, -O0):
<prompt_day>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <int_input@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Enter Day: \00"
define i32 @prompt_day() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @int_input()
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
@.str = [12 x i8] c"Enter Day: \00"
define i32 @prompt_day() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @int_input()
ret i32 %2
}
/* Variables and functions */
scalar_t__ calloc(int, int);
int *zero_ivec(int n) {
  int *p = (int *)calloc(n, sizeof(int));
  return p;
}


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

x86 assembly (clang, -O2):
<zero_ivec>:
mov    $0x4,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i32* @zero_ivec(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i64 @calloc(i32 %4, i32 4)
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32*, i32** %3
ret i32* %7
}

LLVM IR (-O2):
define i32* @zero_ivec(i32 %0) {
%2 = tail call i64 @calloc(i32 %0, i32 4)
%3 = inttoptr i64 %2 to i32*
ret i32* %3
}
int intlog2(int v) {
  int i;
  for (i = 0; v >>= 1; i++)
    ;
  return (i);
}


x86 assembly (clang, -O0):
<intlog2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1133 <intlog2+0x33>
jmp    1125 <intlog2+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <intlog2+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<intlog2>:
xor    %eax,%eax
cmp    $0x2,%edi
jb     111c <intlog2+0x1c>
xor    %eax,%eax
mov    %edi,%ecx
nopl   0x0(%rax,%rax,1)
sar    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <intlog2+0x10>
ret

LLVM IR (-O0):
define i32 @intlog2(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i32, i32* %2
%6 = ashr i32 %5, 1
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %4
br label %9
9: ; preds = %8
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %4
12: ; preds = %4
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @intlog2(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i32 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int help_clear(int argc, char **argv) {
  printf("\n\033[1mclear [ip|ipv6|arp|neighbor|hist]\033[0m\n"
         "  Clear ip/ipv6 address, arp/neighbor table, command history\n");
  return 1;
}


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

x86 assembly (clang, -O2):
<help_clear>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [105 x i8] c"\0A\1B[1mclear [ip|ipv6|arp|neighbor|hist]\1B[0m\0A Clear ip/ipv6 address, arp/neighbor table, command history\0A\00"
define i32 @help_clear(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@str = [104 x i8] c"\0A\1B[1mclear [ip|ipv6|arp|neighbor|hist]\1B[0m\0A Clear ip/ipv6 address, arp/neighbor table, command history\00"
define i32 @help_clear(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
ret i32 1
}
void swap(char *ptr1[], int first, int second) {
  char *temp;
  temp = ptr1[first];
  ptr1[first] = ptr1[second];
  ptr1[second] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,8),%rcx
movslq %edx,%rdx
mov    (%rdi,%rdx,8),%rsi
mov    %rsi,(%rdi,%rax,8)
mov    %rcx,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
define void @swap(i8** nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8*, i8** %0, i64 %4
%6 = load i8*, i8** %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
store i8* %9, i8** %5
store i8* %6, i8** %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printBinary(int num) {
  int resultOfMuti = 1;
  int remain = 1;
  if (num == 0)
    return;
  resultOfMuti = num / 2;
  remain = num % 2;
  printBinary(resultOfMuti);
  printf(" %d", remain);
}


x86 assembly (clang, -O0):
<printBinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <printBinary+0x28>
jmp    117b <printBinary+0x5b>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <printBinary@plt>
mov    -0xc(%rbp),%esi
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printBinary>:
test   %edi,%edi
je     1149 <printBinary+0x29>
push   %rbx
mov    %edi,%ebx
shr    $0x1f,%edi
add    %ebx,%edi
mov    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%ebx
sar    %edi
call   1040 <printBinary@plt>
lea    0xebf(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
define void @printBinary(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = sdiv i32 %0, 2
%6 = srem i32 %0, 2
tail call void @printBinary(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ do_csi(char *, int, int);
void decelr(int all_or_one, int pixels_or_cells) {
  do_csi("%d;%d'z", all_or_one, pixels_or_cells);
}


x86 assembly (clang, -O0):
<decelr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xed5(%rip),%rdi
call   1030 <do_csi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decelr>:
mov    %esi,%edx
mov    %edi,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <do_csi@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%d;%d'z\00"
define void @decelr(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 = call i32 @do_csi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%d;%d'z\00"
define void @decelr(i32 %0, i32 %1) {
%3 = tail call i32 @do_csi(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
void osm_end(FILE *out) { fprintf(out, "</osm>\n"); }


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

x86 assembly (clang, -O2):
<osm_end>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"</osm>\0A\00"
define void @osm_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"</osm>\0A\00"
define void @osm_end(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64 7, i64 1, i32* %0)
ret void
}
void console_tx_byte(unsigned char ch) {
  asm volatile("int $0x80" : : "a"(4), "b"(1), "c"(addr_of_char(ch)), "d"(1));
}


x86 assembly (clang, -O0):
<console_tx_byte>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %dil,%al
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edi
mov    $0x0,%al
call   1030 <addr_of_char@plt>
mov    %eax,%ecx
mov    $0x4,%eax
mov    $0x1,%edx
mov    %edx,%ebx
int    $0x80
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<console_tx_byte>:
push   %rbx
xor    %eax,%eax
call   1030 <addr_of_char@plt>
mov    %eax,%ecx
mov    $0x4,%eax
mov    $0x1,%ebx
mov    $0x1,%edx
int    $0x80
pop    %rbx
ret

LLVM IR (-O0):
define void @console_tx_byte(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = call i32 (i32, ...) bitcast (i32 (...)* @addr_of_char to i32 (i32, ...)*)(i32 %4)
ret void
}

LLVM IR (-O2):
define void @console_tx_byte(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @addr_of_char to i32 (i32, ...)*)(i32 %2)
tail call void asm sideeffect "int $$0x80", "{ax},{bx},{cx},{dx},~{dirflag},~{fpsr},~{flags}"(i32 4, i32 1, i32 %3, i32 1)
ret void
}
/* Variables and functions */
int sscanf(char *, char *, float *);
int parse_float_option(char *o, float *f) {
  int rc;
  rc = sscanf(o, "%f", f);
  if (rc != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<parse_float_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
je     114d <parse_float_option+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <parse_float_option+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_float_option>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @parse_float_option(i8* nocapture %0, float* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printTitle();
int printUsage(char *);
int updateYMAYOffset(int, char **);
int main(int argc, char **argv) {
  printTitle();
  return (argc != 3) ? printUsage(argv[0]) : updateYMAYOffset(argc, argv);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <printTitle@plt>
cmpl   $0x3,-0x8(%rbp)
je     116b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <printUsage@plt>
mov    %eax,-0x14(%rbp)
jmp    117a <main+0x4a>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <updateYMAYOffset@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <printTitle@plt>
cmp    $0x3,%ebp
jne    1157 <main+0x27>
mov    $0x3,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <updateYMAYOffset@plt>
mov    (%rbx),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <printUsage@plt>

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
%6 = call i32 (...) @printTitle()
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @printUsage(i8* %12)
br label %18
14: ; preds = %2
%15 = load i32, i32* %4
%16 = load i8**, i8*** %5
%17 = call i32 @updateYMAYOffset(i32 %15, i8** %16)
br label %18
18: ; preds = %14, %9
%19 = phi i32 [ %13, %9 ], [ %17, %14 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @printTitle()
%4 = icmp eq i32 %0, 3
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 @printUsage(i8* %6)
br label %10
8: ; preds = %2
%9 = tail call i32 @updateYMAYOffset(i32 3, i8** %1)
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ %7, %5 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ uart_putchar(char const);
void uart_puts(const char *p) {
  for (; *p; ++p)
    uart_putchar(*p);
}


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

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

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

LLVM IR (-O2):
define void @uart_puts(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @uart_putchar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ is_alpha(char);
int is_valid_id_start(char c) { return (is_alpha(c) || c == '_') ? 1 : 0; }


x86 assembly (clang, -O0):
<is_valid_id_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
jne    1146 <is_valid_id_start+0x36>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%dl
xor    %eax,%eax
mov    $0x1,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_id_start>:
push   %rbx
mov    %edi,%ebx
call   1030 <is_alpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%bl
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_valid_id_start(i8 signext %0) {
%2 = tail call i64 @is_alpha(i8 signext %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i8 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ debug_print(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void main() {
  int i = 0;
  for (i = 1; i < 11; i += 2) {
    debug_print(i);
    int j;
    for (j = 0; j < 500000000; j++) {
    }
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x4(%rbp)
cmpl   $0xb,-0x4(%rbp)
jge    1182 <main+0x62>
mov    -0x4(%rbp),%edi
call   1040 <debug_print@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1dcd6500,-0x8(%rbp)
jge    116f <main+0x4f>
jmp    1161 <main+0x41>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    114f <main+0x2f>
jmp    1174 <main+0x54>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <main+0x16>
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1040 <debug_print@plt>
mov    $0x3,%edi
call   1040 <debug_print@plt>
mov    $0x5,%edi
call   1040 <debug_print@plt>
mov    $0x7,%edi
call   1040 <debug_print@plt>
mov    $0x9,%edi
call   1040 <debug_print@plt>
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @debug_print(i32 1)
%2 = tail call i32 @debug_print(i32 3)
%3 = tail call i32 @debug_print(i32 5)
%4 = tail call i32 @debug_print(i32 7)
%5 = tail call i32 @debug_print(i32 9)
%6 = tail call i32 @exit(i32 0)
unreachable
}
double max(double a, double b) {
  if (a > b)
    return a;
  return b;
}


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    112d <max+0x2d>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1137 <max+0x37>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max>:
maxsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @max(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %5
%8 = fcmp ogt double %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load double, double* %4
store double %10, double* %3
br label %13
11: ; preds = %2
%12 = load double, double* %5
store double %12, double* %3
br label %13
13: ; preds = %11, %9
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp ogt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void *occampi_typeattr_copychook(void *hook) { return hook; }


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

x86 assembly (clang, -O2):
<occampi_typeattr_copychook>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @occampi_typeattr_copychook(i8* readnone returned %0) {
ret i8* %0
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int note_open_P(uint8_t flags) { return flags & 0x40; }


x86 assembly (clang, -O0):
<note_open_P>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x40,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_open_P>:
mov    %edi,%eax
and    $0x40,%eax
ret

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

LLVM IR (-O2):
define i32 @note_open_P(i32 %0) {
%2 = and i32 %0, 64
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int from_bcd(int /*<<< orphan*/ const);
uint32_t get_msf(const uint8_t *p) {
  uint32_t s = from_bcd(p[0]) * 60 + from_bcd(p[1]);
  return s * 75 + from_bcd(p[2]);
}


x86 assembly (clang, -O0):
<get_msf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <from_bcd@plt>
imul   $0x3c,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <from_bcd@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
imul   $0x4b,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
call   1030 <from_bcd@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_msf>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <from_bcd@plt>
imul   $0x3c,%eax,%ebp
mov    0x4(%rbx),%edi
call   1030 <from_bcd@plt>
add    %ebp,%eax
imul   $0x4b,%eax,%ebp
mov    0x8(%rbx),%edi
call   1030 <from_bcd@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_msf(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = call i32 @from_bcd(i32 %6)
%8 = mul nsw i32 %7, 60
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = call i32 @from_bcd(i32 %11)
%13 = add nsw i32 %8, %12
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 75
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = call i32 @from_bcd(i32 %18)
%20 = add nsw i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @get_msf(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @from_bcd(i32 %2)
%4 = mul nsw i32 %3, 60
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @from_bcd(i32 %6)
%8 = add nsw i32 %7, %4
%9 = mul nsw i32 %8, 75
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = tail call i32 @from_bcd(i32 %11)
%13 = add nsw i32 %9, %12
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ __sh_fetch_add(int volatile *, int);
void a_inc(volatile int *x) { __sh_fetch_add(x, 1); }


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

x86 assembly (clang, -O2):
<a_inc>:
mov    $0x1,%esi
jmp    1030 <__sh_fetch_add@plt>

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

LLVM IR (-O2):
define void @a_inc(i32* %0) {
%2 = tail call i32 @__sh_fetch_add(i32* %0, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main(void) {
  float amount = 0;
  printf("Enter an amount: ");
  scanf("%f", &amount);
  printf("With tax added: $%.2f\n", amount * 1.05f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xea3(%rip),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeaa(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Enter an amount: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"With tax added: $%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%5 = load float, float* %2
%6 = fmul float %5, 0x3FF0CCCCC0000000
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Enter an amount: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [23 x i8] c"With tax added: $%.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 0x3FF0CCCCC0000000
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct isal_zstream {
  int dummy;
};
struct deflate_icf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ gen_icf_map_h1_base(struct isal_zstream *,
                                       struct deflate_icf *,
                                       int /*<<< orphan*/);
void gen_icf_map_lh1(struct isal_zstream *stream,
                     struct deflate_icf *matches_icf_lookup,
                     uint64_t input_size) {
  gen_icf_map_h1_base(stream, matches_icf_lookup, input_size);
}


x86 assembly (clang, -O0):
<gen_icf_map_lh1>:
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 <gen_icf_map_h1_base@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_icf_map_lh1>:
jmp    1030 <gen_icf_map_h1_base@plt>

LLVM IR (-O0):
%struct.isal_zstream = type { i32 }
%struct.deflate_icf = type { i32 }
define void @gen_icf_map_lh1(%struct.isal_zstream* %0, %struct.deflate_icf* %1, i32 %2) {
%4 = alloca %struct.isal_zstream*
%5 = alloca %struct.deflate_icf*
%6 = alloca i32
store %struct.isal_zstream* %0, %struct.isal_zstream** %4
store %struct.deflate_icf* %1, %struct.deflate_icf** %5
store i32 %2, i32* %6
%7 = load %struct.isal_zstream*, %struct.isal_zstream** %4
%8 = load %struct.deflate_icf*, %struct.deflate_icf** %5
%9 = load i32, i32* %6
%10 = call i32 @gen_icf_map_h1_base(%struct.isal_zstream* %7, %struct.deflate_icf* %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.isal_zstream = type { i32 }
%struct.deflate_icf = type { i32 }
define void @gen_icf_map_lh1(%struct.isal_zstream* %0, %struct.deflate_icf* %1, i32 %2) {
%4 = tail call i32 @gen_icf_map_h1_base(%struct.isal_zstream* %0, %struct.deflate_icf* %1, i32 %2)
ret void
}
/* Variables and functions */
unsigned long *malloc(size_t);
void *memset(unsigned long *, int /*<<< orphan*/, size_t);
void *calloc(size_t nmemb, size_t size) {
  unsigned long *ptr;
  if ((ptr = malloc(nmemb * size)))
    return memset(ptr, 0, nmemb * size);
  return NULL;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1169 <calloc+0x49>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rdx
imul   -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <calloc+0x51>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %rbx
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <malloc@plt>
test   %rax,%rax
je     1143 <calloc+0x23>
mov    %rax,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <memset@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i64* @malloc(i64 %3)
%5 = icmp eq i64* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i8* @memset(i64* %4, i32 0, i64 %3)
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ null, %2 ]
ret i8* %9
}
void Xil_ExceptionNullHandler(void *Data) { (void)Data; }


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

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

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

LLVM IR (-O2):
define void @Xil_ExceptionNullHandler(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("btvirt - Bluetooth emulator\n"
         "Usage:\n");
  printf("\tbtvirt [options]\n");
  printf("options:\n"
         "\t-S                    Create local serial port\n"
         "\t-s                    Create local server sockets\n"
         "\t-l [num]              Number of local controllers\n"
         "\t-L                    Create LE only controller\n"
         "\t-B                    Create BR/EDR only controller\n"
         "\t-A                    Create AMP controller\n"
         "\t-h, --help            Show help options\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeff(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"btvirt - Bluetooth emulator\0AUsage:\0A\00"
@.str.1 = [19 x i8] c"\09btvirt [options]\0A\00"
@.str.2 = [348 x i8] c"options:\0A\09-S Create local serial port\0A\09-s Create local server sockets\0A\09-l [num] Number of local controllers\0A\09-L Create LE only controller\0A\09-B Create BR/EDR only controller\0A\09-A Create AMP controller\0A\09-h, --help Show help options\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([348 x i8], [348 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"btvirt - Bluetooth emulator\0AUsage:\00"
@str.3 = [18 x i8] c"\09btvirt [options]\00"
@str.4 = [347 x i8] c"options:\0A\09-S Create local serial port\0A\09-s Create local server sockets\0A\09-l [num] Number of local controllers\0A\09-L Create LE only controller\0A\09-B Create BR/EDR only controller\0A\09-A Create AMP controller\0A\09-h, --help Show help options\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([347 x i8], [347 x i8]* @str.4, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t xor64() {
  static uint32_t x = 123456789, y = 362436069;
  uint32_t t = (x ^ (x << 10));
  x = y;
  return y = (y ^ (y >> 10)) ^ (t ^ (t >> 13));
}


x86 assembly (clang, -O0):
<xor64>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f16(%rip),%eax
mov    0x2f10(%rip),%ecx
shl    $0xa,%ecx
xor    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    0x2f06(%rip),%eax
mov    %eax,0x2efc(%rip)
mov    0x2efa(%rip),%eax
mov    0x2ef4(%rip),%ecx
sar    $0xa,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%edx
sar    $0xd,%edx
xor    %edx,%ecx
xor    %ecx,%eax
mov    %eax,0x2edc(%rip)
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor64>:
mov    0x2f1a(%rip),%ecx
mov    %ecx,%eax
shl    $0xa,%eax
xor    %ecx,%eax
mov    0x2f11(%rip),%ecx
mov    %ecx,0x2f07(%rip)
mov    %ecx,%edx
sar    $0xa,%edx
xor    %ecx,%edx
xor    %eax,%edx
sar    $0xd,%eax
xor    %edx,%eax
mov    %eax,0x2ef7(%rip)
ret

LLVM IR (-O0):
@xor64.x = internal global i32 123456789
@xor64.y = internal global i32 362436069
define i32 @xor64() {
%1 = alloca i32
%2 = load i32, i32* @xor64.x
%3 = load i32, i32* @xor64.x
%4 = shl i32 %3, 10
%5 = xor i32 %2, %4
store i32 %5, i32* %1
%6 = load i32, i32* @xor64.y
store i32 %6, i32* @xor64.x
%7 = load i32, i32* @xor64.y
%8 = load i32, i32* @xor64.y
%9 = ashr i32 %8, 10
%10 = xor i32 %7, %9
%11 = load i32, i32* %1
%12 = load i32, i32* %1
%13 = ashr i32 %12, 13
%14 = xor i32 %11, %13
%15 = xor i32 %10, %14
store i32 %15, i32* @xor64.y
ret i32 %15
}

LLVM IR (-O2):
@xor64.x = internal unnamed_addr global i32 123456789
@xor64.y = internal unnamed_addr global i32 362436069
define i32 @xor64() {
%1 = load i32, i32* @xor64.x
%2 = shl i32 %1, 10
%3 = xor i32 %2, %1
%4 = load i32, i32* @xor64.y
store i32 %4, i32* @xor64.x
%5 = ashr i32 %4, 10
%6 = ashr i32 %3, 13
%7 = xor i32 %5, %4
%8 = xor i32 %7, %3
%9 = xor i32 %8, %6
store i32 %9, i32* @xor64.y
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
int /*<<< orphan*/ factor();
int /*<<< orphan*/ match(char);
void multiply(void) {
  match('*');
  factor();
  emitln("MULS (SP)+,D0");
}


x86 assembly (clang, -O0):
<multiply>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2a,%edi
call   1040 <match@plt>
mov    $0x0,%al
call   1050 <factor@plt>
lea    0xeb4(%rip),%rdi
call   1030 <emitln@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply>:
push   %rax
mov    $0x2a,%edi
call   1040 <match@plt>
xor    %eax,%eax
call   1050 <factor@plt>
lea    0xeb7(%rip),%rdi
pop    %rax
jmp    1030 <emitln@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"MULS (SP)+,D0\00"
define void @multiply() {
%1 = call i32 @match(i8 signext 42)
%2 = call i32 (...) @factor()
%3 = call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"MULS (SP)+,D0\00"
define void @multiply() {
%1 = tail call i32 @match(i8 signext 42)
%2 = tail call i32 (...) @factor()
%3 = tail call i32 @emitln(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}