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

/* Variables and functions */
int /*<<< orphan*/ json_object_new_double(double);
int /*<<< orphan*/ json_object_path_set(struct json_object *, char const *,
                                        int /*<<< orphan*/);
void json_object_path_set_double(struct json_object *jso, const char *path,
                                 double d) {
  json_object_path_set(jso, path, json_object_new_double(d));
}


x86 assembly (clang, -O0):
<json_object_path_set_double>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <json_object_new_double@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
call   1030 <json_object_path_set@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_object_path_set_double>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <json_object_new_double@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <json_object_path_set@plt>

LLVM IR (-O0):
%struct.json_object = type { i32 }
define void @json_object_path_set_double(%struct.json_object* %0, i8* %1, double %2) {
%4 = alloca %struct.json_object*
%5 = alloca i8*
%6 = alloca double
store %struct.json_object* %0, %struct.json_object** %4
store i8* %1, i8** %5
store double %2, double* %6
%7 = load %struct.json_object*, %struct.json_object** %4
%8 = load i8*, i8** %5
%9 = load double, double* %6
%10 = call i32 @json_object_new_double(double %9)
%11 = call i32 @json_object_path_set(%struct.json_object* %7, i8* %8, i32 %10)
ret void
}

LLVM IR (-O2):
%struct.json_object = type { i32 }
define void @json_object_path_set_double(%struct.json_object* %0, i8* %1, double %2) {
%4 = tail call i32 @json_object_new_double(double %2)
%5 = tail call i32 @json_object_path_set(%struct.json_object* %0, i8* %1, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit_program();
void sigint_handler(int signum) {
  {};
  exit_program();
  {};
}


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

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

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

LLVM IR (-O2):
define void @sigint_handler(i32 %0) {
%2 = tail call i32 (...) @exit_program()
ret void
}
/* Type definitions */
struct shmInfos {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ perror(char *);
struct shmInfos *shmat(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
struct shmInfos *shmAnbinden(int shmid) {
  struct shmInfos *shm_ptr = shmat(shmid, NULL, 0);
  if (shm_ptr == (struct shmInfos *)-1) {
    perror("Fehler beim Binden des SHM an einen Prozess");
  }
  return shm_ptr;
}


x86 assembly (clang, -O0):
<shmAnbinden>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
mov    %rax,-0x10(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0x10(%rbp)
jne    115a <shmAnbinden+0x3a>
lea    0xeab(%rip),%rdi
call   1030 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shmAnbinden>:
push   %rbx
xor    %esi,%esi
xor    %edx,%edx
call   1040 <shmat@plt>
mov    %rax,%rbx
cmp    $0xffffffffffffffff,%rax
je     1138 <shmAnbinden+0x18>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec1(%rip),%rdi
call   1030 <perror@plt>
jmp    1133 <shmAnbinden+0x13>

LLVM IR (-O0):
%struct.shmInfos = type { i32 }
@.str = [44 x i8] c"Fehler beim Binden des SHM an einen Prozess\00"
define %struct.shmInfos* @shmAnbinden(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.shmInfos*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call %struct.shmInfos* @shmat(i32 %4, i32* null, i32 0)
store %struct.shmInfos* %5, %struct.shmInfos** %3
%6 = load %struct.shmInfos*, %struct.shmInfos** %3
%7 = icmp eq %struct.shmInfos* %6, inttoptr (i64 -1 to %struct.shmInfos*)
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load %struct.shmInfos*, %struct.shmInfos** %3
ret %struct.shmInfos* %11
}

LLVM IR (-O2):
%struct.shmInfos = type { i32 }
@.str = [44 x i8] c"Fehler beim Binden des SHM an einen Prozess\00"
define %struct.shmInfos* @shmAnbinden(i32 %0) {
%2 = tail call %struct.shmInfos* @shmat(i32 %0, i32* null, i32 0)
%3 = icmp eq %struct.shmInfos* %2, inttoptr (i64 -1 to %struct.shmInfos*)
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret %struct.shmInfos* %2
}
/* Variables and functions */
int lookup_get_paths(char *, int const);
__attribute__((visibility("default"))) int
louis_get_paths(char *paths, const int paths_max) {
  return lookup_get_paths(paths, paths_max);
}


x86 assembly (clang, -O0):
<louis_get_paths>:
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   1030 <lookup_get_paths@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<louis_get_paths>:
jmp    1030 <lookup_get_paths@plt>

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

LLVM IR (-O2):
define i32 @louis_get_paths(i8* %0, i32 %1) {
%3 = tail call i32 @lookup_get_paths(i8* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, char *);
void Jump_If_Greater(char *label) { Inst_Printf("bgtz", "$12,%s", label); }


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

x86 assembly (clang, -O2):
<Jump_If_Greater>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee4(%rip),%rsi
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"bgtz\00"
@.str.1 = [7 x i8] c"$12,%s\00"
define void @Jump_If_Greater(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"bgtz\00"
@.str.1 = [7 x i8] c"$12,%s\00"
define void @Jump_If_Greater(i8* %0) {
%2 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
void av_display_matrix_flip() {}


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

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

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

LLVM IR (-O2):
define void @av_display_matrix_flip() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double te_interp(char const *, int *);
int eval(const char *str) {
  int err = 0;
  double r = te_interp(str, &err);
  if (err != 0) {
    printf("Error at position %i\n", err);
    return -1;
  } else {
    printf("%g\n", r);
    return 0;
  }
}


x86 assembly (clang, -O0):
<eval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <te_interp@plt>
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     116c <eval+0x4c>
cvtsi2sdl -0x14(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1184 <eval+0x64>
movsd  -0x20(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eval>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <te_interp@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
je     1155 <eval+0x35>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xeb7(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
lea    0xeba(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Error at position %i\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @eval(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca double
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call double @te_interp(i8* %6, i32* %4)
store double %7, double* %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to double
%13 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %12)
store i32 -1, i32* %2
br label %17
14: ; preds = %1
%15 = load double, double* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %15)
store i32 0, i32* %2
br label %17
17: ; preds = %14, %10
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@.str = [22 x i8] c"Error at position %i\0A\00"
@.str.1 = [4 x i8] c"%g\0A\00"
define i32 @eval(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call double @te_interp(i8* %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = sitofp i32 %5 to double
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %8)
br label %12
10: ; preds = %1
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double %4)
br label %12
12: ; preds = %10, %7
%13 = phi i32 [ -1, %7 ], [ 0, %10 ]
ret i32 %13
}
void INT_Excep_CAN2_TXM2(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_CAN2_TXM2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char const *argv[]) {
  printf("Hello World\n");
  printf("Hello World\n");
  printf("추가된 작업\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@.str.1 = [18 x i8] c"\EC\B6\94\EA\B0\80\EB\90\9C \EC\9E\91\EC\97\85\0A\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 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str.2 = [12 x i8] c"Hello World\00"
@str.3 = [17 x i8] c"\EC\B6\94\EA\B0\80\EB\90\9C \EC\9E\91\EC\97\85\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}
void set_h1(unsigned char *h1, unsigned char val) {
  (*h1) |= ((val << 4) & 0xf0);
}


x86 assembly (clang, -O0):
<set_h1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%edx
shl    $0x4,%edx
and    $0xf0,%edx
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
or     %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_h1>:
shl    $0x4,%sil
or     %sil,(%rdi)
ret

LLVM IR (-O0):
define void @set_h1(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 4
%8 = and i32 %7, 240
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = or i32 %11, %8
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
ret void
}

LLVM IR (-O2):
define void @set_h1(i8* nocapture %0, i8 zeroext %1) {
%3 = shl i8 %1, 4
%4 = load i8, i8* %0
%5 = or i8 %4, %3
store i8 %5, i8* %0
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ updateLights();
int /*<<< orphan*/ updateTask();
void Timer1A_Handler(void) {
  (*((volatile uint32_t *)0x40031024)) = 0x01;
  updateTask();
  updateLights();
}


x86 assembly (clang, -O0):
<Timer1A_Handler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40031024,%eax
movl   $0x1,(%rax)
mov    $0x0,%al
call   1030 <updateTask@plt>
mov    $0x0,%al
call   1040 <updateLights@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Timer1A_Handler>:
push   %rax
movl   $0x1,0x40031024
xor    %eax,%eax
call   1030 <updateTask@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <updateLights@plt>

LLVM IR (-O0):
define void @Timer1A_Handler() {
store volatile i32 1, i32* inttoptr (i64 1073942564 to i32*)
%1 = call i32 (...) @updateTask()
%2 = call i32 (...) @updateLights()
ret void
}

LLVM IR (-O2):
define void @Timer1A_Handler() {
store volatile i32 1, i32* inttoptr (i64 1073942564 to i32*)
%1 = tail call i32 (...) @updateTask()
%2 = tail call i32 (...) @updateLights()
ret void
}
int checkdigit(char c) {
  if ((c >= '0') && (c <= '9'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<checkdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1130 <checkdigit+0x30>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1130 <checkdigit+0x30>
movl   $0x1,-0x4(%rbp)
jmp    1137 <checkdigit+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @checkdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 1, i32* %2
br label %13
12: ; preds = %7, %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @checkdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void clear_screen() {
  printf("\033[2J");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<clear_screen>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_screen>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define void @clear_screen() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[2J\00"
@stdout = global i32 0
define void @clear_screen() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
double dmin(double a, double b) { return ((a) < (b)) ? (a) : (b); }


x86 assembly (clang, -O0):
<dmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <dmin+0x31>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <dmin+0x3b>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dmin>:
minsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dmin(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load double, double* %3
br label %12
10: ; preds = %2
%11 = load double, double* %4
br label %12
12: ; preds = %10, %8
%13 = phi double [ %9, %8 ], [ %11, %10 ]
ret double %13
}

LLVM IR (-O2):
define double @dmin(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %0, double %1
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ db(int);
void cwde() { db(0x98); }


x86 assembly (clang, -O0):
<cwde>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98,%edi
call   1030 <db@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cwde>:
mov    $0x98,%edi
jmp    1030 <db@plt>

LLVM IR (-O0):
define void @cwde() {
%1 = call i32 @db(i32 152)
ret void
}

LLVM IR (-O2):
define void @cwde() {
%1 = tail call i32 @db(i32 152)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ fromRep16(int);
uint16_t makeQNaN16() { return fromRep16(0x7e00U); }


x86 assembly (clang, -O0):
<makeQNaN16>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7e00,%edi
call   1030 <fromRep16@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeQNaN16>:
mov    $0x7e00,%edi
jmp    1030 <fromRep16@plt>

LLVM IR (-O0):
define i32 @makeQNaN16() {
%1 = call i32 @fromRep16(i32 32256)
ret i32 %1
}

LLVM IR (-O2):
define i32 @makeQNaN16() {
%1 = tail call i32 @fromRep16(i32 32256)
ret i32 %1
}
/* Variables and functions */
void *mt_register(size_t, char *, char *, int);
void *mt_malloc(size_t size, char *callfunc, char *file, int line) {
  return mt_register(size, callfunc, file, line);
}


x86 assembly (clang, -O0):
<mt_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <mt_register@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mt_malloc>:
jmp    1030 <mt_register@plt>

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

LLVM IR (-O2):
define i8* @mt_malloc(i64 %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i8* @mt_register(i64 %0, i8* %1, i8* %2, i32 %3)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("mod_koma is not enabled.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [25 x i8] c"mod_koma is not enabled.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void __rtinfo_internal_diep(char *str) {
  perror(str);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<__rtinfo_internal_diep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<__rtinfo_internal_diep>:
push   %rax
call   1030 <perror@plt>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @__rtinfo_internal_diep(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @perror(i8* %3)
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @__rtinfo_internal_diep(i8* nocapture %0) {
%2 = tail call i32 @perror(i8* %0)
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hmac_md5_vector(int /*<<< orphan*/ *, size_t, int,
                                   int /*<<< orphan*/ **, size_t *,
                                   int /*<<< orphan*/ *);
void hmac_md5(uint8_t *key, size_t key_len, uint8_t *data, size_t data_len,
              uint8_t *mac) {
  hmac_md5_vector(key, key_len, 1, &data, &data_len, mac);
}


x86 assembly (clang, -O0):
<hmac_md5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x28(%rbp),%r9
mov    $0x1,%edx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1030 <hmac_md5_vector@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac_md5>:
sub    $0x18,%rsp
mov    %r8,%r9
mov    %rdx,0x10(%rsp)
mov    %rcx,0x8(%rsp)
lea    0x10(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    $0x1,%edx
call   1030 <hmac_md5_vector@plt>
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define void @hmac_md5(i32* %0, i64 %1, i32* %2, i64 %3, i32* %4) {
%6 = alloca i32*
%7 = alloca i64
store i32* %2, i32** %6
store i64 %3, i64* %7
%8 = call i32 @hmac_md5_vector(i32* %0, i64 %1, i32 1, i32** %6, i64* %7, i32* %4)
ret void
}
/* Variables and functions */
int __NR_sendfile;
int /*<<< orphan*/ sendfile(int /*<<< orphan*/, int, int /*<<< orphan*/,
                            int /*<<< orphan*/);
void main(void) {
  int x;
  x = __NR_sendfile;
  sendfile(0, 1, 0, 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
xor    %ecx,%ecx
mov    $0x1,%esi
mov    %ecx,%edi
mov    %ecx,%edx
call   1030 <sendfile@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__NR_sendfile = global i32 0
define void @main() {
%1 = alloca i32
%2 = load i32, i32* @__NR_sendfile
store i32 %2, i32* %1
%3 = call i32 @sendfile(i32 0, i32 1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
@__NR_sendfile = global i32 0
define void @main() {
%1 = tail call i32 @sendfile(i32 0, i32 1, i32 0, i32 0)
ret void
}
/* Type definitions */
struct rng {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clock_rdtsc();
int /*<<< orphan*/ rng_seed_with(struct rng *, int /*<<< orphan*/);
void rng_seed(struct rng *rng) { rng_seed_with(rng, clock_rdtsc()); }


x86 assembly (clang, -O0):
<rng_seed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <clock_rdtsc@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <rng_seed_with@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rng_seed>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock_rdtsc@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <rng_seed_with@plt>

LLVM IR (-O0):
%struct.rng = type { i32 }
define void @rng_seed(%struct.rng* %0) {
%2 = alloca %struct.rng*
store %struct.rng* %0, %struct.rng** %2
%3 = load %struct.rng*, %struct.rng** %2
%4 = call i32 (...) @clock_rdtsc()
%5 = call i32 @rng_seed_with(%struct.rng* %3, i32 %4)
ret void
}

LLVM IR (-O2):
%struct.rng = type { i32 }
define void @rng_seed(%struct.rng* %0) {
%2 = tail call i32 (...) @clock_rdtsc()
%3 = tail call i32 @rng_seed_with(%struct.rng* %0, i32 %2)
ret void
}
double map(double x, double in_min, double in_max, double out_min,
           double out_max) {
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}


x86 assembly (clang, -O0):
<map>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<map>:
subsd  %xmm1,%xmm0
subsd  %xmm3,%xmm4
mulsd  %xmm4,%xmm0
subsd  %xmm1,%xmm2
divsd  %xmm2,%xmm0
addsd  %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @map(double %0, double %1, double %2, double %3, double %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store double %3, double* %9
store double %4, double* %10
%11 = load double, double* %6
%12 = load double, double* %7
%13 = fsub double %11, %12
%14 = load double, double* %10
%15 = load double, double* %9
%16 = fsub double %14, %15
%17 = fmul double %13, %16
%18 = load double, double* %8
%19 = load double, double* %7
%20 = fsub double %18, %19
%21 = fdiv double %17, %20
%22 = load double, double* %9
%23 = fadd double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @map(double %0, double %1, double %2, double %3, double %4) {
%6 = fsub double %0, %1
%7 = fsub double %4, %3
%8 = fmul double %6, %7
%9 = fsub double %2, %1
%10 = fdiv double %8, %9
%11 = fadd double %10, %3
ret double %11
}
/* Variables and functions */
bool nrf52_errata_156(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf52_errata_156() {
ret i32 0
}
void testing() {}


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

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

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

LLVM IR (-O2):
define void @testing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fork();
main() {
  while (1)
    fork();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <fork@plt>
jmp    111f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <fork@plt>
jmp    1120 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 (...) @fork()
br label %2
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @fork()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
int base64_is_well_formed_imp(char *, size_t);
bool base64_is_well_formed_up_to(char *data, size_t length) {
  assert(data);
  return base64_is_well_formed_imp(data, length);
}


x86 assembly (clang, -O0):
<base64_is_well_formed_up_to>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <base64_is_well_formed_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_is_well_formed_up_to>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <base64_is_well_formed_imp@plt>

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

LLVM IR (-O2):
define i32 @base64_is_well_formed_up_to(i8* %0, i64 %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @base64_is_well_formed_imp(i8* %0, i64 %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int *get_ld();
int /*<<< orphan*/ set_ld(int);
int /*<<< orphan*/ test_ld(int);
int main() {
  int *p;
  p = get_ld();
  set_ld(4);
  if (*p != 4 || !test_ld(4))
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <get_ld@plt>
mov    %rax,-0x10(%rbp)
mov    $0x4,%edi
call   1060 <set_ld@plt>
mov    -0x10(%rbp),%rax
cmpl   $0x4,(%rax)
jne    1184 <main+0x44>
mov    $0x4,%edi
call   1040 <test_ld@plt>
cmp    $0x0,%eax
jne    118b <main+0x4b>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <get_ld@plt>
mov    %rax,%rbx
mov    $0x4,%edi
call   1060 <set_ld@plt>
cmpl   $0x4,(%rbx)
jne    116c <main+0x2c>
mov    $0x4,%edi
call   1040 <test_ld@plt>
test   %eax,%eax
je     116c <main+0x2c>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* (...) @get_ld()
%2 = tail call i32 @set_ld(i32 4)
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, 4
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = tail call i32 @test_ld(i32 4)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5, %0
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
ret i32 0
}
OP(fd, ed) { op_ed(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @op_ed()
ret i32 undef
}
void ARGBAddRow_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ARGBAddRow_Any_SSE2() {
ret void
}
/* Type definitions */
struct sk_buff_head {
  int dummy;
};
typedef void sk_buff;

/* Variables and functions */
void *__skb_dequeue(struct sk_buff_head *);
int /*<<< orphan*/ kfree_skb(void *);
void __skb_queue_purge(struct sk_buff_head *list) {
  struct sk_buff *skb;
  while ((skb = __skb_dequeue(list)) != ((void *)0))
    kfree_skb(skb);
}


x86 assembly (clang, -O0):
<__skb_queue_purge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <__skb_dequeue@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     1151 <__skb_queue_purge+0x31>
mov    -0x10(%rbp),%rdi
call   1030 <kfree_skb@plt>
jmp    112c <__skb_queue_purge+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__skb_queue_purge>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <__skb_dequeue@plt>
test   %rax,%rax
je     1147 <__skb_queue_purge+0x27>
mov    %rax,%rdi
call   1030 <kfree_skb@plt>
mov    %rbx,%rdi
jmp    1130 <__skb_queue_purge+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.sk_buff_head = type { i32 }
%struct.sk_buff = type opaque
define void @__skb_queue_purge(%struct.sk_buff_head* %0) {
%2 = alloca %struct.sk_buff_head*
%3 = alloca %struct.sk_buff*
store %struct.sk_buff_head* %0, %struct.sk_buff_head** %2
br label %4
4: ; preds = %9, %1
%5 = load %struct.sk_buff_head*, %struct.sk_buff_head** %2
%6 = call i8* @__skb_dequeue(%struct.sk_buff_head* %5)
%7 = bitcast i8* %6 to %struct.sk_buff*
store %struct.sk_buff* %7, %struct.sk_buff** %3
%8 = icmp ne %struct.sk_buff* %7, null
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load %struct.sk_buff*, %struct.sk_buff** %3
%11 = bitcast %struct.sk_buff* %10 to i8*
%12 = call i32 @kfree_skb(i8* %11)
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.sk_buff_head = type { i32 }
define void @__skb_queue_purge(%struct.sk_buff_head* %0) {
%2 = tail call i8* @__skb_dequeue(%struct.sk_buff_head* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %7, %4 ], [ %2, %1 ]
%6 = tail call i32 @kfree_skb(i8* %5)
%7 = tail call i8* @__skb_dequeue(%struct.sk_buff_head* %0)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int, int);
void show_elements_from_array(int *array, char *optnional_message) {
  int i = 0;
  for (; i < 30; ++i) {
    printf("%s at[%i] is: %i\n", optnional_message, i, array[i]);
  }
}


x86 assembly (clang, -O0):
<show_elements_from_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x1e,-0x14(%rbp)
jge    115d <show_elements_from_array+0x4d>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <show_elements_from_array+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_elements_from_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
lea    0xed9(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%ecx
mov    %r12,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    $0x1e,%rbx
jne    1130 <show_elements_from_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"%s at[%i] is: %i\0A\00"
define void @show_elements_from_array(i32* nocapture %0, i8* %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = trunc i64 %4 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %7, i32 %6)
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 30
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
char MACHINE_ENDIAN_F(void) {
  uint32_t i = 0x01234567;
  return ((*((uint8_t *)(&i))) == 0x67) ? '<' : '>';
}


x86 assembly (clang, -O0):
<MACHINE_ENDIAN_F>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1234567,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x3e,%eax
mov    $0x3c,%ecx
cmp    $0x67,%edx
cmove  %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<MACHINE_ENDIAN_F>:
mov    $0x3e,%al
ret

LLVM IR (-O0):
define signext i8 @MACHINE_ENDIAN_F() {
%1 = alloca i32
store i32 19088743, i32* %1
%2 = load i32, i32* %1
%3 = icmp eq i32 %2, 103
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 60, i32 62
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @MACHINE_ENDIAN_F() {
ret i8 62
}
/* Variables and functions */
float powf(float, float);
float db2lin(float db) {
  if (db <= -90.0f)
    return 0.0f;
  else {
    return powf(10.0f, db * 0.05f);
  }
}


x86 assembly (clang, -O0):
<db2lin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  0xedb(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jb     113c <db2lin+0x2c>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115b <db2lin+0x4b>
movss  0xec4(%rip),%xmm1
mulss  -0x8(%rbp),%xmm1
movss  0xeb3(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db2lin>:
movaps %xmm0,%xmm1
movss  0xee5(%rip),%xmm0
ucomiss %xmm1,%xmm0
jae    1135 <db2lin+0x25>
mulss  0xedc(%rip),%xmm1
movss  0xed8(%rip),%xmm0
jmp    1030 <powf@plt>
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @db2lin(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp ole float %4, -9.000000e+01
br i1 %5, label %6, label %7
6: ; preds = %1
store float 0.000000e+00, float* %2
br label %11
7: ; preds = %1
%8 = load float, float* %3
%9 = fmul float %8, 0x3FA99999A0000000
%10 = call float @powf(float 1.000000e+01, float %9)
store float %10, float* %2
br label %11
11: ; preds = %7, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @db2lin(float %0) {
%2 = fcmp ugt float %0, -9.000000e+01
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = fmul float %0, 0x3FA99999A0000000
%5 = tail call float @powf(float 1.000000e+01, float %4)
br label %6
6: ; preds = %1, %3
%7 = phi float [ %5, %3 ], [ 0.000000e+00, %1 ]
ret float %7
}
int fourbit(int ch) {
  if (ch >= '0' && ch <= '9') {
    return ch - '0';
  } else if (ch >= 'a' && ch <= 'f') {
    return ch - 'a' + 10;
  } else if (ch >= 'A' && ch <= 'F') {
    return ch - 'A' + 10;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fourbit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <fourbit+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <fourbit+0x29>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <fourbit+0x84>
cmpl   $0x61,-0x8(%rbp)
jl     114e <fourbit+0x4e>
cmpl   $0x66,-0x8(%rbp)
jg     114e <fourbit+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <fourbit+0x84>
cmpl   $0x41,-0x8(%rbp)
jl     1173 <fourbit+0x73>
cmpl   $0x46,-0x8(%rbp)
jg     1173 <fourbit+0x73>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <fourbit+0x84>
jmp    1178 <fourbit+0x78>
jmp    117d <fourbit+0x7d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fourbit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
jb     1124 <fourbit+0x24>
lea    -0x61(%rdi),%eax
cmp    $0x5,%eax
ja     1116 <fourbit+0x16>
add    $0xffffffa9,%edi
mov    %edi,%eax
ret
lea    -0x41(%rdi),%ecx
add    $0xffffffc9,%edi
xor    %eax,%eax
cmp    $0x6,%ecx
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @fourbit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
br label %35
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 102
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 97
%21 = add nsw i32 %20, 10
store i32 %21, i32* %2
br label %35
22: ; preds = %15, %12
%23 = load i32, i32* %3
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i32, i32* %3
%27 = icmp sle i32 %26, 70
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = load i32, i32* %3
%30 = sub nsw i32 %29, 65
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %35
32: ; preds = %25, %22
br label %33
33: ; preds = %32
br label %34
34: ; preds = %33
store i32 0, i32* %2
br label %35
35: ; preds = %34, %28, %18, %9
%36 = load i32, i32* %2
ret i32 %36
}

LLVM IR (-O2):
define i32 @fourbit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = add i32 %0, -97
%6 = icmp ult i32 %5, 6
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = add nsw i32 %0, -87
br label %14
9: ; preds = %4
%10 = add i32 %0, -65
%11 = icmp ult i32 %10, 6
%12 = add nsw i32 %0, -55
%13 = select i1 %11, i32 %12, i32 0
br label %14
14: ; preds = %1, %9, %7
%15 = phi i32 [ %8, %7 ], [ %13, %9 ], [ %2, %1 ]
ret i32 %15
}
const char *sl_find_first_char(const char *p, char c) {
  while (*p) {
    if (*p == c)
      break;
    p++;
  }
  return p;
}


x86 assembly (clang, -O0):
<sl_find_first_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1144 <sl_find_first_char+0x44>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1133 <sl_find_first_char+0x33>
jmp    1144 <sl_find_first_char+0x44>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <sl_find_first_char+0xe>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sl_find_first_char>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
je     1121 <sl_find_first_char+0x21>
cmp    %sil,%cl
jne    1110 <sl_find_first_char+0x10>
ret

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

LLVM IR (-O2):
define i8* @sl_find_first_char(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = icmp eq i8 %5, %1
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
void __attribute__((no_instrument_function))
__cyg_profile_func_exit(void *this_func, void *call_site) {
  printf("%s: func = %p, called by = %p\n", __FUNCTION__, this_func, call_site);
}


x86 assembly (clang, -O0):
<__cyg_profile_func_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xed1(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__cyg_profile_func_exit>:
mov    %rsi,%rcx
mov    %rdi,%rdx
lea    0xee3(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"%s: func = %p, called by = %p\0A\00"
@__FUNCTION__.__cyg_profile_func_exit = [24 x i8] c"__cyg_profile_func_exit\00"
define void @__cyg_profile_func_exit(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 i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.__cyg_profile_func_exit, i64 0, i64 0), i8* %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"%s: func = %p, called by = %p\0A\00"
@__FUNCTION__.__cyg_profile_func_exit = [24 x i8] c"__cyg_profile_func_exit\00"
define void @__cyg_profile_func_exit(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.__cyg_profile_func_exit, i64 0, i64 0), i8* %0, i8* %1)
ret void
}
void gtk_selection_data_copy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_selection_data_copy() {
ret void
}
void XmbSetWMProperties() {}


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

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

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

LLVM IR (-O2):
define void @XmbSetWMProperties() {
ret void
}