xunge/DecIR huggingface dataset:
int emac1_aoctetsreceivedok_set(unsigned int dev_id,
                                union emac1_aoctetsreceivedok_u *value) {
  return 1;
}


x86 assembly (clang, -O0):
<emac1_aoctetsreceivedok_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_aoctetsreceivedok_set>:
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
%union.emac1_aoctetsreceivedok_u = type opaque
define i32 @emac1_aoctetsreceivedok_set(i32 %0, %union.emac1_aoctetsreceivedok_u* nocapture readnone %1) {
ret i32 1
}
/* Variables and functions */
int str_fixup(void **, int);
int uri_fixup(void **param, int param_no) {
  if (param_no == 1) {
    return str_fixup(param, 1);
  } else if (param_no == 2) {
    return str_fixup(param, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<uri_fixup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    113f <uri_fixup+0x2f>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <str_fixup@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <uri_fixup+0x5b>
cmpl   $0x2,-0x14(%rbp)
jne    115f <uri_fixup+0x4f>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
call   1030 <str_fixup@plt>
mov    %eax,-0x4(%rbp)
jmp    116b <uri_fixup+0x5b>
jmp    1164 <uri_fixup+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uri_fixup>:
add    $0xffffffff,%esi
cmp    $0x1,%esi
ja     1122 <uri_fixup+0x12>
mov    $0x1,%esi
jmp    1030 <str_fixup@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @uri_fixup(i8** %0, i32 %1) {
%3 = add i32 %1, -1
%4 = icmp ult i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @str_fixup(i8** %0, i32 1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %2 ], [ %6, %5 ]
ret i32 %8
}
void *test(void *p) {
  int id = (int)p;
  int *result = malloc(sizeof(int));
  printf("Hello from thread %d\n", id);
  result = (id * id);
  return (void *)result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0xc(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
imul   %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Hello from thread %d\0A\00"
define i8* @test(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = ptrtoint i8* %5 to i32
store i32 %6, i32* %3
%7 = call i8* @malloc(i64 4)
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %4
%9 = load i32, i32* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = mul nsw i32 %11, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store i32* %15, i32** %4
%16 = load i32*, i32** %4
%17 = bitcast i32* %16 to i8*
ret i8* %17
}

LLVM IR (-O2):
@.str = [22 x i8] c"Hello from thread %d\0A\00"
define i8* @test(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = mul i64 %2, %2
%6 = and i64 %5, 4294967295
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}
/* Variables and functions */
char **readdir_raw(char *, int, char *);
char **stb_readdir_subdirs_mask(char *dir, char *wild) {
  return readdir_raw(dir, 1, wild);
}


x86 assembly (clang, -O0):
<stb_readdir_subdirs_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x1,%esi
call   1030 <readdir_raw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_readdir_subdirs_mask>:
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <readdir_raw@plt>

LLVM IR (-O0):
define i8** @stb_readdir_subdirs_mask(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 = call i8** @readdir_raw(i8* %5, i32 1, i8* %6)
ret i8** %7
}

LLVM IR (-O2):
define i8** @stb_readdir_subdirs_mask(i8* %0, i8* %1) {
%3 = tail call i8** @readdir_raw(i8* %0, i32 1, i8* %1)
ret i8** %3
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ print_array(int *, int);
int /*<<< orphan*/ reverse_array(int *, int);
int main(void) {
  int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 98, 1024, 1337};
  print_array(a, sizeof(a) / sizeof(int));
  reverse_array(a, sizeof(a) / sizeof(int));
  print_array(a, sizeof(a) / sizeof(int));
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x34,%edx
call   1040 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1030 <print_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1050 <reverse_array@plt>
lea    -0x40(%rbp),%rdi
mov    $0xd,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
mov    0xf05(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xeea(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1040 <reverse_array@plt>
mov    %rbx,%rdi
mov    $0xd,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [13 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 98, i32 1024, i32 1337]
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i32]
store i32 0, i32* %1
%3 = bitcast [13 x i32]* %2 to i8*
%4 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%5 = call i32 @print_array(i32* %4, i32 13)
%6 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%7 = call i32 @reverse_array(i32* %6, i32 13)
%8 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 0
%9 = call i32 @print_array(i32* %8, i32 13)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [13 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 98, i32 1024, i32 1337]
define i32 @main() {
%1 = alloca [13 x i32]
%2 = bitcast [13 x i32]* %1 to i8*
%3 = getelementptr inbounds [13 x i32], [13 x i32]* %1, i64 0, i64 0
%4 = call i32 @print_array(i32* %3, i32 13)
%5 = call i32 @reverse_array(i32* %3, i32 13)
%6 = call i32 @print_array(i32* %3, i32 13)
ret i32 0
}
void TIM1_BRK_TIM9_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @TIM1_BRK_TIM9_IRQHandler() {
ret void
}
int width_needed_to_print_integer(int x) {
  int w = 0;
  do {
    x /= 10;
    w = w + 1;
  } while (x != 0);
  return w + 1;
}


x86 assembly (clang, -O0):
<width_needed_to_print_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    110e <width_needed_to_print_integer+0xe>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<width_needed_to_print_integer>:
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
add    $0x9,%ecx
add    $0x1,%eax
cmp    $0x12,%ecx
ja     1110 <width_needed_to_print_integer+0x10>
ret

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

LLVM IR (-O2):
define i32 @width_needed_to_print_integer(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %5, %2 ]
%4 = phi i32 [ 0, %1 ], [ %6, %2 ]
%5 = sdiv i32 %3, 10
%6 = add nuw nsw i32 %4, 1
%7 = add i32 %3, 9
%8 = icmp ult i32 %7, 19
br i1 %8, label %9, label %2
9: ; preds = %2
%10 = add nuw nsw i32 %4, 2
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ BootInit();
int /*<<< orphan*/ BootTask();
int /*<<< orphan*/ Init();
void main(void) {
  Init();
  BootInit();
  while (1) {
    BootTask();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <Init@plt>
mov    $0x0,%al
call   1030 <BootInit@plt>
mov    $0x0,%al
call   1050 <BootTask@plt>
jmp    1142 <main+0x12>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <Init@plt>
xor    %eax,%eax
call   1030 <BootInit@plt>
nop
xor    %eax,%eax
call   1050 <BootTask@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @Init()
%2 = call i32 (...) @BootInit()
br label %3
3: ; preds = %0, %3
%4 = call i32 (...) @BootTask()
br label %3
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @Init()
%2 = tail call i32 (...) @BootInit()
br label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @BootTask()
br label %3
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int scanf(char *, int *);
int main() {
  int number, check;
  check = scanf("%d", &number);
  while (check != 1) {
    check = scanf("%d", &number);
  }
  printf("%d \n", exact_square(number));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
je     1174 <main+0x44>
lea    0xe9d(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    %eax,-0xc(%rbp)
jmp    1152 <main+0x22>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
lea    0xeaf(%rip),%r14
lea    0x4(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    1160 <main+0x30>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xe83(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 %4, i32* %3
br label %5
5: ; preds = %8, %0
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 %9, i32* %3
br label %5
10: ; preds = %5
%11 = load i32, i32* %2
%12 = call i32 @exact_square(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %8, label %5
5: ; preds = %0, %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %5
8: ; preds = %5, %0
%9 = load i32, i32* %1
%10 = call i32 @exact_square(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fanout_debug(int /*<<< orphan*/, char *, char const *,
                                int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void fanout_error(const char *msg) {
  fanout_debug(0, "%s: %s\n", msg, strerror(errno));
  exit(1);
}


x86 assembly (clang, -O0):
<fanout_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x10(%rbp),%rdx
mov    %eax,%ecx
xor    %edi,%edi
lea    0xe9f(%rip),%rsi
call   1030 <fanout_debug@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fanout_error>:
push   %rbx
mov    %rdi,%rbx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeb7(%rip),%rsi
xor    %edi,%edi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <fanout_debug@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @fanout_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @errno
%5 = call i32 @strerror(i32 %4)
%6 = call i32 @fanout_debug(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@errno = global i32 0
define void @fanout_error(i8* %0) {
%2 = load i32, i32* @errno
%3 = tail call i32 @strerror(i32 %2)
%4 = tail call i32 @fanout_debug(i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, char const *);
void hsw_debug_blc_misc_ctl(char *result, int len, int reg, uint32_t val,
                            uint32_t devid) {
  const char *sel;
  sel = (val & 1) ? "PWM1-CPU PWM2-PCH" : "PWM1-PCH PWM2-CPU";
  snprintf(result, len, "%s", sel);
}


x86 assembly (clang, -O0):
<hsw_debug_blc_misc_ctl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x14(%rbp),%edx
and    $0x1,%edx
lea    0xedc(%rip),%rax
lea    0xec3(%rip),%rcx
cmp    $0x0,%edx
cmovne %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rcx
lea    0xeca(%rip),%rdx
call   1030 <snprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsw_debug_blc_misc_ctl>:
test   $0x1,%cl
lea    0xef8(%rip),%rax
lea    0xedf(%rip),%rcx
cmove  %rax,%rcx
lea    0xef8(%rip),%rdx
jmp    1030 <snprintf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"PWM1-CPU PWM2-PCH\00"
@.str.1 = [18 x i8] c"PWM1-PCH PWM2-CPU\00"
@.str.2 = [3 x i8] c"%s\00"
define void @hsw_debug_blc_misc_ctl(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %9
%13 = and i32 %12, 1
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i64
%16 = select i1 %14, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0)
store i8* %16, i8** %11
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i8*, i8** %11
%20 = call i32 @snprintf(i8* %17, i32 %18, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"PWM1-CPU PWM2-PCH\00"
@.str.1 = [18 x i8] c"PWM1-PCH PWM2-CPU\00"
@.str.2 = [3 x i8] c"%s\00"
define void @hsw_debug_blc_misc_ctl(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = and i32 %3, 1
%7 = icmp eq i32 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0)
%9 = tail call i32 @snprintf(i8* %0, i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
ret void
}
int sys_getblksize(void) { return (64); }


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

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

LLVM IR (-O0):
define i32 @sys_getblksize() {
ret i32 64
}

LLVM IR (-O2):
define i32 @sys_getblksize() {
ret i32 64
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() { printf("Hello, world\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello, world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s", "Code für linux-Rechner");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [24 x i8] c"Code f\C3\BCr linux-Rechner\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [24 x i8] c"Code f\C3\BCr linux-Rechner\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
float fabs(float f) {
  if (f < 0)
    return -f;
  else
    return f;
}


x86 assembly (clang, -O0):
<fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <fabs+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <fabs+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Variables and functions */
int SysTickValueGet();
void Delay(unsigned long ulSeconds) {
  while (ulSeconds--) {
    while (SysTickValueGet() > 1000) {
    }
    while (SysTickValueGet() < 1000) {
    }
  }
}


x86 assembly (clang, -O0):
<Delay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x8(%rbp)
cmp    $0x0,%rax
je     1172 <Delay+0x62>
jmp    113a <Delay+0x2a>
mov    $0x0,%al
call   1030 <SysTickValueGet@plt>
cmp    $0x3e8,%eax
jle    1151 <Delay+0x41>
jmp    113a <Delay+0x2a>
jmp    1156 <Delay+0x46>
mov    $0x0,%al
call   1030 <SysTickValueGet@plt>
cmp    $0x3e8,%eax
jge    116d <Delay+0x5d>
jmp    1156 <Delay+0x46>
jmp    111c <Delay+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Delay>:
push   %rbx
test   %rdi,%rdi
je     1144 <Delay+0x34>
mov    %rdi,%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <SysTickValueGet@plt>
cmp    $0x3e8,%eax
jg     1120 <Delay+0x10>
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <SysTickValueGet@plt>
cmp    $0x3e8,%eax
jl     1130 <Delay+0x20>
add    $0xffffffffffffffff,%rbx
jne    1120 <Delay+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define void @Delay(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
br label %3
3: ; preds = %17, %1
%4 = load i64, i64* %2
%5 = add i64 %4, -1
store i64 %5, i64* %2
%6 = icmp ne i64 %4, 0
br i1 %6, label %7, label %18
7: ; preds = %3
br label %8
8: ; preds = %11, %7
%9 = call i32 (...) @SysTickValueGet()
%10 = icmp sgt i32 %9, 1000
br i1 %10, label %11, label %12
11: ; preds = %8
br label %8
12: ; preds = %8
br label %13
13: ; preds = %16, %12
%14 = call i32 (...) @SysTickValueGet()
%15 = icmp slt i32 %14, 1000
br i1 %15, label %16, label %17
16: ; preds = %13
br label %13
17: ; preds = %13
br label %3
18: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @Delay(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %14, label %6
3: ; preds = %11
%4 = add i64 %7, -1
%5 = icmp eq i64 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %1, %3
%7 = phi i64 [ %4, %3 ], [ %0, %1 ]
br label %8
8: ; preds = %6, %8
%9 = tail call i32 (...) @SysTickValueGet()
%10 = icmp sgt i32 %9, 1000
br i1 %10, label %8, label %11
11: ; preds = %8, %11
%12 = tail call i32 (...) @SysTickValueGet()
%13 = icmp slt i32 %12, 1000
br i1 %13, label %11, label %3
14: ; preds = %3, %1
ret void
}
extern void set_fs(unsigned long val) {
  __asm__("mov %0,%%fs" ::"a"((unsigned short)val));
}


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

x86 assembly (clang, -O2):
<set_fs>:
mov    %rdi,%rax
mov    %eax,%fs
ret

LLVM IR (-O0):
define void @set_fs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i16
ret void
}

LLVM IR (-O2):
define void @set_fs(i64 %0) {
%2 = trunc i64 %0 to i16
tail call void asm sideeffect "mov $0,%fs", "{ax},~{dirflag},~{fpsr},~{flags}"(i16 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ my_putnbr2(int);
int /*<<< orphan*/ my_putstr2(char *);
int open(char *, int);
int x_open(char *path, int flags) {
  static int numberofopen;
  int fd;
  fd = open(path, flags);
  if (fd == -1) {
    my_putstr2("\nError : Open number ");
    my_putnbr2(numberofopen + 1);
    my_putstr2(" have failled\n\n");
    exit(-1);
  }
  return (fd);
}


x86 assembly (clang, -O0):
<x_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <open@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0xffffffff,-0x10(%rbp)
jne    1198 <x_open+0x58>
lea    0xe91(%rip),%rdi
call   1040 <my_putstr2@plt>
mov    0x2eca(%rip),%edi
add    $0x1,%edi
call   1030 <my_putnbr2@plt>
lea    0xe8d(%rip),%rdi
call   1040 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_open>:
push   %rax
call   1050 <open@plt>
cmp    $0xffffffff,%eax
je     114d <x_open+0xd>
pop    %rcx
ret
lea    0xeac(%rip),%rdi
call   1040 <my_putstr2@plt>
mov    $0x1,%edi
call   1030 <my_putnbr2@plt>
lea    0xeac(%rip),%rdi
call   1040 <my_putstr2@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@x_open.numberofopen = internal global i32 0
@.str = [22 x i8] c"\0AError : Open number \00"
@.str.1 = [16 x i8] c" have failled\0A\0A\00"
define i32 @x_open(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @open(i8* %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %18
11: ; preds = %2
%12 = call i32 @my_putstr2(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @x_open.numberofopen
%14 = add nsw i32 %13, 1
%15 = call i32 @my_putnbr2(i32 %14)
%16 = call i32 @my_putstr2(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @exit(i32 -1)
unreachable
18: ; preds = %2
%19 = load i32, i32* %5
ret i32 %19
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0AError : Open number \00"
@.str.1 = [16 x i8] c" have failled\0A\0A\00"
define i32 @x_open(i8* nocapture %0, i32 %1) {
%3 = tail call i32 @open(i8* %0, i32 %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @my_putnbr2(i32 1)
%8 = tail call i32 @my_putstr2(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
ret i32 %3
}
/* Variables and functions */
char *GetToken(int /*<<< orphan*/, char **);
int small_atoi(char *);
char *get_int_token(int *Int, char **last) {
  char *token = GetToken(0, last);
  if (token)
    *Int = small_atoi(token);
  return token;
}


x86 assembly (clang, -O0):
<get_int_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
xor    %edi,%edi
call   1030 <GetToken@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115b <get_int_token+0x3b>
mov    -0x18(%rbp),%rdi
call   1040 <small_atoi@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_int_token>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
call   1030 <GetToken@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1141 <get_int_token+0x21>
mov    %rbx,%rdi
call   1040 <small_atoi@plt>
mov    %eax,(%r14)
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @get_int_token(i32* nocapture writeonly %0, i8** %1) {
%3 = tail call i8* @GetToken(i32 0, i8** %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @small_atoi(i8* %3)
store i32 %6, i32* %0
br label %7
7: ; preds = %5, %2
ret i8* %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xdestroywindow;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xdestroywindow_type(void *_p, int _v) {
  ((XEvent *)_p)->xdestroywindow.type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xdestroywindow_type>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xdestroywindow_type(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xdestroywindow_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
int sciprintf(char *fmt, ...) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sciprintf(i8* nocapture readnone %0, ...) {
ret i32 0
}
float celsius_to_fahr(float c) { return (9.0 / 5.0) * c + 32; }


x86 assembly (clang, -O0):
<celsius_to_fahr>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius_to_fahr>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @celsius_to_fahr(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call double @llvm.fmuladd.f64(double 1.800000e+00, double %4, double 3.200000e+01)
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @celsius_to_fahr(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 1.800000e+00, double 3.200000e+01)
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
float exp(float);
float log(float);
float fpow(float x, float power) {
  float thing;
  thing = exp(power * log(x));
  return (thing);
}


x86 assembly (clang, -O0):
<fpow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movss  -0x10(%rbp),%xmm0
mulss  %xmm1,%xmm0
call   1030 <exp@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fpow>:
push   %rax
movss  %xmm1,0x4(%rsp)
call   1040 <log@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <exp@plt>

LLVM IR (-O0):
define float @fpow(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %4
%7 = load float, float* %3
%8 = call float @log(float %7)
%9 = fmul float %6, %8
%10 = call float @exp(float %9)
store float %10, float* %5
%11 = load float, float* %5
ret float %11
}

LLVM IR (-O2):
define float @fpow(float %0, float %1) {
%3 = tail call float @log(float %0)
%4 = fmul float %3, %1
%5 = tail call float @exp(float %4)
ret float %5
}
void RTTcpGetPeerAddress(void) {}


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

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

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

LLVM IR (-O2):
define void @RTTcpGetPeerAddress() {
ret void
}
void SHAREMIND_MAP_KEY_FREE_short(short *const dest) { (void)dest; }


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

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

LLVM IR (-O0):
define void @SHAREMIND_MAP_KEY_FREE_short(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
ret void
}

LLVM IR (-O2):
define void @SHAREMIND_MAP_KEY_FREE_short(i16* nocapture %0) {
ret void
}
/* Variables and functions */
int *malloc(int);
int *intblk() {
  int *someint = malloc(sizeof(int) * 2);
  return malloc(sizeof(int));
}


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

x86 assembly (clang, -O2):
<intblk>:
push   %rax
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    $0x4,%edi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i32* @intblk() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 8)
store i32* %2, i32** %1
%3 = call i32* @malloc(i32 4)
ret i32* %3
}

LLVM IR (-O2):
define noalias i32* @intblk() {
%1 = tail call i32* @malloc(i32 8)
%2 = tail call i32* @malloc(i32 4)
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ pushbit(int);
void pushcontrol3b(int cc) {
  pushbit(cc % 2);
  cc >>= 1;
  pushbit(cc % 2);
  cc >>= 1;
  pushbit(cc);
}


x86 assembly (clang, -O0):
<pushcontrol3b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <pushbit@plt>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <pushbit@plt>
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pushbit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushcontrol3b>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%r14d
mov    %edi,%ebx
shr    $0x1f,%ebx
lea    (%r14,%rbx,1),%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
call   1030 <pushbit@plt>
mov    %r14d,%edi
sar    %edi
add    %edi,%ebx
and    $0xfffffffe,%ebx
sub    %ebx,%edi
call   1030 <pushbit@plt>
sar    $0x2,%r14d
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <pushbit@plt>

LLVM IR (-O0):
define void @pushcontrol3b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 2
%5 = call i32 @pushbit(i32 %4)
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = srem i32 %8, 2
%10 = call i32 @pushbit(i32 %9)
%11 = load i32, i32* %2
%12 = ashr i32 %11, 1
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = call i32 @pushbit(i32 %13)
ret void
}

LLVM IR (-O2):
define void @pushcontrol3b(i32 %0) {
%2 = srem i32 %0, 2
%3 = tail call i32 @pushbit(i32 %2)
%4 = ashr i32 %0, 1
%5 = srem i32 %4, 2
%6 = tail call i32 @pushbit(i32 %5)
%7 = ashr i32 %0, 2
%8 = tail call i32 @pushbit(i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cat2();
void rot62_sem() { cat2(); }


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

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

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

LLVM IR (-O2):
define void @rot62_sem() {
%1 = tail call i32 (...) @cat2()
ret void
}
char *GdbmiBasename(const char *name) {
  const char *base;
  for (base = name; *name; name++) {
    if (*name == '/' || *name == '\\') {
      base = name + 1;
    }
  }
  return (char *)base;
}


x86 assembly (clang, -O0):
<GdbmiBasename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115f <GdbmiBasename+0x5f>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     113d <GdbmiBasename+0x3d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5c,%eax
jne    1149 <GdbmiBasename+0x49>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114e <GdbmiBasename+0x4e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <GdbmiBasename+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GdbmiBasename>:
mov    %rdi,%rax
lea    0x1(%rdi),%rcx
jmp    1117 <GdbmiBasename+0x17>
nopl   0x0(%rax)
mov    %rcx,%rax
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2f,%dl
je     1110 <GdbmiBasename+0x10>
cmp    $0x5c,%dl
je     1110 <GdbmiBasename+0x10>
test   %dl,%dl
jne    1113 <GdbmiBasename+0x13>
ret

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

LLVM IR (-O2):
define i8* @GdbmiBasename(i8* %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %10, %8 ]
%4 = phi i8* [ %0, %1 ], [ %9, %8 ]
%5 = load i8, i8* %3
switch i8 %5, label %8 [
i8 0, label %11
i8 47, label %6
i8 92, label %6
]
6: ; preds = %2, %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %4, %2 ]
%10 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
11: ; preds = %2
ret i8* %4
}
int NOR(int a, int b) {
  int output;
  output = ~(a | b);
  return output;
}


x86 assembly (clang, -O0):
<NOR>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
or     -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<NOR>:
mov    %edi,%eax
or     %esi,%eax
not    %eax
ret

LLVM IR (-O0):
define i32 @NOR(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 = load i32, i32* %4
%8 = or i32 %6, %7
%9 = xor i32 %8, -1
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @NOR(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = xor i32 %3, -1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void logStuff(const char *action) { printf("%s\n", action); }


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

x86 assembly (clang, -O2):
<logStuff>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @logStuff(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIOPinWrite(int, int, int);
void LedSetGreen() {
  GPIOPinWrite(0x40025000, 0x00000008, 0x00000008);
  GPIOPinWrite(0x40025000, 0x00000002 | 0x00000004, 0);
}


x86 assembly (clang, -O0):
<LedSetGreen>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40025000,%edi
mov    $0x8,%edx
mov    %edx,%esi
call   1030 <GPIOPinWrite@plt>
mov    $0x40025000,%edi
mov    $0x6,%esi
xor    %edx,%edx
call   1030 <GPIOPinWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LedSetGreen>:
push   %rax
mov    $0x40025000,%edi
mov    $0x8,%esi
mov    $0x8,%edx
call   1030 <GPIOPinWrite@plt>
mov    $0x40025000,%edi
mov    $0x6,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <GPIOPinWrite@plt>

LLVM IR (-O0):
define void @LedSetGreen() {
%1 = call i32 @GPIOPinWrite(i32 1073893376, i32 8, i32 8)
%2 = call i32 @GPIOPinWrite(i32 1073893376, i32 6, i32 0)
ret void
}

LLVM IR (-O2):
define void @LedSetGreen() {
%1 = tail call i32 @GPIOPinWrite(i32 1073893376, i32 8, i32 8)
%2 = tail call i32 @GPIOPinWrite(i32 1073893376, i32 6, i32 0)
ret void
}
/* Variables and functions */
scalar_t__ GLeeInit();
int /*<<< orphan*/ pglUnlockArraysEXT();
void _Lazy_glUnlockArraysEXT(void) {
  if (GLeeInit())
    pglUnlockArraysEXT();
}


x86 assembly (clang, -O0):
<_Lazy_glUnlockArraysEXT>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <GLeeInit@plt>
cmp    $0x0,%rax
je     113c <_Lazy_glUnlockArraysEXT+0x1c>
mov    $0x0,%al
call   1040 <pglUnlockArraysEXT@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Lazy_glUnlockArraysEXT>:
push   %rax
xor    %eax,%eax
call   1030 <GLeeInit@plt>
test   %rax,%rax
je     1135 <_Lazy_glUnlockArraysEXT+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <pglUnlockArraysEXT@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @_Lazy_glUnlockArraysEXT() {
%1 = call i64 (...) @GLeeInit()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @pglUnlockArraysEXT()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @_Lazy_glUnlockArraysEXT() {
%1 = tail call i64 (...) @GLeeInit()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @pglUnlockArraysEXT()
br label %5
5: ; preds = %3, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ coda();
int /*<<< orphan*/ decode_table(char *);
int /*<<< orphan*/ encode_table(char *);
int /*<<< orphan*/ preamble();
int /*<<< orphan*/ state_table(char *);
int main(int argc, char *argv[]) {
  preamble();
  decode_table("uri_decode_tbl");
  encode_table("uri_encode_tbl");
  state_table("uri_state_tbl");
  coda();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1060 <preamble@plt>
lea    0xe8c(%rip),%rdi
call   1050 <decode_table@plt>
lea    0xe8f(%rip),%rdi
call   1070 <encode_table@plt>
lea    0xe92(%rip),%rdi
call   1040 <state_table@plt>
mov    $0x0,%al
call   1030 <coda@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1060 <preamble@plt>
lea    0xea1(%rip),%rdi
call   1050 <decode_table@plt>
lea    0xea4(%rip),%rdi
call   1070 <encode_table@plt>
lea    0xea7(%rip),%rdi
call   1040 <state_table@plt>
xor    %eax,%eax
call   1030 <coda@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"uri_decode_tbl\00"
@.str.1 = [15 x i8] c"uri_encode_tbl\00"
@.str.2 = [14 x i8] c"uri_state_tbl\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @preamble()
%7 = call i32 @decode_table(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @encode_table(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @state_table(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @coda()
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"uri_decode_tbl\00"
@.str.1 = [15 x i8] c"uri_encode_tbl\00"
@.str.2 = [14 x i8] c"uri_state_tbl\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @preamble()
%4 = tail call i32 @decode_table(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @encode_table(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @state_table(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (...) @coda()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
int BNC_9() {
  int ii, stat = 99;
  char com1, data;
  BNCIO(9);
  return (stat);
}


x86 assembly (clang, -O0):
<BNC_9>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x63,-0x8(%rbp)
mov    $0x9,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNC_9>:
push   %rax
mov    $0x9,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @BNC_9() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca i8
store i32 99, i32* %2
%5 = call i32 @BNCIO(i32 9)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @BNC_9() {
%1 = tail call i32 @BNCIO(i32 9)
ret i32 99
}