xunge/DecIR huggingface dataset:
/* Variables and functions */
bool wrenIsLocalName(const char *name) {
  return name[0] >= 'a' && name[0] <= 'z';
}


x86 assembly (clang, -O0):
<wrenIsLocalName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x9(%rbp)
jl     112d <wrenIsLocalName+0x2d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrenIsLocalName>:
mov    (%rdi),%cl
add    $0x9f,%cl
xor    %eax,%eax
cmp    $0x1a,%cl
setb   %al
ret

LLVM IR (-O0):
define i32 @wrenIsLocalName(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp sge i32 %6, 97
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @wrenIsLocalName(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int tcpIpSocketStartUp();
int cRosInitializeLibrary(void) {
  int ret;
  ret = tcpIpSocketStartUp();
  return (ret);
}


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

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

LLVM IR (-O0):
define i32 @cRosInitializeLibrary() {
%1 = alloca i32
%2 = call i32 (...) @tcpIpSocketStartUp()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @cRosInitializeLibrary() {
%1 = tail call i32 (...) @tcpIpSocketStartUp()
ret i32 %1
}
/* Variables and functions */
int isOdd(int);
int isEven(int n) {
  if (n == 0) {
    return 1;
  } else if (n == 1) {
    return 0;
  } else {
    return isOdd(n - 1);
  }
}


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <isEven+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1155 <isEven+0x45>
cmpl   $0x1,-0x8(%rbp)
jne    1147 <isEven+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1155 <isEven+0x45>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <isOdd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
test   %edi,%edi
je     111c <isEven+0xc>
cmp    $0x1,%edi
jne    1122 <isEven+0x12>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret
add    $0xffffffff,%edi
jmp    1030 <isOdd@plt>

LLVM IR (-O0):
define i32 @isEven(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 0, i32* %2
br label %15
11: ; preds = %7
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @isOdd(i32 %13)
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
switch i32 %0, label %3 [
i32 0, label %6
i32 1, label %2
]
2: ; preds = %1
br label %6
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @isOdd(i32 %4)
br label %6
6: ; preds = %1, %3, %2
%7 = phi i32 [ 0, %2 ], [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Type definitions */
struct flock {
  scalar_t__ l_len;
  int /*<<< orphan*/ l_whence;
  scalar_t__ l_start;
  int /*<<< orphan*/ l_type;
};

/* Variables and functions */
int /*<<< orphan*/ F_SETLK;
int /*<<< orphan*/ F_WRLCK;
int /*<<< orphan*/ SEEK_SET;
int fcntl(int, int /*<<< orphan*/, struct flock *);
int lockfile(int fd) {
  struct flock fl;
  fl.l_type = F_WRLCK;
  fl.l_start = 0;
  fl.l_whence = SEEK_SET;
  fl.l_len = 0;
  return fcntl(fd, F_SETLK, &fl);
}


x86 assembly (clang, -O0):
<lockfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e9b(%rip),%rax
mov    (%rax),%esi
lea    -0x28(%rbp),%rdx
call   1030 <fcntl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lockfile>:
sub    $0x28,%rsp
mov    0x2eb5(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
movq   $0x0,0x18(%rsp)
mov    0x2ea7(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rdx
call   1030 <fcntl@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.flock = type { i64, i32, i64, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @lockfile(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.flock
store i32 %0, i32* %2
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 3
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* @SEEK_SET
%8 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %3, i32 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETLK
%12 = call i32 @fcntl(i32 %10, i32 %11, %struct.flock* %3)
ret i32 %12
}

LLVM IR (-O2):
%struct.flock = type { i64, i32, i64, i32 }
@F_WRLCK = global i32 0
@SEEK_SET = global i32 0
@F_SETLK = global i32 0
define i32 @lockfile(i32 %0) {
%2 = alloca %struct.flock
%3 = bitcast %struct.flock* %2 to i8*
%4 = load i32, i32* @F_WRLCK
%5 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 3
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 2
store i64 0, i64* %6
%7 = load i32, i32* @SEEK_SET
%8 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.flock, %struct.flock* %2, i64 0, i32 0
store i64 0, i64* %9
%10 = load i32, i32* @F_SETLK
%11 = call i32 @fcntl(i32 %0, i32 %10, %struct.flock* %2)
ret i32 %11
}
void board_universal_ss222ap_init_gpio_i2c(void) {}


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

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

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

LLVM IR (-O2):
define void @board_universal_ss222ap_init_gpio_i2c() {
ret void
}
void ldv_kref_sub(unsigned int count, void (*release)(struct ldv_kref *kref)) {
  release(0);
}


x86 assembly (clang, -O0):
<ldv_kref_sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   *-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ldv_kref_sub>:
xor    %edi,%edi
jmp    *%rsi

LLVM IR (-O0):
%struct.ldv_kref = type opaque
define void @ldv_kref_sub(i32 %0, void (%struct.ldv_kref*)* %1) {
%3 = alloca i32
%4 = alloca void (%struct.ldv_kref*)*
store i32 %0, i32* %3
store void (%struct.ldv_kref*)* %1, void (%struct.ldv_kref*)** %4
%5 = load void (%struct.ldv_kref*)*, void (%struct.ldv_kref*)** %4
ret void
}

LLVM IR (-O2):
%struct.ldv_kref = type opaque
define void @ldv_kref_sub(i32 %0, void (%struct.ldv_kref*)* nocapture %1) {
tail call void %1(%struct.ldv_kref* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_debug_nibble(unsigned char);
void print_debug_hex8(unsigned char value) {
  print_debug_nibble((value >> 4U) & 0x0fU);
  print_debug_nibble(value & 0x0fU);
}


x86 assembly (clang, -O0):
<print_debug_hex8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <print_debug_nibble@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
movzbl %al,%edi
call   1030 <print_debug_nibble@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_debug_hex8>:
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <print_debug_nibble@plt>
and    $0xf,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <print_debug_nibble@plt>

LLVM IR (-O0):
define void @print_debug_hex8(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = ashr i32 %4, 4
%6 = and i32 %5, 15
%7 = trunc i32 %6 to i8
%8 = call i32 @print_debug_nibble(i8 zeroext %7)
%9 = load i8, i8* %2
%10 = zext i8 %9 to i32
%11 = and i32 %10, 15
%12 = trunc i32 %11 to i8
%13 = call i32 @print_debug_nibble(i8 zeroext %12)
ret void
}

LLVM IR (-O2):
define void @print_debug_hex8(i8 zeroext %0) {
%2 = lshr i8 %0, 4
%3 = tail call i32 @print_debug_nibble(i8 zeroext %2)
%4 = and i8 %0, 15
%5 = tail call i32 @print_debug_nibble(i8 zeroext %4)
ret void
}
/* Variables and functions */
void *finally();
int /*<<< orphan*/ init_workers(void *);
int /*<<< orphan*/ rest_workers();
void *think(void *s) {
  init_workers(s);
  rest_workers();
  return finally();
}


x86 assembly (clang, -O0):
<think>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <init_workers@plt>
mov    $0x0,%al
call   1040 <rest_workers@plt>
mov    $0x0,%al
call   1050 <finally@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<think>:
push   %rax
call   1030 <init_workers@plt>
xor    %eax,%eax
call   1040 <rest_workers@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <finally@plt>

LLVM IR (-O0):
define i8* @think(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @init_workers(i8* %3)
%5 = call i32 (...) @rest_workers()
%6 = call i8* (...) @finally()
ret i8* %6
}

LLVM IR (-O2):
define i8* @think(i8* %0) {
%2 = tail call i32 @init_workers(i8* %0)
%3 = tail call i32 (...) @rest_workers()
%4 = tail call i8* (...) @finally()
ret i8* %4
}
/* Variables and functions */
int sum(int, int, int);
int main() { return sum(1, 2, 4); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%edx
call   1030 <sum@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x4,%edx
jmp    1030 <sum@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sum(i32 1, i32 2, i32 4)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ stop();
void sig_do_shutdown(int status) { stop(); }


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

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

LLVM IR (-O0):
define void @sig_do_shutdown(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @stop()
ret void
}

LLVM IR (-O2):
define void @sig_do_shutdown(i32 %0) {
%2 = tail call i32 (...) @stop()
ret void
}
/* Variables and functions */
scalar_t__ FP_INFINITE;
scalar_t__ fpclassify(double);
int isinf(double x) { return fpclassify(x) == FP_INFINITE; }


x86 assembly (clang, -O0):
<isinf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <fpclassify@plt>
mov    0x2eba(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isinf>:
push   %rax
call   1030 <fpclassify@plt>
mov    0x2ecb(%rip),%rdx
xor    %ecx,%ecx
cmp    (%rdx),%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@FP_INFINITE = global i64 0
define i32 @isinf(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i64 @fpclassify(double %3)
%5 = load i64, i64* @FP_INFINITE
%6 = icmp eq i64 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@FP_INFINITE = global i64 0
define i32 @isinf(double %0) {
%2 = tail call i64 @fpclassify(double %0)
%3 = load i64, i64* @FP_INFINITE
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void loop(void) {
  time_t start, end;
  double elapsed;
  start = time(NULL);
  int counter = 0;
  do {
    counter++;
  } while (counter < 500000000);
  end = time(NULL);
  elapsed = difftime(end, start);
  printf("elapsed: %f", elapsed);
}


x86 assembly (clang, -O0):
<loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x1dcd6500,-0x14(%rbp)
jl     114b <loop+0x1b>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <difftime@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop>:
push   %rbx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1040 <difftime@plt>
lea    0xeaf(%rip),%rdi
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"elapsed: %f\00"
define void @loop() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @time(i32* null)
%3 = tail call double @difftime(i32 %2, i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %3)
ret void
}
/* Variables and functions */
size_t stringLen(char const *, int);
scalar_t__ strncmp(char const *, char const *, size_t);
int stringEqual(const char *a, const char *b) {
  size_t lenA = stringLen(a, 256);
  size_t lenB = stringLen(b, 256);
  if (lenA == lenB) {
    return strncmp(a, b, lenB) == 0;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stringEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x100,%esi
call   1040 <stringLen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0x100,%esi
call   1040 <stringLen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1187 <stringEqual+0x67>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    118e <stringEqual+0x6e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringEqual>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x100,%esi
call   1040 <stringLen@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x100,%esi
call   1040 <stringLen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rbx
jne    1168 <stringEqual+0x48>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1030 <strncmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @stringEqual(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i64 @stringLen(i8* %8, i32 256)
store i64 %9, i64* %6
%10 = load i8*, i8** %5
%11 = call i64 @stringLen(i8* %10, i32 256)
store i64 %11, i64* %7
%12 = load i64, i64* %6
%13 = load i64, i64* %7
%14 = icmp eq i64 %12, %13
br i1 %14, label %15, label %22
15: ; preds = %2
%16 = load i8*, i8** %4
%17 = load i8*, i8** %5
%18 = load i64, i64* %7
%19 = call i64 @strncmp(i8* %16, i8* %17, i64 %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
store i32 %21, i32* %3
br label %23
22: ; preds = %2
store i32 0, i32* %3
br label %23
23: ; preds = %22, %15
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @stringEqual(i8* %0, i8* %1) {
%3 = tail call i64 @stringLen(i8* %0, i32 256)
%4 = tail call i64 @stringLen(i8* %1, i32 256)
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = tail call i64 @strncmp(i8* %0, i8* %1, i64 %3)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t read32le(const uint8_t *buf) {
  uint32_t ret = 0;
  for (unsigned i = 0; i < 32 / 8; ++i)
    ret |= (uint32_t)buf[i] << (i * 8);
  return ret;
}


x86 assembly (clang, -O0):
<read32le>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jae    1147 <read32le+0x47>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <read32le+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read32le>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @read32le(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
store i64* %0, i64** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %4
%7 = icmp ult i32 %6, 4
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i64*, i64** %2
%10 = load i32, i32* %4
%11 = zext i32 %10 to i64
%12 = getelementptr inbounds i64, i64* %9, i64 %11
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = load i32, i32* %4
%16 = mul i32 %15, 8
%17 = shl i32 %14, %16
%18 = load i32, i32* %3
%19 = or i32 %18, %17
store i32 %19, i32* %3
br label %20
20: ; preds = %8
%21 = load i32, i32* %4
%22 = add i32 %21, 1
store i32 %22, i32* %4
br label %5
23: ; preds = %5
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @read32le(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %12, %8
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %17, %13
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ delay();
int /*<<< orphan*/ led_init(int);
int /*<<< orphan*/ led_off();
int /*<<< orphan*/ led_on();
void startup(void) {
  led_init(13);
  for (;;) {
    led_on();
    delay();
    led_off();
    delay();
  }
}


x86 assembly (clang, -O0):
<startup>:
push   %rbp
mov    %rsp,%rbp
mov    $0xd,%edi
call   1040 <led_init@plt>
mov    $0x0,%al
call   1060 <led_on@plt>
mov    $0x0,%al
call   1050 <delay@plt>
mov    $0x0,%al
call   1030 <led_off@plt>
mov    $0x0,%al
call   1050 <delay@plt>
jmp    114e <startup+0xe>

x86 assembly (clang, -O2):
<startup>:
push   %rax
mov    $0xd,%edi
call   1040 <led_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <led_on@plt>
xor    %eax,%eax
call   1050 <delay@plt>
xor    %eax,%eax
call   1030 <led_off@plt>
xor    %eax,%eax
call   1050 <delay@plt>
jmp    1150 <startup+0x10>

LLVM IR (-O0):
define void @startup() {
%1 = call i32 @led_init(i32 13)
br label %2
2: ; preds = %2, %0
%3 = call i32 (...) @led_on()
%4 = call i32 (...) @delay()
%5 = call i32 (...) @led_off()
%6 = call i32 (...) @delay()
br label %2
}

LLVM IR (-O2):
define void @startup() {
%1 = tail call i32 @led_init(i32 13)
br label %2
2: ; preds = %2, %0
%3 = tail call i32 (...) @led_on()
%4 = tail call i32 (...) @delay()
%5 = tail call i32 (...) @led_off()
%6 = tail call i32 (...) @delay()
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void DisplayHelp() {
  printf("Please read the NUPACK User Guide for detailed instructions.\n");
}


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

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

LLVM IR (-O0):
@.str = [62 x i8] c"Please read the NUPACK User Guide for detailed instructions.\0A\00"
define void @DisplayHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [61 x i8] c"Please read the NUPACK User Guide for detailed instructions.\00"
define void @DisplayHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
ret void
}
void foo_2_2_2_1_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_1_2_2_2_1_2() {
ret void
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *dup_str(char *s, char *e) {
  int l = e - s;
  char *ss = (char *)malloc(l + 1);
  memcpy(ss, s, l);
  ss[l] = 0;
  return ss;
}


x86 assembly (clang, -O0):
<dup_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dup_str>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
sub    %rdi,%rbx
lea    0x1(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @dup_str(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = load i8*, i8** %3
%9 = ptrtoint i8* %7 to i64
%10 = ptrtoint i8* %8 to i64
%11 = sub i64 %9, %10
%12 = trunc i64 %11 to i32
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = load i8*, i8** %3
%19 = load i32, i32* %5
%20 = call i32 @memcpy(i8* %17, i8* %18, i32 %19)
%21 = load i8*, i8** %6
%22 = load i32, i32* %5
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
store i8 0, i8* %24
%25 = load i8*, i8** %6
ret i8* %25
}

LLVM IR (-O2):
define i8* @dup_str(i8* %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = ptrtoint i8* %0 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
%7 = add nsw i32 %6, 1
%8 = tail call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8*
%10 = tail call i32 @memcpy(i8* %9, i8* %0, i32 %6)
%11 = shl i64 %5, 32
%12 = ashr exact i64 %11, 32
%13 = getelementptr inbounds i8, i8* %9, i64 %12
store i8 0, i8* %13
ret i8* %9
}
unsigned char getLexChar(char **readPointer) {
  unsigned char ch = **readPointer;
  (*readPointer)++;
  return ch;
}


x86 assembly (clang, -O0):
<getLexChar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLexChar>:
mov    (%rdi),%rcx
mov    (%rcx),%al
add    $0x1,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define zeroext i8 @getLexChar(i8** %0) {
%2 = alloca i8**
%3 = alloca i8
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = load i8, i8* %5
store i8 %6, i8* %3
%7 = load i8**, i8*** %2
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %7
%10 = load i8, i8* %3
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @getLexChar(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %4, i8** %0
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ ws_beep();
void display_beep(void) { ws_beep(); }


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

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

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

LLVM IR (-O2):
define void @display_beep() {
%1 = tail call i32 (...) @ws_beep()
ret void
}
void rt2x00ht_create_tx_descriptor(struct queue_entry *entry,
                                   struct txentry_desc *txdesc,
                                   const struct rt2x00_rate *hwrate) {}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
ret

LLVM IR (-O0):
%struct.queue_entry = type opaque
%struct.txentry_desc = type opaque
%struct.rt2x00_rate = type opaque
define void @rt2x00ht_create_tx_descriptor(%struct.queue_entry* %0, %struct.txentry_desc* %1, %struct.rt2x00_rate* %2) {
%4 = alloca %struct.queue_entry*
%5 = alloca %struct.txentry_desc*
%6 = alloca %struct.rt2x00_rate*
store %struct.queue_entry* %0, %struct.queue_entry** %4
store %struct.txentry_desc* %1, %struct.txentry_desc** %5
store %struct.rt2x00_rate* %2, %struct.rt2x00_rate** %6
ret void
}

LLVM IR (-O2):
%struct.queue_entry = type opaque
%struct.txentry_desc = type opaque
%struct.rt2x00_rate = type opaque
define void @rt2x00ht_create_tx_descriptor(%struct.queue_entry* nocapture %0, %struct.txentry_desc* nocapture %1, %struct.rt2x00_rate* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void _flockfile_stub(FILE *fp) {}


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

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

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

LLVM IR (-O2):
define void @_flockfile_stub(i32* nocapture %0) {
ret void
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int fork();
int main(int argc, char *argv[]) {
  pid_t child;
  child = fork();
  switch (child) {
  case -1:
    abort();
  case 0:
  default:
    break;
  }
  return 0;
}


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)
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
sub    $0xffffffff,%eax
je     1164 <main+0x44>
jmp    1154 <main+0x34>
mov    -0x18(%rbp),%eax
test   %eax,%eax
je     116b <main+0x4b>
jmp    1170 <main+0x50>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1170 <main+0x50>
jmp    1175 <main+0x55>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
cmp    $0xffffffff,%eax
je     1131 <main+0x11>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @fork()
store i32 %7, i32* %6
%8 = load i32, i32* %6
switch i32 %8, label %12 [
i32 -1, label %9
i32 0, label %11
]
9: ; preds = %2
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %2
br label %12
12: ; preds = %2, %11
br label %13
13: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
bool name_matches(const char *candidate, const char *pattern) {
  if (!pattern)
    return !candidate;
  return (candidate && (strcmp(candidate, pattern) == 0)) || (!candidate);
}


x86 assembly (clang, -O0):
<name_matches>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1142 <name_matches+0x32>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <name_matches+0x74>
cmpq   $0x0,-0x10(%rbp)
je     116c <name_matches+0x5c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     1179 <name_matches+0x69>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_matches>:
push   %rbx
test   %rdi,%rdi
sete   %bl
test   %rsi,%rsi
je     112d <name_matches+0x1d>
test   %rdi,%rdi
je     112d <name_matches+0x1d>
call   1030 <strcmp@plt>
test   %rax,%rax
jne    112d <name_matches+0x1d>
mov    $0x1,%bl
movzbl %bl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @name_matches(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp ne i8* %6, null
br i1 %7, label %13, label %8
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
store i32 %12, i32* %3
br label %28
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i8*, i8** %4
%18 = load i8*, i8** %5
%19 = call i64 @strcmp(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %25, label %21
21: ; preds = %16, %13
%22 = load i8*, i8** %4
%23 = icmp ne i8* %22, null
%24 = xor i1 %23, true
br label %25
25: ; preds = %21, %16
%26 = phi i1 [ true, %16 ], [ %24, %21 ]
%27 = zext i1 %26 to i32
store i32 %27, i32* %3
br label %28
28: ; preds = %25, %8
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @name_matches(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
%4 = icmp eq i8* %0, null
br i1 %3, label %10, label %5
5: ; preds = %2
br i1 %4, label %9, label %6
6: ; preds = %5
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %5
br label %10
10: ; preds = %2, %6, %9
%11 = phi i1 [ true, %6 ], [ %4, %9 ], [ %4, %2 ]
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
void *malloc(size_t);
void *malloc_or_die(size_t size) {
  void *m = malloc(size);
  if (m == NULL)
    die("Not enough memory.");
  return m;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <malloc_or_die+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <malloc_or_die+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <die@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Not enough memory.\00"
define i8* @malloc_or_die(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [19 x i8] c"Not enough memory.\00"
define noalias i8* @malloc_or_die(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char *print_color(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void print_separator(char *s) {
  sprintf(s, " %s| ^fg()", print_color("555555"));
}


x86 assembly (clang, -O0):
<print_separator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xed0(%rip),%rdi
call   1040 <print_color@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_separator>:
push   %rbx
mov    %rdi,%rbx
lea    0xee0(%rip),%rdi
call   1040 <print_color@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c" %s| ^fg()\00"
@.str.1 = [7 x i8] c"555555\00"
define void @print_separator(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @print_color(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c" %s| ^fg()\00"
@.str.1 = [7 x i8] c"555555\00"
define void @print_separator(i8* nocapture writeonly %0) {
%2 = tail call i8* @print_color(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ add_attribute_raw(int /*<<< orphan*/, int /*<<< orphan*/ *,
                                     int);
void add_attribute_u32(uint16_t attribute, uint32_t value) {
  add_attribute_raw(attribute, &value, sizeof(uint32_t));
}


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

x86 assembly (clang, -O2):
<add_attribute_u32>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <add_attribute_raw@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @add_attribute_u32(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 = call i32 @add_attribute_raw(i32 %5, i32* %4, i32 4)
ret void
}

LLVM IR (-O2):
define void @add_attribute_u32(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @add_attribute_raw(i32 %0, i32* %3, i32 4)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int ctrlresp(char resp[25], char correcta1[15], char correcta2[15]) {
  if ((strcmp(resp, correcta1) == 0) || (strcmp(resp, correcta2) == 0)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<ctrlresp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1152 <ctrlresp+0x42>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    115e <ctrlresp+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <ctrlresp+0x55>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctrlresp>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
je     113c <ctrlresp+0x2c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
jmp    1141 <ctrlresp+0x31>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ctrlresp(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %0, i8* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %0, i8* %2)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ 1, %3 ], [ %9, %6 ]
ret i32 %11
}
void board_final_init(void) {}


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

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

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

LLVM IR (-O2):
define void @board_final_init() {
ret void
}
void _glfwSetVideoModeMODE(int screen, int mode, int rate) {}


x86 assembly (clang, -O0):
<_glfwSetVideoModeMODE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_glfwSetVideoModeMODE(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @_glfwSetVideoModeMODE(i32 %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ udelay(int);
void mi_idle(void) {
  int i;
  for (i = 0; i < 32; i++) {
    (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
        (0x0001 | 0x0008);
    udelay(100);
    (*((volatile unsigned short *)(0x0C000000 + ((0x300 + (0x8)) << 2)))) =
        (0x0001 | 0x0008 | 0x0004);
    udelay(100);
  }
}


x86 assembly (clang, -O0):
<mi_idle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
jge    115f <mi_idle+0x4f>
mov    $0xc000c20,%eax
movw   $0x9,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    $0xc000c20,%eax
movw   $0xd,(%rax)
mov    $0x64,%edi
call   1030 <udelay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <mi_idle+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mi_idle>:
push   %rbx
mov    $0x20,%ebx
cs nopw 0x0(%rax,%rax,1)
movw   $0x9,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
movw   $0xd,0xc000c20
mov    $0x64,%edi
call   1030 <udelay@plt>
add    $0xffffffff,%ebx
jne    1120 <mi_idle+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @mi_idle() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 32
br i1 %4, label %5, label %11
5: ; preds = %2
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%6 = call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%7 = call i32 @udelay(i32 100)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @mi_idle() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
store volatile i16 9, i16* inttoptr (i64 201329696 to i16*)
%3 = tail call i32 @udelay(i32 100)
store volatile i16 13, i16* inttoptr (i64 201329696 to i16*)
%4 = tail call i32 @udelay(i32 100)
%5 = add nuw nsw i32 %2, 1
%6 = icmp eq i32 %5, 32
br i1 %6, label %7, label %1
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long I2SRxFIFOLevelGet(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  return ((*((volatile unsigned long *)(ulBase + 0x00000818))));
}


x86 assembly (clang, -O0):
<I2SRxFIFOLevelGet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    0x818(%rax),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxFIFOLevelGet>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    0x818(%rbx),%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @I2SRxFIFOLevelGet(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 2072
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @I2SRxFIFOLevelGet(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 2072
%6 = inttoptr i64 %5 to i64*
%7 = load volatile i64, i64* %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *toKey(int id) {
  static char temp_key[20];
  sprintf(temp_key, "%6d", id);
  return temp_key;
}


x86 assembly (clang, -O0):
<toKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0x2f1b(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f08(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toKey>:
push   %rbx
mov    %edi,%edx
lea    0x2f26(%rip),%rbx
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@toKey.temp_key = internal global [20 x i8] zeroinitializer
@.str = [4 x i8] c"%6d\00"
define i8* @toKey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @toKey.temp_key, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @toKey.temp_key, i64 0, i64 0)
}

LLVM IR (-O2):
@toKey.temp_key = internal global [20 x i8] zeroinitializer
@.str = [4 x i8] c"%6d\00"
define i8* @toKey(i32 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @toKey.temp_key, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8* getelementptr inbounds ([20 x i8], [20 x i8]* @toKey.temp_key, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ *__m128d;
typedef int /*<<< orphan*/ *__m128;

/* Variables and functions */
__m128d __attribute__((__always___, __nodebug__))
_mm_cvtss_sd(__m128d a, __m128 b) {
  a[0] = b[0];
  return a;
}


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

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

LLVM IR (-O0):
define i32* @_mm_cvtss_sd(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 0
store i32 %7, i32* %9
%10 = load i32*, i32** %3
ret i32* %10
}

LLVM IR (-O2):
define i32* @_mm_cvtss_sd(i32* returned writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
store i32 %3, i32* %0
ret i32* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  printf("Hello, wfrontiers!\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello, wfrontiers!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [19 x i8] c"Hello, wfrontiers!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
ret i32 0
}