xunge/DecIR huggingface dataset:
/* Type definitions */
struct h_node {
  int dummy;
};

/* Variables and functions */
struct h_node **calloc(int, int);
struct h_node **h_create(void) {
  return calloc(256, sizeof(struct h_node *));
}


x86 assembly (clang, -O0):
<h_create>:
push   %rbp
mov    %rsp,%rbp
mov    $0x100,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<h_create>:
mov    $0x100,%edi
mov    $0x8,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
%struct.h_node = type { i32 }
define %struct.h_node** @h_create() {
%1 = call %struct.h_node** @calloc(i32 256, i32 8)
ret %struct.h_node** %1
}

LLVM IR (-O2):
%struct.h_node = type { i32 }
define noalias %struct.h_node** @h_create() {
%1 = tail call %struct.h_node** @calloc(i32 256, i32 8)
ret %struct.h_node** %1
}
int ismicrotone(p, dir)
char **p;
int dir;
{
  int a, b;
  readlen_nocheck(&a, &b, p);
  if (b != 1) {
    event_microtone(dir, a, b);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ismicrotone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <readlen_nocheck@plt>
cmpl   $0x1,-0x1c(%rbp)
je     1168 <ismicrotone+0x48>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    $0x0,%al
call   1030 <event_microtone@plt>
movl   $0x1,-0x4(%rbp)
jmp    116f <ismicrotone+0x4f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismicrotone>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%rdx
xor    %ebp,%ebp
lea    0x4(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <readlen_nocheck@plt>
mov    (%rsp),%edx
cmp    $0x1,%edx
je     1153 <ismicrotone+0x33>
mov    0x4(%rsp),%esi
mov    %ebx,%edi
xor    %eax,%eax
call   1030 <event_microtone@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @ismicrotone(i8** %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = call i32 (i32*, i32*, i8**, ...) bitcast (i32 (...)* @readlen_nocheck to i32 (i32*, i32*, i8**, ...)*)(i32* %3, i32* %4, i8** %0)
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 1
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* %3
%12 = call i32 (i32, i32, i32, ...) bitcast (i32 (...)* @event_microtone to i32 (i32, i32, i32, ...)*)(i32 %1, i32 %11, i32 %8)
br label %13
13: ; preds = %2, %10
%14 = phi i32 [ 1, %10 ], [ 0, %2 ]
ret i32 %14
}
/* Variables and functions */
int _tfstruncate(int, long);
int /*<<< orphan*/ monLock();
int /*<<< orphan*/ monUnlock();
int mon_tfstruncate(int tfd, long len) {
  int ret;
  monLock();
  ret = _tfstruncate(tfd, len);
  monUnlock();
  return (ret);
}


x86 assembly (clang, -O0):
<mon_tfstruncate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <monLock@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <_tfstruncate@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1050 <monUnlock@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mon_tfstruncate>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <monLock@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <_tfstruncate@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <monUnlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @mon_tfstruncate(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i32
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = call i32 (...) @monLock()
%7 = load i32, i32* %3
%8 = load i64, i64* %4
%9 = call i32 @_tfstruncate(i32 %7, i64 %8)
store i32 %9, i32* %5
%10 = call i32 (...) @monUnlock()
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @mon_tfstruncate(i32 %0, i64 %1) {
%3 = tail call i32 (...) @monLock()
%4 = tail call i32 @_tfstruncate(i32 %0, i64 %1)
%5 = tail call i32 (...) @monUnlock()
ret i32 %4
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
void a52e_set_frmsiz(uint8_t *p_a52, uint16_t i_frmsiz) {
  p_a52[2] &= ~0x7;
  p_a52[2] |= (i_frmsiz >> 8) & 0x7;
  p_a52[3] = i_frmsiz & 0xff;
}


x86 assembly (clang, -O0):
<a52e_set_frmsiz>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
and    $0xfffffff8,%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0x7,%ecx
mov    -0x8(%rbp),%rax
or     0x8(%rax),%ecx
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<a52e_set_frmsiz>:
mov    0x8(%rdi),%eax
and    $0xfffffff8,%eax
movzbl %sil,%ecx
shr    $0x8,%esi
and    $0x7,%esi
or     %eax,%esi
mov    %esi,0x8(%rdi)
mov    %ecx,0xc(%rdi)
ret

LLVM IR (-O0):
define void @a52e_set_frmsiz(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 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load i32, i32* %6
%8 = and i32 %7, -8
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = ashr i32 %9, 8
%11 = and i32 %10, 7
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
%16 = load i32, i32* %4
%17 = and i32 %16, 255
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 3
store i32 %17, i32* %19
ret void
}

LLVM IR (-O2):
define void @a52e_set_frmsiz(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 2
%4 = load i32, i32* %3
%5 = and i32 %4, -8
%6 = lshr i32 %1, 8
%7 = and i32 %6, 7
%8 = or i32 %5, %7
store i32 %8, i32* %3
%9 = and i32 %1, 255
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %9, i32* %10
ret void
}
/* Variables and functions */
scalar_t__ isspace(unsigned char);
char *cfg_ltrim(const char *s) {
  while (*s && isspace((unsigned char)(*s)))
    s++;
  return (char *)s;
}


x86 assembly (clang, -O0):
<cfg_ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <cfg_ltrim+0x37>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <cfg_ltrim+0x47>
jmp    1168 <cfg_ltrim+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <cfg_ltrim+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfg_ltrim>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <cfg_ltrim+0x29>
nopw   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <cfg_ltrim+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <cfg_ltrim+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @cfg_ltrim(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 zeroext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
__attribute__((visibility("default"))) void *sd_bus_creds_ref(void *c) {
  return NULL;
}


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

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

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

LLVM IR (-O2):
define noalias i8* @sd_bus_creds_ref(i8* nocapture readnone %0) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_MalformedSyntax(long p_position) {
  _Error(p_position, "Syntax error");
}


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

x86 assembly (clang, -O2):
<Error_MalformedSyntax>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Syntax error\00"
define void @Error_MalformedSyntax(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Syntax error\00"
define void @Error_MalformedSyntax(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
const char *Assign_Description(void) {
  return "`Assign` is potentially the most important class in Cello. It is "
         "used "
         "throughout Cello to initialise objects using other objects. In C++ "
         "this is "
         "called the _copy constructor_ and it is used to assign the value of "
         "one "
         "object to another."
         "\n\n"
         "By default the `Assign` class uses the `Size` class to copy the "
         "memory "
         "from one object to another. But for more complex objects which "
         "maintain "
         "their own behaviours and state this may need to be overridden."
         "\n\n"
         "The most important thing about the `Assign` class is that it must "
         "work on "
         "the assumption that the target object may not have had it's "
         "constructor "
         "called and could be uninitialised with just zero'd memory. This is "
         "often "
         "the case when copying contents into containers.";
}


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

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

LLVM IR (-O0):
@.str = [711 x i8] c"`Assign` is potentially the most important class in Cello. It is used throughout Cello to initialise objects using other objects. In C++ this is called the _copy constructor_ and it is used to assign the value of one object to another.\0A\0ABy default the `Assign` class uses the `Size` class to copy the memory from one object to another. But for more complex objects which maintain their own behaviours and state this may need to be overridden.\0A\0AThe most important thing about the `Assign` class is that it must work on the assumption that the target object may not have had it's constructor called and could be uninitialised with just zero'd memory. This is often the case when copying contents into containers.\00"
define i8* @Assign_Description() {
ret i8* getelementptr inbounds ([711 x i8], [711 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [711 x i8] c"`Assign` is potentially the most important class in Cello. It is used throughout Cello to initialise objects using other objects. In C++ this is called the _copy constructor_ and it is used to assign the value of one object to another.\0A\0ABy default the `Assign` class uses the `Size` class to copy the memory from one object to another. But for more complex objects which maintain their own behaviours and state this may need to be overridden.\0A\0AThe most important thing about the `Assign` class is that it must work on the assumption that the target object may not have had it's constructor called and could be uninitialised with just zero'd memory. This is often the case when copying contents into containers.\00"
define i8* @Assign_Description() {
ret i8* getelementptr inbounds ([711 x i8], [711 x i8]* @.str, i64 0, i64 0)
}
int ptrcmp(const void *v0, const void *v1) { return (int)(v0 - v1); }


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

x86 assembly (clang, -O2):
<ptrcmp>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @ptrcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %5 to i64
%8 = ptrtoint i8* %6 to i64
%9 = sub i64 %7, %8
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ptrcmp(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub i64 %3, %4
%6 = trunc i64 %5 to i32
ret i32 %6
}
double dsub(double a, double b) { return a - b; }


x86 assembly (clang, -O0):
<dsub>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsub>:
subsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dsub(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fsub double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @dsub(double %0, double %1) {
%3 = fsub double %0, %1
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void func() { printf("This is the function\n"); }


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"This is the function\0A\00"
define void @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"This is the function\00"
define void @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void maxvid_test_assert_util_c4(int cond) {
  if (cond == 0) {
    *((volatile uint32_t *)NULL) = 0;
  }
  return;
}


x86 assembly (clang, -O0):
<maxvid_test_assert_util_c4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111a <maxvid_test_assert_util_c4+0x1a>
xor    %eax,%eax
movq   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxvid_test_assert_util_c4>:
test   %edi,%edi
je     1105 <maxvid_test_assert_util_c4+0x5>
ret
movq   $0x0,0x0
ret

LLVM IR (-O0):
define void @maxvid_test_assert_util_c4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
store volatile i64 0, i64* null
br label %6
6: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @maxvid_test_assert_util_c4(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1
store volatile i64 0, i64* null
br label %4
4: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned int get_number(int /*<<< orphan*/ *);
unsigned int get_number255(FILE *fp, unsigned int maxval) {
  unsigned int val = get_number(fp);
  return (255 * val + (maxval / 2)) / maxval;
}


x86 assembly (clang, -O0):
<get_number255>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_number@plt>
mov    %eax,-0x10(%rbp)
imul   $0xff,-0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shr    $0x1,%ecx
add    %ecx,%eax
xor    %edx,%edx
divl   -0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_number255>:
push   %rbx
mov    %esi,%ebx
call   1030 <get_number@plt>
mov    %eax,%ecx
shl    $0x8,%ecx
sub    %eax,%ecx
mov    %ebx,%eax
shr    %eax
add    %ecx,%eax
xor    %edx,%edx
div    %ebx
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_number255(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32*, i32** %3
%7 = call i32 @get_number(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = mul i32 255, %8
%10 = load i32, i32* %4
%11 = udiv i32 %10, 2
%12 = add i32 %9, %11
%13 = load i32, i32* %4
%14 = udiv i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_number255(i32* %0, i32 %1) {
%3 = tail call i32 @get_number(i32* %0)
%4 = mul i32 %3, 255
%5 = lshr i32 %1, 1
%6 = add i32 %4, %5
%7 = udiv i32 %6, %1
ret i32 %7
}
int getDistance(int sensor) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getDistance(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ tm_store_nul_lm_ptr_(int *, double *);
void tm_nullify_lm_(int *lm) {
  double *nul_ptr;
  nul_ptr = (double *)NULL;
  tm_store_nul_lm_ptr_(lm, nul_ptr);
  return;
}


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

x86 assembly (clang, -O2):
<tm_nullify_lm_>:
xor    %esi,%esi
jmp    1030 <tm_store_nul_lm_ptr_@plt>

LLVM IR (-O0):
define void @tm_nullify_lm_(i32* %0) {
%2 = alloca i32*
%3 = alloca double*
store i32* %0, i32** %2
store double* null, double** %3
%4 = load i32*, i32** %2
%5 = load double*, double** %3
%6 = call i32 @tm_store_nul_lm_ptr_(i32* %4, double* %5)
ret void
}

LLVM IR (-O2):
define void @tm_nullify_lm_(i32* %0) {
%2 = tail call i32 @tm_store_nul_lm_ptr_(i32* %0, double* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_accu();
int /*<<< orphan*/ e_rol();
int /*<<< orphan*/ e_writeback();
void e_rol_accu() {
  e_accu();
  e_rol();
  e_writeback();
}


x86 assembly (clang, -O0):
<e_rol_accu>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <e_accu@plt>
mov    $0x0,%al
call   1050 <e_rol@plt>
mov    $0x0,%al
call   1040 <e_writeback@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<e_rol_accu>:
push   %rax
xor    %eax,%eax
call   1030 <e_accu@plt>
xor    %eax,%eax
call   1050 <e_rol@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_writeback@plt>

LLVM IR (-O0):
define void @e_rol_accu() {
%1 = call i32 (...) @e_accu()
%2 = call i32 (...) @e_rol()
%3 = call i32 (...) @e_writeback()
ret void
}

LLVM IR (-O2):
define void @e_rol_accu() {
%1 = tail call i32 (...) @e_accu()
%2 = tail call i32 (...) @e_rol()
%3 = tail call i32 (...) @e_writeback()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pfan_draw_text(char *, int, int, unsigned short *);
void Test_textLimit(unsigned short display[156]) {
  pfan_draw_text("ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26, 1, display);
}


x86 assembly (clang, -O0):
<Test_textLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rcx
lea    0xed9(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
call   1030 <pfan_draw_text@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define void @Test_textLimit(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = call i32 @pfan_draw_text(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26, i32 1, i16* %3)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"ABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define void @Test_textLimit(i16* %0) {
%2 = tail call i32 @pfan_draw_text(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 26, i32 1, i16* %0)
ret void
}
int emac1_etherstatsoversizepkts_set(
    unsigned int dev_id, union emac1_etherstatsoversizepkts_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_etherstatsoversizepkts_set>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%union.emac1_etherstatsoversizepkts_u = type opaque
define i32 @emac1_etherstatsoversizepkts_set(i32 %0, %union.emac1_etherstatsoversizepkts_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_etherstatsoversizepkts_u*
store i32 %0, i32* %3
store %union.emac1_etherstatsoversizepkts_u* %1, %union.emac1_etherstatsoversizepkts_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_etherstatsoversizepkts_u = type opaque
define i32 @emac1_etherstatsoversizepkts_set(i32 %0, %union.emac1_etherstatsoversizepkts_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ converttofixed(int);
int fdivide(int, int /*<<< orphan*/);
int fdividem(int x, int n) { return fdivide(x, converttofixed(n)); }


x86 assembly (clang, -O0):
<fdividem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <converttofixed@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <fdivide@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdividem>:
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <converttofixed@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <fdivide@plt>

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

LLVM IR (-O2):
define i32 @fdividem(i32 %0, i32 %1) {
%3 = tail call i32 @converttofixed(i32 %1)
%4 = tail call i32 @fdivide(i32 %0, i32 %3)
ret i32 %4
}
/* Variables and functions */
size_t HadTu_hdrSize();
size_t HadTu_size(void const *);
size_t HadTu_dataSize(const void *my) {
  return HadTu_size(my) - HadTu_hdrSize();
}


x86 assembly (clang, -O0):
<HadTu_dataSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <HadTu_size@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <HadTu_hdrSize@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HadTu_dataSize>:
push   %rbx
call   1030 <HadTu_size@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <HadTu_hdrSize@plt>
sub    %rax,%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @HadTu_dataSize(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @HadTu_size(i8* %3)
%5 = call i64 (...) @HadTu_hdrSize()
%6 = sub i64 %4, %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @HadTu_dataSize(i8* %0) {
%2 = tail call i64 @HadTu_size(i8* %0)
%3 = tail call i64 (...) @HadTu_hdrSize()
%4 = sub i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ pause();
int main() { pause(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @pause()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pause()
ret i32 0
}
void run_exec() {}


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

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

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

LLVM IR (-O2):
define void @run_exec() {
ret void
}
void wx11tx(length, char_array) int *length, char_array[];
{ wx11ix(length, char_array); }


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

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

LLVM IR (-O0):
define void @wx11tx(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 (i32*, i32*, ...) bitcast (i32 (...)* @wx11ix to i32 (i32*, i32*, ...)*)(i32* %5, i32* %6)
ret void
}

LLVM IR (-O2):
define void @wx11tx(i32* %0, i32* %1) {
%3 = tail call i32 (i32*, i32*, ...) bitcast (i32 (...)* @wx11ix to i32 (i32*, i32*, ...)*)(i32* %0, i32* %1)
ret void
}
unsigned opt_a(unsigned m, unsigned n) {
  if (m == 0)
    return n + 1;
  if (n == 0)
    return opt_a(m - 1, 1);
  return opt_a(m - 1, opt_a(m, n - 1));
}


x86 assembly (clang, -O0):
<opt_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1136 <opt_a+0x26>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117c <opt_a+0x6c>
cmpl   $0x0,-0xc(%rbp)
jne    1158 <opt_a+0x48>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    $0x1,%esi
call   1030 <opt_a@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <opt_a+0x6c>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <opt_a@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <opt_a@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_a>:
push   %rbx
mov    %esi,%eax
test   %edi,%edi
je     113f <opt_a+0x2f>
mov    %edi,%ebx
jmp    112a <opt_a+0x1a>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%eax
add    $0xffffffff,%ebx
je     113f <opt_a+0x2f>
test   %eax,%eax
je     1120 <opt_a+0x10>
add    $0xffffffff,%eax
mov    %ebx,%edi
mov    %eax,%esi
call   1030 <opt_a@plt>
add    $0xffffffff,%ebx
jne    112a <opt_a+0x1a>
add    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @opt_a(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %5
%10 = add i32 %9, 1
store i32 %10, i32* %3
br label %26
11: ; preds = %2
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %18
14: ; preds = %11
%15 = load i32, i32* %4
%16 = sub i32 %15, 1
%17 = call i32 @opt_a(i32 %16, i32 1)
store i32 %17, i32* %3
br label %26
18: ; preds = %11
%19 = load i32, i32* %4
%20 = sub i32 %19, 1
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = sub i32 %22, 1
%24 = call i32 @opt_a(i32 %21, i32 %23)
%25 = call i32 @opt_a(i32 %20, i32 %24)
store i32 %25, i32* %3
br label %26
26: ; preds = %18, %14, %8
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
define i32 @opt_a(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %11, %2
%5 = phi i32 [ %1, %2 ], [ %12, %11 ]
%6 = add i32 %5, 1
ret i32 %6
7: ; preds = %2, %11
%8 = phi i32 [ %12, %11 ], [ %1, %2 ]
%9 = phi i32 [ %13, %11 ], [ %0, %2 ]
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %15
11: ; preds = %7, %15
%12 = phi i32 [ %17, %15 ], [ 1, %7 ]
%13 = add i32 %9, -1
%14 = icmp eq i32 %13, 0
br i1 %14, label %4, label %7
15: ; preds = %7
%16 = add i32 %8, -1
%17 = tail call i32 @opt_a(i32 %9, i32 %16)
br label %11
}
void set_bit(unsigned long *bitmap, int entry) {
  int i, j, mask;
  i = (entry >> 5);
  j = entry & 31;
  mask = 1 << j;
  bitmap[i] |= mask;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
movslq -0x18(%rbp),%rdx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x5,%eax
mov    $0x1,%edx
shl    %cl,%edx
movslq %edx,%rcx
cltq
or     %rcx,(%rdi,%rax,8)
ret

LLVM IR (-O0):
define void @set_bit(i64* %0, i32 %1) {
%3 = alloca i64*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %3
store i32 %1, i32* %4
%8 = load i32, i32* %4
%9 = ashr i32 %8, 5
store i32 %9, i32* %5
%10 = load i32, i32* %4
%11 = and i32 %10, 31
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = shl i32 1, %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = load i64*, i64** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i64, i64* %16, i64 %18
%20 = load i64, i64* %19
%21 = or i64 %20, %15
store i64 %21, i64* %19
ret void
}

LLVM IR (-O2):
define void @set_bit(i64* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 5
%4 = and i32 %1, 31
%5 = shl nuw i32 1, %4
%6 = sext i32 %5 to i64
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i64, i64* %0, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %6
store i64 %10, i64* %8
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_epi8(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i __attribute__((no, unused)) test(__m128i s1, __m128i s2) {
  return _mm_cmpgt_epi8(s1, s2);
}


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

x86 assembly (clang, -O2):
<test>:
jmp    1030 <_mm_cmpgt_epi8@plt>

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

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_epi8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int has_key(int);
int ncurses_has_key(int ch) { return has_key(ch); }


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

x86 assembly (clang, -O2):
<ncurses_has_key>:
jmp    1030 <has_key@plt>

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

LLVM IR (-O2):
define i32 @ncurses_has_key(i32 %0) {
%2 = tail call i32 @has_key(i32 %0)
ret i32 %2
}
void com_init(void) {}


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

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

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

LLVM IR (-O2):
define void @com_init() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ free(void *);
int /*<<< orphan*/ printf(char *);
void kfree(void *ptr) {
  if (ptr == NULL) {
    printf("kfree error!\n");
    fflush(0);
    exit(-1);
  } else
    free(ptr);
}


x86 assembly (clang, -O0):
<kfree>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1174 <kfree+0x34>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kfree>:
test   %rdi,%rdi
je     114a <kfree+0xa>
jmp    1030 <free@plt>
push   %rax
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1050 <fflush@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"kfree error!\0A\00"
define void @kfree(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @fflush(i32 0)
%8 = call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = call i32 @free(i8* %10)
br label %12
12: ; preds = %9
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"kfree error!\00"
define void @kfree(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @fflush(i32 0)
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
%8 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_iochannel_read_with_creds() {
  printf("NOT IMPLEMENTED:"
         "pa_iochannel_read_with_creds"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [46 x i8] c"NOT IMPLEMENTED:pa_iochannel_read_with_creds\0A\00"
define i32 @pa_iochannel_read_with_creds() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [45 x i8] c"NOT IMPLEMENTED:pa_iochannel_read_with_creds\00"
define i32 @pa_iochannel_read_with_creds() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned int DecodeArith(unsigned int);
int /*<<< orphan*/ UpdateDecoder(unsigned int, int, unsigned int);
unsigned decode_value(unsigned rangex) {
  unsigned valuex;
  valuex = DecodeArith(rangex);
  UpdateDecoder(valuex, 1, rangex);
  return valuex;
}


x86 assembly (clang, -O0):
<decode_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <DecodeArith@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%edx
mov    $0x1,%esi
call   1040 <UpdateDecoder@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_value>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1030 <DecodeArith@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x1,%esi
mov    %ebx,%edx
call   1040 <UpdateDecoder@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @decode_value(i32 %0) {
%2 = tail call i32 @DecodeArith(i32 %0)
%3 = tail call i32 @UpdateDecoder(i32 %2, i32 1, i32 %0)
ret i32 %2
}
int minimum(int a, int b) {
  if (a > b) {
    return b;
  } else {
    return a;
  }
}


x86 assembly (clang, -O0):
<minimum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1121 <minimum+0x21>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <minimum+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<minimum>:
mov    %edi,%eax
cmp    %esi,%edi
cmovg  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @minimum(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %1, i32 %0
ret i32 %4
}
/* Variables and functions */
size_t net_get_ipv4_addr_size() { return 4; }


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

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

LLVM IR (-O0):
define i64 @net_get_ipv4_addr_size() {
ret i64 4
}

LLVM IR (-O2):
define i64 @net_get_ipv4_addr_size() {
ret i64 4
}
int main(void) {
  int a[4][5] = {0};
  a[2][3];
  int b[4][3] = {0};
  int z = b[0][0];
  int c[4][5] = {0};
  *(*c + 2 + 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
mov    -0x90(%rbp),%eax
mov    %eax,-0x94(%rbp)
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
xor    %eax,%eax
add    $0xf0,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printXmlFourDigits(int *data, unsigned int offset, const char *name) {
  if (offset > 0) {
    printf("%*c", offset, ' ');
  }
  printf("<%s>%i</%s>\n", name, *data, name);
}


x86 assembly (clang, -O0):
<printXmlFourDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1143 <printXmlFourDigits+0x33>
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printXmlFourDigits>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
test   %esi,%esi
je     1131 <printXmlFourDigits+0x21>
lea    0xedb(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%edx
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlFourDigits(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10, i32 32)
br label %12
12: ; preds = %9, %3
%13 = load i8*, i8** %6
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlFourDigits(i32* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 32)
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %8, i8* %2)
ret void
}
int process_remote_request(char *remote_buf) {}


x86 assembly (clang, -O0):
<process_remote_request>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @process_remote_request(i8* nocapture readnone %0) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EPERM;
int /*<<< orphan*/ errno;
int write(int fd, const void *buf, unsigned int nbyte) {
  (void)fd;
  (void)buf;
  (void)nbyte;
  errno = EPERM;
  return -1;
}


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2ebb(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec2(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<write>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EPERM = global i32 0
@errno = global i32 0
define i32 @write(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
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = load i32, i32* @EPERM
store i32 %10, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EPERM = global i32 0
@errno = global i32 0
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @EPERM
store i32 %4, i32* @errno
ret i32 -1
}
/* Type definitions */
struct Universidad {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ promedioCreditosCursados(struct Universidad *);
int main() {
  struct Universidad *pucv;
  int sigla = 0;
  promedioCreditosCursados(pucv);
  return 0;
}


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

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

LLVM IR (-O0):
%struct.Universidad = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.Universidad*
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = load %struct.Universidad*, %struct.Universidad** %2
%5 = call i32 @promedioCreditosCursados(%struct.Universidad* %4)
ret i32 0
}

LLVM IR (-O2):
%struct.Universidad = type { i32 }
define i32 @main() {
%1 = tail call i32 @promedioCreditosCursados(%struct.Universidad* undef)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int wiringPiSetup() {
  printf("wiringPiSetup\n");
  return 0;
}


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

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

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

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