xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ irc_join(char *, char *);
char *strtok(char *, char *);
void child_join(char *p) {
  char *chan, *key;
  chan = strtok(p, " ");
  key = strtok(NULL, "");
  irc_join(chan, key);
}


x86 assembly (clang, -O0):
<child_join>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeb6(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <irc_join@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_join>:
push   %rbx
lea    0xed8(%rip),%rsi
call   1040 <strtok@plt>
mov    %rax,%rbx
lea    0xeca(%rip),%rsi
xor    %edi,%edi
call   1040 <strtok@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
pop    %rbx
jmp    1030 <irc_join@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_join(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @strtok(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %3
%7 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @irc_join(i8* %8, i8* %9)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [1 x i8] zeroinitializer
define void @child_join(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @irc_join(i8* %2, i8* %3)
ret void
}
/* Variables and functions */
int EINVAL;
int pm8921_bms_get_soc_by_vbat(int ocv_uv, int batt_temp, int chargecycles) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<pm8921_bms_get_soc_by_vbat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
mov    0x2eca(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8921_bms_get_soc_by_vbat>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @pm8921_bms_get_soc_by_vbat(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
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @pm8921_bms_get_soc_by_vbat(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
void exchange(char *pc1, char *pc2) {
  char c = *pc1;
  *pc1 = *pc2;
  *pc2 = c;
}


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

x86 assembly (clang, -O2):
<exchange>:
mov    (%rdi),%al
mov    (%rsi),%cl
mov    %cl,(%rdi)
mov    %al,(%rsi)
ret

LLVM IR (-O0):
define void @exchange(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @exchange(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ path;

/* Variables and functions */
int O_CLOEXEC;
int O_RDONLY;
int open(char *, int);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int mem_fd_open(int pid) {
  char path[64];
  snprintf(path, sizeof(path), "/proc/%i/mem", pid);
  return open(path, O_RDONLY | O_CLOEXEC);
}


x86 assembly (clang, -O0):
<mem_fd_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x40,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e9a(%rip),%rax
mov    (%rax),%esi
mov    0x2e79(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_fd_open>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    0x2ea3(%rip),%rax
mov    0x2e84(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %rbx,%rdi
call   1040 <open@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"/proc/%i/mem\00"
@O_RDONLY = global i32 0
@O_CLOEXEC = global i32 0
define i32 @mem_fd_open(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* @O_RDONLY
%9 = load i32, i32* @O_CLOEXEC
%10 = or i32 %8, %9
%11 = call i32 @open(i8* %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@.str = [13 x i8] c"/proc/%i/mem\00"
@O_RDONLY = global i32 0
@O_CLOEXEC = global i32 0
define i32 @mem_fd_open(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i32, i32* @O_RDONLY
%6 = load i32, i32* @O_CLOEXEC
%7 = or i32 %6, %5
%8 = call i32 @open(i8* %3, i32 %7)
ret i32 %8
}
int foo() {
  unsigned int M = 2;
  const unsigned int M_CONST = 2;
  static unsigned int M_STATIC = 2;
  static const unsigned int M_STATIC_CONST = 2;
  char n1[M];
  char n2[M_CONST];
  char n3[M_STATIC];
  char n4[M_STATIC_CONST];
  return sizeof(n1) + sizeof(n2) + sizeof(n3) + sizeof(n4);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
mov    %rax,-0x18(%rbp)
mov    0x2ef6(%rip),%ecx
mov    %rcx,-0x20(%rbp)
add    $0x2,%rax
add    %rcx,%rax
add    $0x2,%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x8,%eax
ret

LLVM IR (-O0):
@foo.M_STATIC = internal global i32 2
@foo.M_STATIC_CONST = internal constant i32 2
define i32 @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i32 2, i32* %1
store i32 2, i32* %2
%6 = load i32, i32* %1
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
store i8* %8, i8** %3
%9 = alloca i8, i64 %7
store i64 %7, i64* %4
%10 = alloca i8, i64 2
%11 = load i32, i32* @foo.M_STATIC
%12 = zext i32 %11 to i64
%13 = alloca i8, i64 %12
store i64 %12, i64* %5
%14 = alloca i8, i64 2
%15 = add i64 %7, 2
%16 = add i64 %15, %12
%17 = add i64 %16, 2
%18 = trunc i64 %17 to i32
%19 = load i8*, i8** %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 8
}
void mfence(void) { __asm __volatile("mfence"); }


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

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

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

LLVM IR (-O2):
define void @mfence() {
tail call void asm sideeffect "mfence", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t htonll(uint64_t value) { return htonll(value); }


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

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

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

LLVM IR (-O2):
define i32 @htonll(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
int LVI1() { return 0; }


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

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

LLVM IR (-O0):
define i32 @LVI1() {
ret i32 0
}

LLVM IR (-O2):
define i32 @LVI1() {
ret i32 0
}
struct s_content *invalid_cast(src, tgt_tag, tgt)
struct s_content *src;
struct s_tag *tgt_tag;
struct s_content *tgt;
{
  printf("Error - non numerical type - casting not allowed");
  return 0;
}


x86 assembly (clang, -O0):
<invalid_cast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.s_tag = type opaque
%struct.s_content = type opaque
@.str = [49 x i8] c"Error - non numerical type - casting not allowed\00"
define %struct.s_content* @invalid_cast(%struct.s_content* %0, %struct.s_tag* %1, %struct.s_content* %2) {
%4 = alloca %struct.s_content*
%5 = alloca %struct.s_tag*
%6 = alloca %struct.s_content*
store %struct.s_content* %0, %struct.s_content** %4
store %struct.s_tag* %1, %struct.s_tag** %5
store %struct.s_content* %2, %struct.s_content** %6
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret %struct.s_content* null
}

LLVM IR (-O2):
%struct.s_tag = type opaque
%struct.s_content = type opaque
@.str = [49 x i8] c"Error - non numerical type - casting not allowed\00"
define noalias %struct.s_content* @invalid_cast(%struct.s_content* nocapture readnone %0, %struct.s_tag* nocapture readnone %1, %struct.s_content* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
ret %struct.s_content* null
}
/* Variables and functions */
int /*<<< orphan*/ LCD(int /*<<< orphan*/, int);
int /*<<< orphan*/ clearLCD();
int setupLCD() {
  LCD(0, 0b00111000);
  LCD(0, 0b00101000);
  LCD(0, 0b00000110);
  LCD(0, 0b00001111);
  LCD(0, 0b00000001);
  LCD(0, 0b00001100);
  LCD(0, 0b00000001);
  clearLCD();
  LCD(0, 0b10000000);
}


x86 assembly (clang, -O0):
<setupLCD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
mov    $0x38,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x28,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0xc,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <LCD@plt>
mov    $0x0,%al
call   1030 <clearLCD@plt>
xor    %edi,%edi
mov    $0x80,%esi
call   1040 <LCD@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setupLCD>:
push   %rax
xor    %edi,%edi
mov    $0x38,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x28,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x6,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0xf,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0xc,%esi
call   1040 <LCD@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1040 <LCD@plt>
xor    %eax,%eax
call   1030 <clearLCD@plt>
xor    %edi,%edi
mov    $0x80,%esi
pop    %rax
jmp    1040 <LCD@plt>

LLVM IR (-O0):
define i32 @setupLCD() {
%1 = alloca i32
%2 = call i32 @LCD(i32 0, i32 56)
%3 = call i32 @LCD(i32 0, i32 40)
%4 = call i32 @LCD(i32 0, i32 6)
%5 = call i32 @LCD(i32 0, i32 15)
%6 = call i32 @LCD(i32 0, i32 1)
%7 = call i32 @LCD(i32 0, i32 12)
%8 = call i32 @LCD(i32 0, i32 1)
%9 = call i32 (...) @clearLCD()
%10 = call i32 @LCD(i32 0, i32 128)
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @setupLCD() {
%1 = tail call i32 @LCD(i32 0, i32 56)
%2 = tail call i32 @LCD(i32 0, i32 40)
%3 = tail call i32 @LCD(i32 0, i32 6)
%4 = tail call i32 @LCD(i32 0, i32 15)
%5 = tail call i32 @LCD(i32 0, i32 1)
%6 = tail call i32 @LCD(i32 0, i32 12)
%7 = tail call i32 @LCD(i32 0, i32 1)
%8 = tail call i32 (...) @clearLCD()
%9 = tail call i32 @LCD(i32 0, i32 128)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ display(int *, int);
int /*<<< orphan*/ selection_sort(int *, int);
int main() {
  int n = 10;
  int a1[] = {2, 3, 6, 4, 76, 11, 9, 4, 33, 87};
  selection_sort(a1, n);
  display(a1, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1030 <selection_sort@plt>
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1040 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
mov    0xef4(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <selection_sort@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1040 <display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a1 = [10 x i32] [i32 2, i32 3, i32 6, i32 4, i32 76, i32 11, i32 9, i32 4, i32 33, i32 87]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i32]
store i32 0, i32* %1
store i32 10, i32* %2
%4 = bitcast [10 x i32]* %3 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%6 = load i32, i32* %2
%7 = call i32 @selection_sort(i32* %5, i32 %6)
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%9 = load i32, i32* %2
%10 = call i32 @display(i32* %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [10 x i32] [i32 2, i32 3, i32 6, i32 4, i32 76, i32 11, i32 9, i32 4, i32 33, i32 87]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @selection_sort(i32* %3, i32 10)
%5 = call i32 @display(i32* %3, i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ RTC_Seconds_DriverIRQHandler();
__attribute__((weak)) void RTC_Seconds_IRQHandler(void) {
  RTC_Seconds_DriverIRQHandler();
}


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

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

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

LLVM IR (-O2):
define weak void @RTC_Seconds_IRQHandler() {
%1 = tail call i32 (...) @RTC_Seconds_DriverIRQHandler()
ret void
}
unsigned long b_disk_read(void *mem, unsigned long start, unsigned long num,
                          unsigned long disknum) {
  unsigned long tlong;
  asm volatile("call *0x00100060"
               : "=c"(tlong)
               : "a"(start), "c"(num), "d"(disknum), "D"(mem));
  return tlong;
}


x86 assembly (clang, -O0):
<b_disk_read>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rdi
call   *0x100060
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_disk_read>:
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %r8,%rdx
call   *0x100060
mov    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @b_disk_read(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%10 = load i64, i64* %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = load i8*, i8** %5
%14 = call i64 asm sideeffect "call *0x00100060", "={cx},{ax},{cx},{dx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %10, i64 %11, i64 %12, i8* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @b_disk_read(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i64 asm sideeffect "call *0x00100060", "={cx},{ax},{cx},{dx},{di},~{dirflag},~{fpsr},~{flags}"(i64 %1, i64 %2, i64 %3, i8* %0)
ret i64 %5
}
/* Variables and functions */
bool nrf53_errata_32(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_32() {
ret i32 0
}

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

/* Variables and functions */
int /*<<< orphan*/ ReadWord(char *, int /*<<< orphan*/ *, char *);
int SearchVocab(char *);
int ReadWordIndex(FILE *fin, char *eof) {
  char word[60], eof_l = 0;
  ReadWord(word, fin, &eof_l);
  if (eof_l) {
    *eof = 1;
    return -1;
  }
  return SearchVocab(word);
}


x86 assembly (clang, -O0):
<ReadWordIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movb   $0x0,-0x61(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x61(%rbp),%rdx
call   1030 <ReadWord@plt>
cmpb   $0x0,-0x61(%rbp)
je     1162 <ReadWordIndex+0x42>
mov    -0x18(%rbp),%rax
movb   $0x1,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    116e <ReadWordIndex+0x4e>
lea    -0x60(%rbp),%rdi
call   1040 <SearchVocab@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadWordIndex>:
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
movb   $0x0,0xf(%rsp)
lea    0x10(%rsp),%rdi
lea    0xf(%rsp),%rdx
call   1030 <ReadWord@plt>
cmpb   $0x0,0xf(%rsp)
je     1150 <ReadWordIndex+0x30>
movb   $0x1,(%rbx)
mov    $0xffffffff,%eax
jmp    115a <ReadWordIndex+0x3a>
lea    0x10(%rsp),%rdi
call   1040 <SearchVocab@plt>
add    $0x50,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ReadWordIndex(i32* %0, i8* nocapture writeonly %1) {
%3 = alloca [60 x i8]
%4 = alloca i8
%5 = getelementptr inbounds [60 x i8], [60 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%6 = call i32 @ReadWord(i8* %5, i32* %0, i8* %4)
%7 = load i8, i8* %4
%8 = icmp eq i8 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %2
store i8 1, i8* %1
br label %12
10: ; preds = %2
%11 = call i32 @SearchVocab(i8* %5)
br label %12
12: ; preds = %10, %9
%13 = phi i32 [ -1, %9 ], [ %11, %10 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ dlopen(int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  dlopen(NULL, 0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @dlopen(i32* null, i32 0)
ret i32 0
}
void unsigned_char_mul_signed_char_unsigned_char(unsigned char *LHS,
                                                 unsigned char RHS) {
  (*LHS) *= RHS;
}


x86 assembly (clang, -O0):
<unsigned_char_mul_signed_char_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
imul   %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<unsigned_char_mul_signed_char_unsigned_char>:
mov    (%rdi),%al
mul    %sil
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @unsigned_char_mul_signed_char_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = mul nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @unsigned_char_mul_signed_char_unsigned_char(i8* nocapture %0, i8 zeroext %1) {
%3 = load i8, i8* %0
%4 = mul i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
void frepc(int ch, int count, FILE *fp) {
  while (count--)
    fputc(ch, fp);
}


x86 assembly (clang, -O0):
<frepc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1147 <frepc+0x37>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
jmp    1122 <frepc+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<frepc>:
push   %rbp
push   %r14
push   %rbx
test   %esi,%esi
je     112f <frepc+0x1f>
mov    %rdx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
nop
mov    %ebx,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1120 <frepc+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @frepc(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
br label %7
7: ; preds = %11, %3
%8 = load i32, i32* %5
%9 = add nsw i32 %8, -1
store i32 %9, i32* %5
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i32, i32* %4
%13 = load i32*, i32** %6
%14 = call i32 @fputc(i32 %12, i32* %13)
br label %7
15: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @frepc(i32 %0, i32 %1, i32* nocapture %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %7, %5 ], [ %1, %3 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @fputc(i32 %0, i32* %2)
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ reset_stree();
void Reset_SWC_Tree() { reset_stree(); }


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

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

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

LLVM IR (-O2):
define void @Reset_SWC_Tree() {
%1 = tail call i32 (...) @reset_stree()
ret void
}
int bitcount6(int n) { return !n ? 0 : 1 + bitcount6(n & (n - 1)); }


x86 assembly (clang, -O0):
<bitcount6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <bitcount6+0x1f>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <bitcount6+0x35>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
and    %eax,%edi
call   1030 <bitcount6@plt>
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitcount6>:
xor    %eax,%eax
test   %edi,%edi
je     111c <bitcount6+0x1c>
cs nopw 0x0(%rax,%rax,1)
lea    -0x1(%rdi),%ecx
add    $0x1,%eax
and    %edi,%ecx
mov    %ecx,%edi
jne    1110 <bitcount6+0x10>
ret

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

LLVM IR (-O2):
define i32 @bitcount6(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %10, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -1
%7 = and i32 %6, %4
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3, %1
%11 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ dbg(char *, char *, char const *, int);
void __assertUART(const char *file, int line) {
  dbg("printf", "ASSERT FAILED: file= %s, lineNbr= %i\n", file, line);
  for (;;)
    ;
}


x86 assembly (clang, -O0):
<__assertUART>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xed3(%rip),%rdi
lea    0xed3(%rip),%rsi
call   1030 <dbg@plt>
jmp    1139 <__assertUART+0x29>

x86 assembly (clang, -O2):
<__assertUART>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <dbg@plt>
nopl   0x0(%rax)
jmp    1130 <__assertUART+0x20>

LLVM IR (-O0):
@.str = [7 x i8] c"printf\00"
@.str.1 = [38 x i8] c"ASSERT FAILED: file= %s, lineNbr= %i\0A\00"
define void @__assertUART(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @dbg(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %6)
br label %8
8: ; preds = %8, %2
br label %8
}

LLVM IR (-O2):
@.str = [7 x i8] c"printf\00"
@.str.1 = [38 x i8] c"ASSERT FAILED: file= %s, lineNbr= %i\0A\00"
define void @__assertUART(i8* %0, i32 %1) {
%3 = tail call i32 @dbg(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
br label %4
4: ; preds = %4, %2
br label %4
}
int len(char *str) {
  int i = 0;
  while (str[i] != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <len+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <len+0x10>
ret

LLVM IR (-O0):
define i32 @len(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @len(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t ADC_Three_In(void) {
  (*((volatile uint32_t *)0x400380A0)) =
      ((*((volatile uint32_t *)0x400380A0)) & 0xFFFFFFF0) + 1;
  uint32_t data;
  (*((volatile uint32_t *)0x40038028)) = 0x0008;
  while (((*((volatile uint32_t *)0x40038004)) & 0x08) == 0) {
  };
  data = (*((volatile uint32_t *)0x400380A8)) & 0xFFF;
  (*((volatile uint32_t *)0x4003800C)) = 0x0008;
  return data;
}


x86 assembly (clang, -O0):
<ADC_Three_In>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400380a0,%eax
mov    (%rax),%ecx
and    $0xfffffff0,%ecx
add    $0x1,%ecx
mov    $0x400380a0,%eax
mov    %ecx,(%rax)
mov    $0x40038028,%eax
movl   $0x8,(%rax)
mov    $0x40038004,%eax
mov    (%rax),%eax
and    $0x8,%eax
cmp    $0x0,%eax
jne    113b <ADC_Three_In+0x3b>
jmp    1123 <ADC_Three_In+0x23>
mov    $0x400380a8,%eax
mov    (%rax),%eax
and    $0xfff,%eax
mov    %eax,-0x4(%rbp)
mov    $0x4003800c,%eax
movl   $0x8,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADC_Three_In>:
mov    0x400380a0,%eax
and    $0xfffffff0,%eax
or     $0x1,%eax
mov    %eax,0x400380a0
movl   $0x8,0x40038028
nop
testl  $0x8,0x40038004
je     1120 <ADC_Three_In+0x20>
mov    $0xfff,%eax
and    0x400380a8,%eax
movl   $0x8,0x4003800c
ret

LLVM IR (-O0):
define i32 @ADC_Three_In() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%3 = and i32 %2, -16
%4 = add i32 %3, 1
store volatile i32 %4, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %5
5: ; preds = %9, %0
%6 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%7 = and i32 %6, 8
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%12 = and i32 %11, 4095
store i32 %12, i32* %1
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @ADC_Three_In() {
%1 = load volatile i32, i32* inttoptr (i64 1073971360 to i32*)
%2 = and i32 %1, -16
%3 = or i32 %2, 1
store volatile i32 %3, i32* inttoptr (i64 1073971360 to i32*)
store volatile i32 8, i32* inttoptr (i64 1073971240 to i32*)
br label %4
4: ; preds = %4, %0
%5 = load volatile i32, i32* inttoptr (i64 1073971204 to i32*)
%6 = and i32 %5, 8
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = load volatile i32, i32* inttoptr (i64 1073971368 to i32*)
%10 = and i32 %9, 4095
store volatile i32 8, i32* inttoptr (i64 1073971212 to i32*)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int is_char_signed(int arg) {
  if (arg == 189) {
    return 0;
  } else if (arg != -67) {
    printf("Hmm, it seems 'char' is not eight bits wide on your machine.\n");
    printf("I fear the JPEG software will not work at all.\n\n");
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_char_signed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0xbd,-0x8(%rbp)
jne    1134 <is_char_signed+0x24>
movl   $0x0,-0x4(%rbp)
jmp    1162 <is_char_signed+0x52>
cmpl   $0xffffffbd,-0x8(%rbp)
je     1156 <is_char_signed+0x46>
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
call   1030 <printf@plt>
jmp    115b <is_char_signed+0x4b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_char_signed>:
cmp    $0xffffffbd,%edi
je     113d <is_char_signed+0x2d>
xor    %eax,%eax
cmp    $0xbd,%edi
jne    1120 <is_char_signed+0x10>
ret
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
add    $0x8,%rsp
mov    $0x1,%eax
ret

LLVM IR (-O0):
@.str = [62 x i8] c"Hmm, it seems 'char' is not eight bits wide on your machine.\0A\00"
@.str.1 = [49 x i8] c"I fear the JPEG software will not work at all.\0A\0A\00"
define i32 @is_char_signed(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 189
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %15
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ne i32 %8, -67
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %10, %7
br label %14
14: ; preds = %13
store i32 1, i32* %2
br label %15
15: ; preds = %14, %6
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
@str = [61 x i8] c"Hmm, it seems 'char' is not eight bits wide on your machine.\00"
@str.2 = [48 x i8] c"I fear the JPEG software will not work at all.\0A\00"
define i32 @is_char_signed(i32 %0) {
switch i32 %0, label %2 [
i32 189, label %6
i32 -67, label %5
]
2: ; preds = %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.2, i64 0, i64 0))
br label %5
5: ; preds = %1, %2
br label %6
6: ; preds = %1, %5
%7 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ go_off();
int /*<<< orphan*/ run();
int /*<<< orphan*/ runTransition(int /*<<< orphan*/);
int main() {
  runTransition(0);
  run();
  go_off();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1040 <runTransition@plt>
xor    %eax,%eax
call   1030 <run@plt>
xor    %eax,%eax
call   1050 <go_off@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @runTransition(i32 0)
%2 = tail call i32 (...) @run()
%3 = tail call i32 (...) @go_off()
ret i32 0
}
void av_cast5_init() {}


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

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

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

LLVM IR (-O2):
define void @av_cast5_init() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int set_quaddobl_state_to_verbose(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(690, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<set_quaddobl_state_to_verbose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2b2,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_quaddobl_state_to_verbose>:
mov    $0x2b2,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @set_quaddobl_state_to_verbose() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 690, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @set_quaddobl_state_to_verbose() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 690, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
int sys_read(int file, char *ptr, int len) { return 0; }


x86 assembly (clang, -O0):
<sys_read>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @sys_read(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ emit_token(char *);
int /*<<< orphan*/ mark_backward_target(int);
void emit_begin(void) {
  emit_token("b(<mark)");
  mark_backward_target(0xC57be916);
}


x86 assembly (clang, -O0):
<emit_begin>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <emit_token@plt>
mov    $0xc57be916,%edi
call   1030 <mark_backward_target@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_begin>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <emit_token@plt>
mov    $0xc57be916,%edi
pop    %rax
jmp    1030 <mark_backward_target@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"b(<mark)\00"
define void @emit_begin() {
%1 = call i32 @emit_token(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @mark_backward_target(i32 -981735146)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"b(<mark)\00"
define void @emit_begin() {
%1 = tail call i32 @emit_token(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @mark_backward_target(i32 -981735146)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void pr_array(int array[], int len) {
  int k;
  for (k = 0; k < len; k++)
    printf("%d, ", array[k]);
  printf("\n");
}


x86 assembly (clang, -O0):
<pr_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <pr_array+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <pr_array+0x16>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pr_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <pr_array+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <pr_array+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d, \00"
define void @pr_array(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int close(int);
int sock_close(int *fd) {
  int n = close((*fd));
  if (!n)
    (*fd) = 0;
  return n;
}


x86 assembly (clang, -O0):
<sock_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    113e <sock_close+0x2e>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sock_close>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <close@plt>
test   %eax,%eax
je     1121 <sock_close+0x11>
pop    %rbx
ret
movl   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sock_close(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @close(i32 %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 0, i32* %0
br label %6
6: ; preds = %5, %1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void put_be32(unsigned char *p, uint32_t q) {
  p[0] = (q >> 24) & 0xFF;
  p[1] = (q >> 16) & 0xFF;
  p[2] = (q >> 8) & 0xFF;
  p[3] = q & 0xFF;
  return;
}


x86 assembly (clang, -O0):
<put_be32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @put_be32(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
void genblezl() {}


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

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

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

LLVM IR (-O2):
define void @genblezl() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
int /*<<< orphan*/ debug(int, char *);
int plugin_checkFDISSET(fd_set *set) {
  debug(3, "Plugin Checking read sockets");
  return 0;
}


x86 assembly (clang, -O0):
<plugin_checkFDISSET>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x3,%edi
lea    0xed8(%rip),%rsi
call   1030 <debug@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plugin_checkFDISSET>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edi
call   1030 <debug@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Plugin Checking read sockets\00"
define i32 @plugin_checkFDISSET(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @debug(i32 3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Plugin Checking read sockets\00"
define i32 @plugin_checkFDISSET(i32* nocapture readnone %0) {
%2 = tail call i32 @debug(i32 3, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void layer_move(int16_t layer) {}


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

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

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

LLVM IR (-O2):
define void @layer_move(i32 %0) {
ret void
}
/* Type definitions */
typedef long long int64_t;

/* Variables and functions */
long long hi_usec_now();
int64_t hi_msec_now(void) { return hi_usec_now() / 1000LL; }


x86 assembly (clang, -O0):
<hi_msec_now>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <hi_usec_now@plt>
mov    $0x3e8,%ecx
cqto
idiv   %rcx
pop    %rbp
ret

x86 assembly (clang, -O2):
<hi_msec_now>:
push   %rax
xor    %eax,%eax
call   1030 <hi_usec_now@plt>
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x7,%rdx
add    %rdx,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @hi_msec_now() {
%1 = call i64 (...) @hi_usec_now()
%2 = sdiv i64 %1, 1000
ret i64 %2
}

LLVM IR (-O2):
define i64 @hi_msec_now() {
%1 = tail call i64 (...) @hi_usec_now()
%2 = sdiv i64 %1, 1000
ret i64 %2
}
/* Variables and functions */
int gmx_eneconv(int, char **);
int main(int argc, char *argv[]) { return gmx_eneconv(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <gmx_eneconv@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @gmx_eneconv(i32 %0, i8** %1)
ret i32 %3
}
void Terminate(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<Terminate>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <Terminate+0x9>
jmp    1109 <Terminate+0x9>

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

LLVM IR (-O0):
define void @Terminate() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @Terminate() {
br label %1
1: ; preds = %0, %1
br label %1
}