xunge/DecIR huggingface dataset:
/* Type definitions */
typedef unsigned int uint8_t;

/* Variables and functions */
void bf_toggle(uint8_t field[], size_t idx) {
  field[idx / 8] ^= (1u << (idx % 8));
}


x86 assembly (clang, -O0):
<bf_toggle>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
shr    $0x3,%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bf_toggle>:
mov    %esi,%ecx
and    $0x7,%cl
mov    $0x1,%eax
shl    %cl,%eax
shr    $0x3,%rsi
xor    %eax,(%rdi,%rsi,4)
ret

LLVM IR (-O0):
define void @bf_toggle(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = urem i64 %5, 8
%7 = trunc i64 %6 to i32
%8 = shl i32 1, %7
%9 = load i32*, i32** %3
%10 = load i64, i64* %4
%11 = udiv i64 %10, 8
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = xor i32 %13, %8
store i32 %14, i32* %12
ret void
}

LLVM IR (-O2):
define void @bf_toggle(i32* nocapture %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = and i32 %3, 7
%5 = shl nuw nsw i32 1, %4
%6 = lshr i64 %1, 3
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
%9 = xor i32 %8, %5
store i32 %9, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ teardown();
void cleanup(int sig) {
  fprintf(stderr, "Interrupted...\n");
  teardown();
  exit(sig);
}


x86 assembly (clang, -O0):
<cleanup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1050 <teardown@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cleanup>:
push   %rbx
mov    %edi,%ebx
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1050 <teardown@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Interrupted...\0A\00"
define void @cleanup(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @teardown()
%6 = load i32, i32* %2
%7 = call i32 @exit(i32 %6)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Interrupted...\0A\00"
define void @cleanup(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @teardown()
%5 = tail call i32 @exit(i32 %0)
unreachable
}
/* Type definitions */
struct comp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CloseBreezeSimulation(int);
int /*<<< orphan*/ printf(char *);
void BrzBinaryFuncConstRPush_requp(struct comp *comp, int port) {
  printf("BrzBinaryFuncConstRPush_ackup: This code should never be reached\n");
  CloseBreezeSimulation(2);
}


x86 assembly (clang, -O0):
<BrzBinaryFuncConstRPush_requp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2,%edi
call   1040 <CloseBreezeSimulation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BrzBinaryFuncConstRPush_requp>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x2,%edi
pop    %rax
jmp    1040 <CloseBreezeSimulation@plt>

LLVM IR (-O0):
%struct.comp = type { i32 }
@.str = [66 x i8] c"BrzBinaryFuncConstRPush_ackup: This code should never be reached\0A\00"
define void @BrzBinaryFuncConstRPush_requp(%struct.comp* %0, i32 %1) {
%3 = alloca %struct.comp*
%4 = alloca i32
store %struct.comp* %0, %struct.comp** %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @CloseBreezeSimulation(i32 2)
ret void
}

LLVM IR (-O2):
%struct.comp = type { i32 }
@str = [65 x i8] c"BrzBinaryFuncConstRPush_ackup: This code should never be reached\00"
define void @BrzBinaryFuncConstRPush_requp(%struct.comp* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @CloseBreezeSimulation(i32 2)
ret void
}
double min(double d1, double d2) {
  if (d1 < d2)
    return (d1);
  return (d2);
}


x86 assembly (clang, -O0):
<min>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <min+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    113b <min+0x3b>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<min>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @min(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 olt 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 @min(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
void X509at_get0_data_by_OBJ(void) {}


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

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

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

LLVM IR (-O2):
define void @X509at_get0_data_by_OBJ() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int getlamp() {
  printf("getlamp()\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [10 x i8] c"getlamp()\00"
define i32 @getlamp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct NpLinkedListIterator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct NpLinkedListIterator *);
void np_linkedlist_iterator_free(struct NpLinkedListIterator *iter) {
  free(iter);
}


x86 assembly (clang, -O0):
<np_linkedlist_iterator_free>:
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):
<np_linkedlist_iterator_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.NpLinkedListIterator = type { i32 }
define void @np_linkedlist_iterator_free(%struct.NpLinkedListIterator* %0) {
%2 = alloca %struct.NpLinkedListIterator*
store %struct.NpLinkedListIterator* %0, %struct.NpLinkedListIterator** %2
%3 = load %struct.NpLinkedListIterator*, %struct.NpLinkedListIterator** %2
%4 = call i32 @free(%struct.NpLinkedListIterator* %3)
ret void
}

LLVM IR (-O2):
%struct.NpLinkedListIterator = type { i32 }
define void @np_linkedlist_iterator_free(%struct.NpLinkedListIterator* nocapture %0) {
%2 = tail call i32 @free(%struct.NpLinkedListIterator* %0)
ret void
}
/* Variables and functions */
int rand();
double GetThousandToHundThousand() {
  double r = rand() % 100000;
  return r / 1000000000;
}


x86 assembly (clang, -O0):
<GetThousandToHundThousand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x186a0,%ecx
cltd
idiv   %ecx
cvtsi2sd %edx,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec3(%rip),%xmm1
divsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetThousandToHundThousand>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x14f8b589,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x186a0,%ecx,%ecx
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
divsd  0xebe(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @GetThousandToHundThousand() {
%1 = alloca double
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 100000
%4 = sitofp i32 %3 to double
store double %4, double* %1
%5 = load double, double* %1
%6 = fdiv double %5, 1.000000e+09
ret double %6
}

LLVM IR (-O2):
define double @GetThousandToHundThousand() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 100000
%3 = sitofp i32 %2 to double
%4 = fdiv double %3, 1.000000e+09
ret double %4
}
void I2CSoftwareResetEnable(unsigned long ulBase) {
  ;
  while (((*((volatile unsigned long *)(ulBase + 0x00000014))) & 0x00000010))
    ;
  while (!((*((volatile unsigned long *)(ulBase + 0x00000018))) & 0x00000002))
    ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00008000;
}


x86 assembly (clang, -O0):
<I2CSoftwareResetEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%rax
and    $0x10,%rax
cmp    $0x0,%rax
je     1123 <I2CSoftwareResetEnable+0x23>
jmp    1108 <I2CSoftwareResetEnable+0x8>
jmp    1128 <I2CSoftwareResetEnable+0x28>
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
and    $0x2,%rax
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <I2CSoftwareResetEnable+0x4a>
jmp    114f <I2CSoftwareResetEnable+0x4f>
jmp    1128 <I2CSoftwareResetEnable+0x28>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x8000,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSoftwareResetEnable>:
testq  $0x10,0x14(%rdi)
jne    1100 <I2CSoftwareResetEnable>
nopw   0x0(%rax,%rax,1)
testq  $0x2,0x18(%rdi)
je     1110 <I2CSoftwareResetEnable+0x10>
orq    $0x8000,(%rdi)
ret

LLVM IR (-O0):
define void @I2CSoftwareResetEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %10, %1
%4 = load i64, i64* %2
%5 = add i64 %4, 20
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, 16
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %3
11: ; preds = %3
br label %12
12: ; preds = %20, %11
%13 = load i64, i64* %2
%14 = add i64 %13, 24
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = and i64 %16, 2
%18 = icmp ne i64 %17, 0
%19 = xor i1 %18, true
br i1 %19, label %20, label %21
20: ; preds = %12
br label %12
21: ; preds = %12
%22 = load i64, i64* %2
%23 = add i64 %22, 0
%24 = inttoptr i64 %23 to i64*
%25 = load volatile i64, i64* %24
%26 = or i64 %25, 32768
store volatile i64 %26, i64* %24
ret void
}

LLVM IR (-O2):
define void @I2CSoftwareResetEnable(i64 %0) {
%2 = add i64 %0, 20
%3 = inttoptr i64 %2 to i64*
br label %4
4: ; preds = %4, %1
%5 = load volatile i64, i64* %3
%6 = and i64 %5, 16
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %4
8: ; preds = %4
%9 = add i64 %0, 24
%10 = inttoptr i64 %9 to i64*
br label %11
11: ; preds = %8, %11
%12 = load volatile i64, i64* %10
%13 = and i64 %12, 2
%14 = icmp eq i64 %13, 0
br i1 %14, label %11, label %15
15: ; preds = %11
%16 = inttoptr i64 %0 to i64*
%17 = load volatile i64, i64* %16
%18 = or i64 %17, 32768
store volatile i64 %18, i64* %16
ret void
}
/* Variables and functions */
bool ascii_isblank(unsigned char c) { return c == ' ' || c == '\t'; }


x86 assembly (clang, -O0):
<ascii_isblank>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     1129 <ascii_isblank+0x29>
movzbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ascii_isblank>:
cmp    $0x20,%dil
sete   %al
cmp    $0x9,%dil
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ascii_isblank(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = icmp eq i32 %8, 9
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @ascii_isblank(i8 zeroext %0) {
%2 = icmp eq i8 %0, 32
%3 = icmp eq i8 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printint(int n) { printf(" %d |", n); }


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

x86 assembly (clang, -O2):
<printint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c" %d |\00"
define void @printint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
char *XOR(char val, char key) {
  char *a = (char *)malloc(sizeof(char));
  *a = val ^ key;
  return a;
}


x86 assembly (clang, -O0):
<XOR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
xor    %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XOR>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x1,%edi
call   1030 <malloc@plt>
xor    %ebx,%ebp
mov    %bpl,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @XOR(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8*
store i8 %0, i8* %3
store i8 %1, i8* %4
%6 = call i64 @malloc(i32 1)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %5
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = xor i32 %9, %11
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %5
store i8 %13, i8* %14
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @XOR(i8 signext %0, i8 signext %1) {
%3 = tail call i64 @malloc(i32 1)
%4 = inttoptr i64 %3 to i8*
%5 = xor i8 %1, %0
store i8 %5, i8* %4
ret i8* %4
}
/* Variables and functions */
long lswap4(long);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
void write_link2blk(unsigned char *datablk, long link) {
  link = lswap4(link);
  memmove(datablk + 3, (unsigned char *)&link, sizeof(long));
}


x86 assembly (clang, -O0):
<write_link2blk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <lswap4@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memmove@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_link2blk>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <lswap4@plt>
mov    %rax,0x8(%rsp)
add    $0x3,%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memmove@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @write_link2blk(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = call i64 @lswap4(i64 %5)
store i64 %6, i64* %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = bitcast i64* %4 to i8*
%10 = call i32 @memmove(i8* %8, i8* %9, i32 8)
ret void
}

LLVM IR (-O2):
define void @write_link2blk(i8* %0, i64 %1) {
%3 = alloca i64
%4 = tail call i64 @lswap4(i64 %1)
store i64 %4, i64* %3
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = bitcast i64* %3 to i8*
%7 = call i32 @memmove(i8* %5, i8* %6, i32 8)
ret void
}
const char *Function_Definition(void) {
  return "struct Function {\n"
         "  var (*func)(var);\n"
         "};\n";
}


x86 assembly (clang, -O0):
<Function_Definition>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Function_Definition>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [42 x i8] c"struct Function {\0A var (*func)(var);\0A};\0A\00"
define i8* @Function_Definition() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [42 x i8] c"struct Function {\0A var (*func)(var);\0A};\0A\00"
define i8* @Function_Definition() {
ret i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *name) {
  fprintf(stderr, "usage:\n\t%s <inputlength>\n", name);
  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 = [26 x i8] c"usage:\0A\09%s <inputlength>\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 ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [26 x i8] c"usage:\0A\09%s <inputlength>\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ arm_memio_strh(int /*<<< orphan*/);
int /*<<< orphan*/ t16_memio_imm5_op(int);
void t16_strh_imm5() { arm_memio_strh(t16_memio_imm5_op(2)); }


x86 assembly (clang, -O0):
<t16_strh_imm5>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1040 <t16_memio_imm5_op@plt>
mov    %eax,%edi
call   1030 <arm_memio_strh@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t16_strh_imm5>:
push   %rax
mov    $0x2,%edi
call   1040 <t16_memio_imm5_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_memio_strh@plt>

LLVM IR (-O0):
define void @t16_strh_imm5() {
%1 = call i32 @t16_memio_imm5_op(i32 2)
%2 = call i32 @arm_memio_strh(i32 %1)
ret void
}

LLVM IR (-O2):
define void @t16_strh_imm5() {
%1 = tail call i32 @t16_memio_imm5_op(i32 2)
%2 = tail call i32 @arm_memio_strh(i32 %1)
ret void
}
void gensd() {}


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

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

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

LLVM IR (-O2):
define void @gensd() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void add(int a, int b) { printf("%d\n", a + b); }


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

x86 assembly (clang, -O2):
<add>:
add    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @add(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int SEGGER_RTT_GetKey();
int SEGGER_RTT_WaitKey(void) {
  int r;
  do {
    r = SEGGER_RTT_GetKey();
  } while (r < 0);
  return r;
}


x86 assembly (clang, -O0):
<SEGGER_RTT_WaitKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <SEGGER_RTT_GetKey@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1118 <SEGGER_RTT_WaitKey+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SEGGER_RTT_WaitKey>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <SEGGER_RTT_GetKey@plt>
test   %eax,%eax
js     1120 <SEGGER_RTT_WaitKey+0x10>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @SEGGER_RTT_WaitKey() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @SEGGER_RTT_GetKey()
%3 = icmp slt i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ to_binary(int);
int main() {
  int n;
  scanf("%d", &n);
  to_binary(n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <to_binary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <to_binary@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @to_binary(i32 %4)
ret i32 0
}
int _close(int a __attribute__((unused))) { return 0; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *calloc(int, int);
timer_t *timer_create(void) {
  timer_t *timer = calloc(1, sizeof(timer_t));
  if (!timer) {
    return NULL;
  }
  return timer;
}


x86 assembly (clang, -O0):
<timer_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <timer_create+0x33>
movq   $0x0,-0x8(%rbp)
jmp    114b <timer_create+0x3b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define noalias i32* @timer_create() {
%1 = tail call i32* @calloc(i32 1, i32 4)
ret i32* %1
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_MAKE_RADIO_RESET_INPUT() { clear_io_bit(-3, 2); }


x86 assembly (clang, -O0):
<TOSH_MAKE_RADIO_RESET_INPUT>:
push   %rbp
mov    %rsp,%rbp
mov    $0xfffffffd,%edi
mov    $0x2,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_MAKE_RADIO_RESET_INPUT>:
mov    $0xfffffffd,%edi
mov    $0x2,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_RADIO_RESET_INPUT() {
%1 = call i32 @clear_io_bit(i32 -3, i32 2)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_RADIO_RESET_INPUT() {
%1 = tail call i32 @clear_io_bit(i32 -3, i32 2)
ret void
}
/* Variables and functions */
int iCompDate6(unsigned char *, unsigned char *);
int /*<<< orphan*/ vOneTwo0(unsigned char *, int, unsigned char *);
int iCompDate3(unsigned char *psDate1, unsigned char *psDate2) {
  unsigned char szDate1[7], szDate2[7];
  vOneTwo0(psDate1, 3, szDate1);
  vOneTwo0(psDate2, 3, szDate2);
  return (iCompDate6(szDate1, szDate2));
}


x86 assembly (clang, -O0):
<iCompDate3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x17(%rbp),%rdx
mov    $0x3,%esi
call   1040 <vOneTwo0@plt>
mov    -0x10(%rbp),%rdi
lea    -0x1e(%rbp),%rdx
mov    $0x3,%esi
call   1040 <vOneTwo0@plt>
lea    -0x17(%rbp),%rdi
lea    -0x1e(%rbp),%rsi
call   1030 <iCompDate6@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iCompDate3>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x9(%rsp),%r14
mov    $0x3,%esi
mov    %r14,%rdx
call   1040 <vOneTwo0@plt>
lea    0x2(%rsp),%r15
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r15,%rdx
call   1040 <vOneTwo0@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <iCompDate6@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @iCompDate3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [7 x i8]
%6 = alloca [7 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%9 = call i32 @vOneTwo0(i8* %7, i32 3, i8* %8)
%10 = load i8*, i8** %4
%11 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%12 = call i32 @vOneTwo0(i8* %10, i32 3, i8* %11)
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%15 = call i32 @iCompDate6(i8* %13, i8* %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @iCompDate3(i8* %0, i8* %1) {
%3 = alloca [7 x i8]
%4 = alloca [7 x i8]
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%7 = call i32 @vOneTwo0(i8* %0, i32 3, i8* %5)
%8 = call i32 @vOneTwo0(i8* %1, i32 3, i8* %6)
%9 = call i32 @iCompDate6(i8* %5, i8* %6)
ret i32 %9
}
int __test_bit(int nr, void *addr) {
  return (((unsigned long *)(addr))[(nr) / (sizeof(unsigned long) * 8)] >>
          ((nr) % (sizeof(unsigned long) * 8))) &
         1;
}


x86 assembly (clang, -O0):
<__test_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
shr    $0x6,%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4(%rbp),%rcx
and    $0x3f,%rcx
shr    %cl,%rax
and    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_bit>:
movslq %edi,%rcx
mov    %rcx,%rax
shr    $0x6,%rax
mov    (%rsi,%rax,8),%rax
shr    %cl,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @__test_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i64*
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = udiv i64 %8, 64
%10 = getelementptr inbounds i64, i64* %6, i64 %9
%11 = load i64, i64* %10
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = urem i64 %13, 64
%15 = lshr i64 %11, %14
%16 = and i64 %15, 1
%17 = trunc i64 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
define i32 @__test_bit(i32 %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to i64*
%4 = sext i32 %0 to i64
%5 = lshr i64 %4, 6
%6 = getelementptr inbounds i64, i64* %3, i64 %5
%7 = load i64, i64* %6
%8 = and i64 %4, 63
%9 = lshr i64 %7, %8
%10 = trunc i64 %9 to i32
%11 = and i32 %10, 1
ret i32 %11
}
void lcase(s) char *s;
{
  char *p;
  p = s;
  while (*p != '\0') {
    if (isupper(*p)) {
      *p = *p + 'a' - 'A';
    };
    p = p + 1;
  };
}


x86 assembly (clang, -O0):
<lcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116f <lcase+0x5f>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
je     115e <lcase+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <lcase+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcase>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%bpl
test   %bpl,%bpl
je     1153 <lcase+0x43>
mov    %rdi,%rbx
add    $0x1,%rbx
jmp    113c <lcase+0x2c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
je     1153 <lcase+0x43>
movsbl %bpl,%edi
call   1030 <isupper@plt>
test   %eax,%eax
je     1130 <lcase+0x20>
add    $0x20,%bpl
mov    %bpl,-0x1(%rbx)
jmp    1130 <lcase+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @lcase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %12
%5 = phi i8 [ %14, %12 ], [ %2, %1 ]
%6 = phi i8* [ %13, %12 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @isupper(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = add i8 %5, 32
store i8 %11, i8* %6
br label %12
12: ; preds = %10, %4
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %4
16: ; preds = %12, %1
ret void
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ yank_set(char, struct list *, int);
void yank_set_list(char reg, struct list *l) { yank_set(reg, l, 1); }


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

x86 assembly (clang, -O2):
<yank_set_list>:
mov    $0x1,%edx
jmp    1030 <yank_set@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define void @yank_set_list(i8 signext %0, %struct.list* %1) {
%3 = alloca i8
%4 = alloca %struct.list*
store i8 %0, i8* %3
store %struct.list* %1, %struct.list** %4
%5 = load i8, i8* %3
%6 = load %struct.list*, %struct.list** %4
%7 = call i32 @yank_set(i8 signext %5, %struct.list* %6, i32 1)
ret void
}

LLVM IR (-O2):
%struct.list = type { i32 }
define void @yank_set_list(i8 signext %0, %struct.list* %1) {
%3 = tail call i32 @yank_set(i8 signext %0, %struct.list* %1, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clean_routine();
int /*<<< orphan*/ inicialize_routine();
int /*<<< orphan*/ run_routine();
void try_solve_level() {
  inicialize_routine();
  run_routine();
  clean_routine();
}


x86 assembly (clang, -O0):
<try_solve_level>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <inicialize_routine@plt>
mov    $0x0,%al
call   1030 <run_routine@plt>
mov    $0x0,%al
call   1050 <clean_routine@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_solve_level>:
push   %rax
xor    %eax,%eax
call   1040 <inicialize_routine@plt>
xor    %eax,%eax
call   1030 <run_routine@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <clean_routine@plt>

LLVM IR (-O0):
define void @try_solve_level() {
%1 = call i32 (...) @inicialize_routine()
%2 = call i32 (...) @run_routine()
%3 = call i32 (...) @clean_routine()
ret void
}

LLVM IR (-O2):
define void @try_solve_level() {
%1 = tail call i32 (...) @inicialize_routine()
%2 = tail call i32 (...) @run_routine()
%3 = tail call i32 (...) @clean_routine()
ret void
}
/* Type definitions */
struct stat {
  int dummy;
};

/* Variables and functions */
int stat(char const *, struct stat *);
bool file_exists(const char *file_name) {
  struct stat statbuf;
  if (stat(file_name, &statbuf) != -1) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     113e <file_exists+0x2e>
movl   $0x1,-0x4(%rbp)
jmp    1145 <file_exists+0x35>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32 @stat(i8* %5, %struct.stat* %4)
%7 = icmp ne i32 %6, -1
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp ne i32 %4, -1
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
char const *cache_string_n(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
const char *cache_string(const char *s) { return cache_string_n(s, strlen(s)); }


x86 assembly (clang, -O0):
<cache_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <cache_string_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <cache_string_n@plt>

LLVM IR (-O0):
define i8* @cache_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i8* @cache_string_n(i8* %3, i32 %5)
ret i8* %6
}

LLVM IR (-O2):
define i8* @cache_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @cache_string_n(i8* %0, i32 %2)
ret i8* %3
}
int cmpFunc(const void *p1, const void *p2) {
  int **a = (int **)p1;
  int **b = (int **)p2;
  return (a[0][1] - b[0][1]);
}


x86 assembly (clang, -O0):
<cmpFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%eax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
sub    0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmpFunc>:
mov    (%rdi),%rax
mov    0x4(%rax),%eax
mov    (%rsi),%rcx
sub    0x4(%rcx),%eax
ret

LLVM IR (-O0):
define i32 @cmpFunc(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32**
%6 = alloca i32**
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32**
store i32** %8, i32*** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32**
store i32** %10, i32*** %6
%11 = load i32**, i32*** %5
%12 = getelementptr inbounds i32*, i32** %11, i64 0
%13 = load i32*, i32** %12
%14 = getelementptr inbounds i32, i32* %13, i64 1
%15 = load i32, i32* %14
%16 = load i32**, i32*** %6
%17 = getelementptr inbounds i32*, i32** %16, i64 0
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = sub nsw i32 %15, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @cmpFunc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = bitcast i8* %1 to i32**
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}
/* Variables and functions */
double ldexp(double, int);
int /*<<< orphan*/ printf(char *, double, int, double);
int main() {
  double x, ret;
  int n;
  x = 0.65;
  n = 3;
  ret = ldexp(x, n);
  printf("%f * 2^%d = %f\n", x, n, ret);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x3,-0x1c(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x1c(%rbp),%edi
call   1030 <ldexp@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x1c(%rbp),%esi
movsd  -0x18(%rbp),%xmm1
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    $0x3,%edi
call   1030 <ldexp@plt>
movaps %xmm0,%xmm1
lea    0xecb(%rip),%rdi
movsd  0xebb(%rip),%xmm0
mov    $0x3,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [16 x i8] c"%f * 2^%d = %f\0A\00"
define i32 @main() {
%1 = tail call double @ldexp(double 6.500000e-01, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 6.500000e-01, i32 3, double %1)
ret i32 0
}
double fun(int year) {
  int t = year - 2005;
  while (t >= 0) {
    return 33.2 + (16.8 * t);
  }
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x7d5,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     113e <fun+0x3e>
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xed7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
add    $0xfffff82b,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xeee(%rip),%xmm0
addsd  0xeee(%rip),%xmm0
ret

LLVM IR (-O0):
define double @fun(i32 %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = sub nsw i32 %5, 2005
store i32 %6, i32* %4
br label %7
7: ; preds = %1
%8 = load i32, i32* %4
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = call double @llvm.fmuladd.f64(double 1.680000e+01, double %12, double 3.320000e+01)
store double %13, double* %2
br label %14
14: ; preds = %10, %7
%15 = load double, double* %2
ret double %15
}

LLVM IR (-O2):
define double @fun(i32 %0) {
%2 = icmp sgt i32 %0, 2004
%3 = add nsw i32 %0, -2005
%4 = sitofp i32 %3 to double
%5 = tail call double @llvm.fmuladd.f64(double %4, double 1.680000e+01, double 3.320000e+01)
%6 = select i1 %2, double %5, double undef
ret double %6
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};
struct stack {
  int dummy;
};

/* Variables and functions */
scalar_t__ path_stat(struct stack **, char const *, struct stat *);
int st_is_file(int /*<<< orphan*/);
int path_is_file(struct stack **path, const char *fname) {
  struct stat st;
  if (path_stat(path, fname, &st))
    return 0;
  return st_is_file(st.st_mode);
}


x86 assembly (clang, -O0):
<path_is_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <path_stat@plt>
cmp    $0x0,%rax
je     1157 <path_is_file+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1162 <path_is_file+0x42>
mov    -0x20(%rbp),%edi
call   1030 <st_is_file@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_is_file>:
push   %rax
mov    %rsp,%rdx
call   1040 <path_stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <path_is_file+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1030 <st_is_file@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.stack = type { i32 }
%struct.stat = type { i32 }
define i32 @path_is_file(%struct.stack** %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.stack**
%5 = alloca i8*
%6 = alloca %struct.stat
store %struct.stack** %0, %struct.stack*** %4
store i8* %1, i8** %5
%7 = load %struct.stack**, %struct.stack*** %4
%8 = load i8*, i8** %5
%9 = call i64 @path_stat(%struct.stack** %7, i8* %8, %struct.stat* %6)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %16
12: ; preds = %2
%13 = getelementptr inbounds %struct.stat, %struct.stat* %6, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @st_is_file(i32 %14)
store i32 %15, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.stack = type { i32 }
%struct.stat = type { i32 }
define i32 @path_is_file(%struct.stack** %0, i8* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = call i64 @path_stat(%struct.stack** %0, i8* %1, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %2
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%9 = load i32, i32* %8
%10 = call i32 @st_is_file(i32 %9)
br label %11
11: ; preds = %2, %7
%12 = phi i32 [ %10, %7 ], [ 0, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t opposite_position(uint8_t pos) {
  pos += 3;
  if (pos > 6)
    pos -= 6;
  return pos;
}


x86 assembly (clang, -O0):
<opposite_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x6,-0x4(%rbp)
jle    1123 <opposite_position+0x23>
mov    -0x4(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opposite_position>:
lea    0x3(%rdi),%ecx
lea    -0x3(%rdi),%eax
cmp    $0x4,%edi
cmovl  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @opposite_position(i32 %0) {
%2 = icmp sgt i32 %0, 3
%3 = select i1 %2, i32 -3, i32 3
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ dxl_write_word(unsigned char, int, unsigned short);
void setCCWAngleLimit(unsigned char id, unsigned short limit) {
  dxl_write_word(id, (8), limit);
}


x86 assembly (clang, -O0):
<setCCWAngleLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x1(%rbp),%al
mov    $0x8,%esi
movzbl %al,%edi
movzwl -0x4(%rbp),%edx
call   1030 <dxl_write_word@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setCCWAngleLimit>:
mov    %esi,%edx
mov    $0x8,%esi
jmp    1030 <dxl_write_word@plt>

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

LLVM IR (-O2):
define void @setCCWAngleLimit(i8 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @dxl_write_word(i8 zeroext %0, i32 8, i16 zeroext %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
exit_terminate() { exit(0); }


x86 assembly (clang, -O0):
<exit_terminate>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define i32 @exit_terminate() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @exit_terminate() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exch(int *, int *);
scalar_t__ less(int, int);
void compare_exchg(int *A, int *B) {
  if (less(*B, *A)) {
    exch(A, B);
  }
}


x86 assembly (clang, -O0):
<compare_exchg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1040 <less@plt>
cmp    $0x0,%rax
je     1158 <compare_exchg+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <exch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_exchg>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%edi
mov    (%rbx),%esi
call   1040 <less@plt>
test   %rax,%rax
je     114a <compare_exchg+0x2a>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <exch@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @compare_exchg(i32* %0, i32* %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
%5 = tail call i64 @less(i32 %3, i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @exch(i32* %0, i32* %1)
br label %9
9: ; preds = %7, %2
ret void
}