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

/* Variables and functions */
struct widget *createwidget(struct view *);
int /*<<< orphan*/ widget_icon_init(struct widget *, char *, char *,
                                    unsigned int);
void pool_create_icon(struct view *view, char *id, char *in,
                      unsigned int type) {
  struct widget *widget = createwidget(view);
  widget_icon_init(widget, id, in, type);
}


x86 assembly (clang, -O0):
<pool_create_icon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <createwidget@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <widget_icon_init@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pool_create_icon>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rbp
call   1030 <createwidget@plt>
mov    %rax,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <widget_icon_init@plt>

LLVM IR (-O0):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @pool_create_icon(%struct.view* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca %struct.view*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca %struct.widget*
store %struct.view* %0, %struct.view** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%10 = load %struct.view*, %struct.view** %5
%11 = call %struct.widget* @createwidget(%struct.view* %10)
store %struct.widget* %11, %struct.widget** %9
%12 = load %struct.widget*, %struct.widget** %9
%13 = load i8*, i8** %6
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @widget_icon_init(%struct.widget* %12, i8* %13, i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
%struct.view = type { i32 }
%struct.widget = type { i32 }
define void @pool_create_icon(%struct.view* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call %struct.widget* @createwidget(%struct.view* %0)
%6 = tail call i32 @widget_icon_init(%struct.widget* %5, i8* %1, i8* %2, i32 %3)
ret void
}
void av_fifo_freep() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_freep() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __ISB();
unsigned long __get_SCTLR();
int /*<<< orphan*/ __set_SCTLR(unsigned long);
__attribute__((always_)) void L1C_DisableCaches(void) {
  __set_SCTLR(__get_SCTLR() & (~(1UL << 12U)) & (~(1UL << 2U)));
  __ISB();
}


x86 assembly (clang, -O0):
<L1C_DisableCaches>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <__get_SCTLR@plt>
mov    %rax,%rdi
and    $0xffffffffffffefff,%rdi
and    $0xfffffffffffffffb,%rdi
call   1050 <__set_SCTLR@plt>
mov    $0x0,%al
call   1030 <__ISB@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_DisableCaches>:
push   %rax
xor    %eax,%eax
call   1040 <__get_SCTLR@plt>
and    $0xffffffffffffeffb,%rax
mov    %rax,%rdi
call   1050 <__set_SCTLR@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <__ISB@plt>

LLVM IR (-O0):
define void @L1C_DisableCaches() {
%1 = call i64 (...) @__get_SCTLR()
%2 = and i64 %1, -4097
%3 = and i64 %2, -5
%4 = call i32 @__set_SCTLR(i64 %3)
%5 = call i32 (...) @__ISB()
ret void
}

LLVM IR (-O2):
define void @L1C_DisableCaches() {
%1 = tail call i64 (...) @__get_SCTLR()
%2 = and i64 %1, -4101
%3 = tail call i32 @__set_SCTLR(i64 %2)
%4 = tail call i32 (...) @__ISB()
ret void
}
/* Variables and functions */
int strlen(const char *s) {
  int n = 0;
  do {
    ++n;
  } while (*s++ != '\0');
  return (n);
}


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

x86 assembly (clang, -O2):
<strlen>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = phi i32 [ 0, %1 ], [ %5, %2 ]
%5 = add nuw nsw i32 %4, 1
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %2
9: ; preds = %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ INDR(int, int, int, int);
void op_ED_0xba(void) {
  INDR(12, 17, 6, 9);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0xba>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x6,%edx
mov    $0x9,%ecx
call   1030 <INDR@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0xba>:
mov    $0xc,%edi
mov    $0x11,%esi
mov    $0x6,%edx
mov    $0x9,%ecx
jmp    1030 <INDR@plt>

LLVM IR (-O0):
define void @op_ED_0xba() {
%1 = call i32 @INDR(i32 12, i32 17, i32 6, i32 9)
ret void
}

LLVM IR (-O2):
define void @op_ED_0xba() {
%1 = tail call i32 @INDR(i32 12, i32 17, i32 6, i32 9)
ret void
}
/* Variables and functions */
bool is_power_of_two(size_t value) {
  return (value > 0 && ((value & (~value + 1)) == value));
}


x86 assembly (clang, -O0):
<is_power_of_two>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jbe    1135 <is_power_of_two+0x35>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
add    $0x1,%rcx
and    %rcx,%rax
cmp    -0x8(%rbp),%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_power_of_two>:
test   %rdi,%rdi
je     1112 <is_power_of_two+0x12>
lea    -0x1(%rdi),%rcx
xor    %eax,%eax
test   %rcx,%rdi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @is_power_of_two(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = load i64, i64* %2
%7 = load i64, i64* %2
%8 = xor i64 %7, -1
%9 = add i64 %8, 1
%10 = and i64 %6, %9
%11 = load i64, i64* %2
%12 = icmp eq i64 %10, %11
br label %13
13: ; preds = %5, %1
%14 = phi i1 [ false, %1 ], [ %12, %5 ]
%15 = zext i1 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @is_power_of_two(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @llvm.ctpop.i64(i64 %0)
%5 = icmp ult i64 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int parse_read_capacity_16(unsigned char *, unsigned int, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/);
bool parse_read_capacity_16_simple(unsigned char *buf, unsigned buf_len,
                                   uint64_t *max_lba, uint32_t *block_size) {
  return parse_read_capacity_16(buf, buf_len, max_lba, block_size, 0, 0, 0, 0,
                                0, 0, 0);
}


x86 assembly (clang, -O0):
<parse_read_capacity_16_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
xor    %r9d,%r9d
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x20(%rsp)
call   1030 <parse_read_capacity_16@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_read_capacity_16_simple>:
push   %rax
sub    $0x8,%rsp
xor    %r8d,%r8d
xor    %r9d,%r9d
push   $0x0
push   $0x0
push   $0x0
push   $0x0
push   $0x0
call   1030 <parse_read_capacity_16@plt>
add    $0x30,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @parse_read_capacity_16_simple(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %7
%12 = load i32*, i32** %8
%13 = call i32 @parse_read_capacity_16(i8* %9, i32 %10, i32* %11, i32* %12, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %13
}

LLVM IR (-O2):
define i32 @parse_read_capacity_16_simple(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = tail call i32 @parse_read_capacity_16(i8* %0, i32 %1, i32* %2, i32* %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_186(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_186() {
ret i32 0
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ *d_name;
};

/* Variables and functions */
int /*<<< orphan*/ isdigit(int /*<<< orphan*/);
int _mx_filter_numbers(const struct dirent *d) {
  if (!isdigit(d->d_name[0]))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<_mx_filter_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    113f <_mx_filter_numbers+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1146 <_mx_filter_numbers+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_mx_filter_numbers>:
mov    (%rdi),%rax
mov    (%rax),%ecx
add    $0xffffffd0,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
setb   %al
ret

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

LLVM IR (-O2):
%struct.dirent = type { i32* }
define i32 @_mx_filter_numbers(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add i32 %4, -48
%6 = icmp ult i32 %5, 10
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void vsync() {
  while ((*(volatile uint16_t *)0x4000006) >= 160)
    ;
  while ((*(volatile uint16_t *)0x4000006) < 160)
    ;
}


x86 assembly (clang, -O0):
<vsync>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <vsync+0x9>
mov    $0x4000006,%eax
mov    (%rax),%eax
cmp    $0xa0,%eax
jl     1120 <vsync+0x20>
jmp    1109 <vsync+0x9>
jmp    1125 <vsync+0x25>
mov    $0x4000006,%eax
mov    (%rax),%eax
cmp    $0xa0,%eax
jge    113c <vsync+0x3c>
jmp    1125 <vsync+0x25>
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsync>:
mov    0x4000006,%eax
cmp    $0x9f,%eax
jg     1100 <vsync>
xchg   %ax,%ax
mov    0x4000006,%eax
cmp    $0xa0,%eax
jl     1110 <vsync+0x10>
ret

LLVM IR (-O0):
define void @vsync() {
br label %1
1: ; preds = %4, %0
%2 = load volatile i32, i32* inttoptr (i64 67108870 to i32*)
%3 = icmp sge i32 %2, 160
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
br label %6
6: ; preds = %9, %5
%7 = load volatile i32, i32* inttoptr (i64 67108870 to i32*)
%8 = icmp slt i32 %7, 160
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @vsync() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 67108870 to i32*)
%3 = icmp sgt i32 %2, 159
br i1 %3, label %1, label %4
4: ; preds = %1, %4
%5 = load volatile i32, i32* inttoptr (i64 67108870 to i32*)
%6 = icmp slt i32 %5, 160
br i1 %6, label %4, label %7
7: ; preds = %4
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int isStrDigit(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *str1 = "123432423";
  char *str2 = "32e2badfsdf";
  printf("str1 isdigit = %d\n", isStrDigit(str1));
  printf("str2 isdigit = %d\n", isStrDigit(str2));
  return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <isStrDigit@plt>
mov    %eax,%esi
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <isStrDigit@plt>
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <isStrDigit@plt>
lea    0xee2(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
call   1040 <isStrDigit@plt>
lea    0xedb(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2e84(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"123432423\00"
@.str.1 = [12 x i8] c"32e2badfsdf\00"
@.str.2 = [19 x i8] c"str1 isdigit = %d\0A\00"
@.str.3 = [19 x i8] c"str2 isdigit = %d\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = call i32 @isStrDigit(i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %3
%8 = call i32 @isStrDigit(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @EXIT_FAILURE
ret i32 %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"123432423\00"
@.str.1 = [12 x i8] c"32e2badfsdf\00"
@.str.2 = [19 x i8] c"str1 isdigit = %d\0A\00"
@.str.3 = [19 x i8] c"str2 isdigit = %d\0A\00"
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = tail call i32 @isStrDigit(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%3 = tail call i32 @isStrDigit(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%5 = load i32, i32* @EXIT_FAILURE
ret i32 %5
}
void SIMConf_C(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ write(int, char *, int);
int send_byte_com(int sfd, char data_byte) {
  char write_buf_cmd[1];
  write_buf_cmd[0] = data_byte;
  write(sfd, write_buf_cmd, sizeof(write_buf_cmd));
}


x86 assembly (clang, -O0):
<send_byte_com>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xa(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_byte_com>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @send_byte_com(i32 %0, i8 signext %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 %1, i8* %4
%5 = call i32 @write(i32 %0, i8* %4, i32 1)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ myscheduler_end();
void mypthread_end() { myscheduler_end(); }


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

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

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

LLVM IR (-O2):
define void @mypthread_end() {
%1 = tail call i32 (...) @myscheduler_end()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t SysCtlPWMClockGet(void) {
  ;
  if (!((*((volatile uint32_t *)(0x400FE060))) & 0x00100000)) {
    return (0x00000000);
  } else {
    return ((*((volatile uint32_t *)(0x400FE060))) & (0x00100000 | 0x000E0000));
  }
}


x86 assembly (clang, -O0):
<SysCtlPWMClockGet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe060,%eax
mov    (%rax),%eax
and    $0x100000,%eax
cmp    $0x0,%eax
jne    1125 <SysCtlPWMClockGet+0x25>
movl   $0x0,-0x4(%rbp)
jmp    1134 <SysCtlPWMClockGet+0x34>
mov    $0x400fe060,%eax
mov    (%rax),%eax
and    $0x1e0000,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysCtlPWMClockGet>:
xor    %eax,%eax
testl  $0x100000,0x400fe060
je     111b <SysCtlPWMClockGet+0x1b>
mov    $0x1e0000,%eax
and    0x400fe060,%eax
ret

LLVM IR (-O0):
define i32 @SysCtlPWMClockGet() {
%1 = alloca i32
%2 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%3 = and i32 %2, 1048576
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %0
store i32 0, i32* %1
br label %9
6: ; preds = %0
%7 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%8 = and i32 %7, 1966080
store i32 %8, i32* %1
br label %9
9: ; preds = %6, %5
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
define i32 @SysCtlPWMClockGet() {
%1 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%2 = and i32 %1, 1048576
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = load volatile i32, i32* inttoptr (i64 1074782304 to i32*)
%6 = and i32 %5, 1966080
br label %7
7: ; preds = %0, %4
%8 = phi i32 [ %6, %4 ], [ 0, %0 ]
ret i32 %8
}
/* Variables and functions */
int f(int);
int g(int y) {
  if (y > 5) {
    return y;
  }
  return f(y - 1);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1130 <g+0x20>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113e <g+0x2e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
cmp    $0x5,%edi
jle    1118 <g+0x8>
mov    %edi,%eax
ret
add    $0xffffffff,%edi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp sgt i32 %0, 5
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = tail call i32 @f(i32 %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ %0, %1 ]
ret i32 %7
}
void ipc_log_write(void *ctxt, struct encode_context *ectxt) {}


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

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

LLVM IR (-O0):
%struct.encode_context = type opaque
define void @ipc_log_write(i8* %0, %struct.encode_context* %1) {
%3 = alloca i8*
%4 = alloca %struct.encode_context*
store i8* %0, i8** %3
store %struct.encode_context* %1, %struct.encode_context** %4
ret void
}

LLVM IR (-O2):
%struct.encode_context = type opaque
define void @ipc_log_write(i8* nocapture %0, %struct.encode_context* nocapture %1) {
ret void
}
void am_print_error(char *errstring) {}


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

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

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

LLVM IR (-O2):
define void @am_print_error(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bcm2835_delayMicroseconds(int);
void bcm2835_delay(unsigned int millis) {
  bcm2835_delayMicroseconds(1000 * millis);
}


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

x86 assembly (clang, -O2):
<bcm2835_delay>:
imul   $0x3e8,%edi,%edi
jmp    1030 <bcm2835_delayMicroseconds@plt>

LLVM IR (-O0):
define void @bcm2835_delay(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 1000, %3
%5 = call i32 @bcm2835_delayMicroseconds(i32 %4)
ret void
}

LLVM IR (-O2):
define void @bcm2835_delay(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @bcm2835_delayMicroseconds(i32 %2)
ret void
}
void RTLdrClose(void) {}


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

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

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

LLVM IR (-O2):
define void @RTLdrClose() {
ret void
}
/* Variables and functions */
char *strrchr(const char *s, int c) { return NULL; }


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

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

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

LLVM IR (-O2):
define noalias i8* @strrchr(i8* nocapture readnone %0, i32 %1) {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ client_process(int);
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/);
void *worker_per_request(void *fd) {
  client_process((int)fd);
  pthread_exit(0);
}


x86 assembly (clang, -O0):
<worker_per_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%edi
call   1030 <client_process@plt>
xor    %edi,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<worker_per_request>:
push   %rax
call   1030 <client_process@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @worker_per_request(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i32
%6 = call i32 @client_process(i32 %5)
%7 = call i32 @pthread_exit(i32 0)
%8 = load i8*, i8** %2
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @worker_per_request(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @client_process(i32 %3)
%5 = tail call i32 @pthread_exit(i32 0)
ret i8* undef
}
/* Variables and functions */
long L2L(long);
__attribute__((__visibility__("default"))) __attribute__((used)) signed long
rL2L(signed long *x) {
  return L2L(*x);
}


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

x86 assembly (clang, -O2):
<rL2L>:
mov    (%rdi),%rdi
jmp    1030 <L2L@plt>

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64*)* @rL2L to i8*)], section "llvm.metadata"
define i64 @rL2L(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = call i64 @L2L(i64 %4)
ret i64 %5
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i64 (i64*)* @rL2L to i8*)], section "llvm.metadata"
define i64 @rL2L(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @L2L(i64 %2)
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ L1C_CleanInvalidateCache(int /*<<< orphan*/);
void L1C_InvalidateDCacheAll(void) { L1C_CleanInvalidateCache(0); }


x86 assembly (clang, -O0):
<L1C_InvalidateDCacheAll>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <L1C_CleanInvalidateCache@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<L1C_InvalidateDCacheAll>:
xor    %edi,%edi
jmp    1030 <L1C_CleanInvalidateCache@plt>

LLVM IR (-O0):
define void @L1C_InvalidateDCacheAll() {
%1 = call i32 @L1C_CleanInvalidateCache(i32 0)
ret void
}

LLVM IR (-O2):
define void @L1C_InvalidateDCacheAll() {
%1 = tail call i32 @L1C_CleanInvalidateCache(i32 0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int copy_quaddobl_start_system_to_container(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(263, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<copy_quaddobl_start_system_to_container>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x107,%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):
<copy_quaddobl_start_system_to_container>:
mov    $0x107,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @copy_quaddobl_start_system_to_container() {
%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 263, 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 @copy_quaddobl_start_system_to_container() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 263, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
/* Variables and functions */
double exp(double);
int snprintf(char *, int, char *, double);
int senFunc8(char *s, int n, int a) {
  return snprintf(s, n, "CH4: %lf ppm", 4.0371 * exp(2.06903 * a * 0.00488));
}


x86 assembly (clang, -O0):
<senFunc8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm1
movsd  0xec3(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeaf(%rip),%xmm1
mulsd  %xmm1,%xmm0
call   1040 <exp@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
movaps %xmm0,%xmm1
movsd  0xe8c(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe99(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<senFunc8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
cvtsi2sd %edx,%xmm0
mulsd  0xecc(%rip),%xmm0
mulsd  0xecc(%rip),%xmm0
call   1040 <exp@plt>
mulsd  0xec7(%rip),%xmm0
lea    0xec8(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"CH4: %lf ppm\00"
define i32 @senFunc8(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = sitofp i32 %9 to double
%11 = fmul double 2.069030e+00, %10
%12 = fmul double %11, 4.880000e-03
%13 = call double @exp(double %12)
%14 = fmul double 4.037100e+00, %13
%15 = call i32 @snprintf(i8* %7, i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %14)
ret i32 %15
}

LLVM IR (-O2):
@.str = [13 x i8] c"CH4: %lf ppm\00"
define i32 @senFunc8(i8* %0, i32 %1, i32 %2) {
%4 = sitofp i32 %2 to double
%5 = fmul double %4, 2.069030e+00
%6 = fmul double %5, 4.880000e-03
%7 = tail call double @exp(double %6)
%8 = fmul double %7, 4.037100e+00
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void ParamCallback(void *ctx, int cmd, unsigned int val) {
  fprintf(stderr, "TODO: param\n");
}


x86 assembly (clang, -O0):
<ParamCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    0x2eb7(%rip),%rax
mov    (%rax),%edi
lea    0xece(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParamCallback>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"TODO: param\0A\00"
define void @ParamCallback(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"TODO: param\0A\00"
define void @ParamCallback(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int __gen_ocl_get_num_groups0();
int __gen_ocl_get_num_groups1();
int __gen_ocl_get_num_groups2();
__attribute__((always_)) unsigned get_num_groups(unsigned int dim) {
  if (dim == 0)
    return __gen_ocl_get_num_groups0();
  else if (dim == 1)
    return __gen_ocl_get_num_groups1();
  else if (dim == 2)
    return __gen_ocl_get_num_groups2();
  else
    return 1;
}


x86 assembly (clang, -O0):
<get_num_groups>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1154 <get_num_groups+0x24>
mov    $0x0,%al
call   1050 <__gen_ocl_get_num_groups0@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <get_num_groups+0x5d>
cmpl   $0x1,-0x8(%rbp)
jne    116d <get_num_groups+0x3d>
mov    $0x0,%al
call   1030 <__gen_ocl_get_num_groups1@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <get_num_groups+0x5d>
cmpl   $0x2,-0x8(%rbp)
jne    1186 <get_num_groups+0x56>
mov    $0x0,%al
call   1040 <__gen_ocl_get_num_groups2@plt>
mov    %eax,-0x4(%rbp)
jmp    118d <get_num_groups+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_groups>:
cmp    $0x2,%edi
je     1145 <get_num_groups+0x15>
cmp    $0x1,%edi
je     114c <get_num_groups+0x1c>
test   %edi,%edi
jne    1153 <get_num_groups+0x23>
xor    %eax,%eax
jmp    1050 <__gen_ocl_get_num_groups0@plt>
xor    %eax,%eax
jmp    1040 <__gen_ocl_get_num_groups2@plt>
xor    %eax,%eax
jmp    1030 <__gen_ocl_get_num_groups1@plt>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @get_num_groups(i32 %0) {
switch i32 %0, label %8 [
i32 0, label %2
i32 1, label %4
i32 2, label %6
]
2: ; preds = %1
%3 = tail call i32 (...) @__gen_ocl_get_num_groups0()
br label %8
4: ; preds = %1
%5 = tail call i32 (...) @__gen_ocl_get_num_groups1()
br label %8
6: ; preds = %1
%7 = tail call i32 (...) @__gen_ocl_get_num_groups2()
br label %8
8: ; preds = %1, %6, %4, %2
%9 = phi i32 [ %3, %2 ], [ %5, %4 ], [ %7, %6 ], [ 1, %1 ]
ret i32 %9
}
void gtk_icon_view_get_pixbuf_column() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_view_get_pixbuf_column() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ outw(int, int);
int /*<<< orphan*/ spi_xfer(int, int /*<<< orphan*/);
int /*<<< orphan*/ spi_xfer_buf_set(int, int);
void sd_flush_fifo(void) {
  int i;
  for (i = 0; i < 128; ++i)
    spi_xfer_buf_set(i, 0xff);
  outw(0xfff0, 0x1ff);
  spi_xfer(8, 0);
}


x86 assembly (clang, -O0):
<sd_flush_fifo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1167 <sd_flush_fifo+0x37>
mov    -0x4(%rbp),%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <sd_flush_fifo+0xf>
mov    $0xfff0,%edi
mov    $0x1ff,%esi
call   1050 <outw@plt>
mov    $0x8,%edi
xor    %esi,%esi
call   1040 <spi_xfer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_flush_fifo>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
mov    $0xff,%esi
call   1030 <spi_xfer_buf_set@plt>
add    $0x1,%ebx
cmp    $0x80,%ebx
jne    1140 <sd_flush_fifo+0x10>
mov    $0xfff0,%edi
mov    $0x1ff,%esi
call   1050 <outw@plt>
mov    $0x8,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <spi_xfer@plt>

LLVM IR (-O0):
define void @sd_flush_fifo() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %8, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 128
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load i32, i32* %1
%7 = call i32 @spi_xfer_buf_set(i32 %6, i32 255)
br label %8
8: ; preds = %5
%9 = load i32, i32* %1
%10 = add nsw i32 %9, 1
store i32 %10, i32* %1
br label %2
11: ; preds = %2
%12 = call i32 @outw(i32 65520, i32 511)
%13 = call i32 @spi_xfer(i32 8, i32 0)
ret void
}

LLVM IR (-O2):
define void @sd_flush_fifo() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @spi_xfer_buf_set(i32 %2, i32 255)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 128
br i1 %5, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @outw(i32 65520, i32 511)
%8 = tail call i32 @spi_xfer(i32 8, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main(void) {
  test(35);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x23,%edi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 35)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
__attribute__((always_)) void tu_refresh(void) { fflush(stdout); }


x86 assembly (clang, -O0):
<tu_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
call   1030 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tu_refresh>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
jmp    1030 <fflush@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @tu_refresh() {
%1 = load i32, i32* @stdout
%2 = call i32 @fflush(i32 %1)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @tu_refresh() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int fscanf(int /*<<< orphan*/ *, char *, int *, double *, double *);
int read_data(FILE *fp, int *id, double *prob_obs_unmut, double *prob_obs_mut) {
  if (3 != fscanf(fp, "%d %lf %lf\n", id, prob_obs_unmut, prob_obs_mut)) {
    return EOF;
  }
  return 1;
}


x86 assembly (clang, -O0):
<read_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    0xec1(%rip),%rsi
call   1030 <fscanf@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
je     1164 <read_data+0x54>
mov    0x2e8e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <read_data+0x5b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_data>:
push   %rax
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
lea    0xedf(%rip),%rsi
call   1030 <fscanf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    $0x3,%ecx
je     113b <read_data+0x2b>
mov    0x2eaf(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d %lf %lf\0A\00"
@EOF = global i32 0
define i32 @read_data(i32* %0, i32* %1, double* %2, double* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca double*
store i32* %0, i32** %6
store i32* %1, i32** %7
store double* %2, double** %8
store double* %3, double** %9
%10 = load i32*, i32** %6
%11 = load i32*, i32** %7
%12 = load double*, double** %8
%13 = load double*, double** %9
%14 = call i32 @fscanf(i32* %10, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %11, double* %12, double* %13)
%15 = icmp ne i32 3, %14
br i1 %15, label %16, label %18
16: ; preds = %4
%17 = load i32, i32* @EOF
store i32 %17, i32* %5
br label %19
18: ; preds = %4
store i32 1, i32* %5
br label %19
19: ; preds = %18, %16
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d %lf %lf\0A\00"
@EOF = global i32 0
define i32 @read_data(i32* nocapture %0, i32* %1, double* %2, double* %3) {
%5 = tail call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32* %1, double* %2, double* %3)
%6 = icmp eq i32 %5, 3
%7 = load i32, i32* @EOF
%8 = select i1 %6, i32 1, i32 %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[4] = {1, 2, 3, 4};
  int *parr = arr;
  printf("parr: [%i] \n", *parr);
  parr++;
  printf("parr: [%i] \n", *parr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = [13 x i8] c"parr: [%i] \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i32 1
store i32* %10, i32** %3
%11 = load i32*, i32** %3
%12 = load i32, i32* %11
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"parr: [%i] \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
char *newstr(const char *str) {
  int len;
  char *ret;
  len = strlen(str) + 1;
  ret = (char *)malloc(len * sizeof(char));
  strcpy(ret, str);
  return ret;
}


x86 assembly (clang, -O0):
<newstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newstr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @newstr(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = mul i64 %9, 1
%11 = trunc i64 %10 to i32
%12 = call i64 @malloc(i32 %11)
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %4
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = call i32 @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
define i8* @newstr(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @malloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
void prune_alias_le_Ok(int x) {
  int a[1];
  if (x <= x) {
    a[0] = 0;
  } else {
    a[1] = 0;
  }
}


x86 assembly (clang, -O0):
<prune_alias_le_Ok>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     111f <prune_alias_le_Ok+0x1f>
movl   $0x0,-0x8(%rbp)
jmp    1126 <prune_alias_le_Ok+0x26>
movl   $0x0,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @prune_alias_le_Ok(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = icmp sle i32 %4, %5
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
store i32 0, i32* %8
br label %11
9: ; preds = %1
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 1
store i32 0, i32* %10
br label %11
11: ; preds = %9, %7
ret void
}

LLVM IR (-O2):
define void @prune_alias_le_Ok(i32 %0) {
ret void
}
/* Variables and functions */
int tuner_i2c_write(void *, unsigned short, unsigned char, int, unsigned char *,
                    int);
int fc8300b_write(void *handle, unsigned short devid, unsigned char addr,
                  unsigned char data) {
  int res;
  res = tuner_i2c_write(handle, devid, addr, 1, &data, 1);
  return res;
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %si,%dx
mov    %rdi,-0x8(%rbp)
mov    %dx,-0xa(%rbp)
mov    %cl,-0xb(%rbp)
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    $0x1,%r9d
lea    -0xc(%rbp),%r8
movzwl %ax,%esi
movzbl -0xb(%rbp),%edx
mov    %r9d,%ecx
call   1030 <tuner_i2c_write@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rax
mov    %cl,0x7(%rsp)
lea    0x7(%rsp),%r8
mov    $0x1,%ecx
mov    $0x1,%r9d
call   1030 <tuner_i2c_write@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fc8300b_write(i8* %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i8* %0, i8** %5
store i16 %1, i16* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8*, i8** %5
%11 = load i16, i16* %6
%12 = load i8, i8* %7
%13 = call i32 @tuner_i2c_write(i8* %10, i16 zeroext %11, i8 zeroext %12, i32 1, i8* %8, i32 1)
store i32 %13, i32* %9
%14 = load i32, i32* %9
ret i32 %14
}

LLVM IR (-O2):
define i32 @fc8300b_write(i8* %0, i16 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
store i8 %3, i8* %5
%6 = call i32 @tuner_i2c_write(i8* %0, i16 zeroext %1, i8 zeroext %2, i32 1, i8* %5, i32 1)
ret i32 %6
}
void fc165(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      goto a;
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
  a:;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc165(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
br label %18
15: ; No predecessors!
%16 = load i32, i32* %2
%17 = zext i32 %16 to i64
br label %18
18: ; preds = %15, %1
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc165(i32 %0) {
ret void
}