xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ UART_send(int /*<<< orphan*/);
void UART_write(const char *str) {
  for (; *str; ++str)
    UART_send((uint8_t)*str);
}


x86 assembly (clang, -O0):
<UART_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <UART_write+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <UART_send@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <UART_write+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UART_write>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <UART_write+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <UART_send@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <UART_write+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @UART_write(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = sext i8 %5 to i32
%8 = tail call i32 @UART_send(i32 %7)
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ appuyezEntree(char *);
int /*<<< orphan*/ lireEtAfficher(char *);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ titre(char *, int);
void afficherTextePorteEntree(void) {
  system("clear");
  titre("Porte d'entree", 32);
  lireEtAfficher("Entree/Texte_Porte_Entree.txt");
  appuyezEntree("\nAppuyez sur ENTREE pour continuer");
}


x86 assembly (clang, -O0):
<afficherTextePorteEntree>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
call   1030 <system@plt>
lea    0xeaf(%rip),%rdi
mov    $0x20,%esi
call   1050 <titre@plt>
lea    0xead(%rip),%rdi
call   1040 <lireEtAfficher@plt>
lea    0xebf(%rip),%rdi
call   1060 <appuyezEntree@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<afficherTextePorteEntree>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1030 <system@plt>
lea    0xeb2(%rip),%rdi
mov    $0x20,%esi
call   1050 <titre@plt>
lea    0xeb0(%rip),%rdi
call   1040 <lireEtAfficher@plt>
lea    0xec2(%rip),%rdi
pop    %rax
jmp    1060 <appuyezEntree@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [15 x i8] c"Porte d'entree\00"
@.str.2 = [30 x i8] c"Entree/Texte_Porte_Entree.txt\00"
@.str.3 = [35 x i8] c"\0AAppuyez sur ENTREE pour continuer\00"
define void @afficherTextePorteEntree() {
%1 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @titre(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 32)
%3 = call i32 @lireEtAfficher(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @appuyezEntree(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [15 x i8] c"Porte d'entree\00"
@.str.2 = [30 x i8] c"Entree/Texte_Porte_Entree.txt\00"
@.str.3 = [35 x i8] c"\0AAppuyez sur ENTREE pour continuer\00"
define void @afficherTextePorteEntree() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @titre(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 32)
%3 = tail call i32 @lireEtAfficher(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @appuyezEntree(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Variables and functions */
size_t lt_hash_key(size_t key) { return 17 + 37 * key; }


x86 assembly (clang, -O0):
<lt_hash_key>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0x25,-0x8(%rbp),%rax
add    $0x11,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt_hash_key>:
lea    (%rdi,%rdi,8),%rax
lea    (%rdi,%rax,4),%rax
add    $0x11,%rax
ret

LLVM IR (-O0):
define i64 @lt_hash_key(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 37, %3
%5 = add i64 17, %4
ret i64 %5
}

LLVM IR (-O2):
define i64 @lt_hash_key(i64 %0) {
%2 = mul i64 %0, 37
%3 = add i64 %2, 17
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ I2C_I2CInit();
void I2C_Init(void) { I2C_I2CInit(); }


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

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

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

LLVM IR (-O2):
define void @I2C_Init() {
%1 = tail call i32 (...) @I2C_I2CInit()
ret void
}
int load_list() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @load_list() {
ret i32 0
}
int fun1379() { return 1379; }


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

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

LLVM IR (-O0):
define i32 @fun1379() {
ret i32 1379
}

LLVM IR (-O2):
define i32 @fun1379() {
ret i32 1379
}
void RTFileCopyByHandlesEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTFileCopyByHandlesEx() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gs_finit(int /*<<< orphan*/, int /*<<< orphan*/);
int gs_server_terminate() {
  gs_finit(0, 0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gs_server_terminate() {
%1 = call i32 @gs_finit(i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gs_server_terminate() {
%1 = tail call i32 @gs_finit(i32 0, i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ GP_break10();
int /*<<< orphan*/ MP_motor(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ MP_p1wait1();
int /*<<< orphan*/ MP_p1wait2();
int /*<<< orphan*/ MP_p1wait3();
void MP_prozess1(void) {
  while (1) {
    GP_break10();
    MP_p1wait1();
    MP_motor(0, 0);
    MP_p1wait2();
    MP_p1wait3();
  };
}


x86 assembly (clang, -O0):
<MP_prozess1>:
push   %rbp
mov    %rsp,%rbp
jmp    1159 <MP_prozess1+0x9>
mov    $0x0,%al
call   1050 <GP_break10@plt>
mov    $0x0,%al
call   1030 <MP_p1wait1@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <MP_motor@plt>
mov    $0x0,%al
call   1060 <MP_p1wait2@plt>
mov    $0x0,%al
call   1040 <MP_p1wait3@plt>
jmp    1159 <MP_prozess1+0x9>

x86 assembly (clang, -O2):
<MP_prozess1>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <GP_break10@plt>
xor    %eax,%eax
call   1030 <MP_p1wait1@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <MP_motor@plt>
xor    %eax,%eax
call   1060 <MP_p1wait2@plt>
xor    %eax,%eax
call   1040 <MP_p1wait3@plt>
jmp    1160 <MP_prozess1+0x10>

LLVM IR (-O0):
define void @MP_prozess1() {
br label %1
1: ; preds = %0, %1
%2 = call i32 (...) @GP_break10()
%3 = call i32 (...) @MP_p1wait1()
%4 = call i32 @MP_motor(i32 0, i32 0)
%5 = call i32 (...) @MP_p1wait2()
%6 = call i32 (...) @MP_p1wait3()
br label %1
}

LLVM IR (-O2):
define void @MP_prozess1() {
br label %1
1: ; preds = %0, %1
%2 = tail call i32 (...) @GP_break10()
%3 = tail call i32 (...) @MP_p1wait1()
%4 = tail call i32 @MP_motor(i32 0, i32 0)
%5 = tail call i32 (...) @MP_p1wait2()
%6 = tail call i32 (...) @MP_p1wait3()
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int sum(int, int, int, int);
int main() {
  int num = sum(3, 1, 2, 3);
  printf("%d\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%ecx
mov    $0x1,%esi
mov    $0x2,%edx
mov    %ecx,%edi
call   1040 <sum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
call   1040 <sum@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @sum(i32 3, i32 1, i32 2, i32 3)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ drawVRect(int);
int /*<<< orphan*/ glColor3f(int, int, int);
void drawWhiteVRect(int pos) {
  glColor3f(1, 1, 1);
  drawVRect(pos);
}


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

x86 assembly (clang, -O2):
<drawWhiteVRect>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x1,%edx
call   1030 <glColor3f@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <drawVRect@plt>

LLVM IR (-O0):
define void @drawWhiteVRect(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @glColor3f(i32 1, i32 1, i32 1)
%4 = load i32, i32* %2
%5 = call i32 @drawVRect(i32 %4)
ret void
}

LLVM IR (-O2):
define void @drawWhiteVRect(i32 %0) {
%2 = tail call i32 @glColor3f(i32 1, i32 1, i32 1)
%3 = tail call i32 @drawVRect(i32 %0)
ret void
}
/* Variables and functions */
double exp(double);
void vecexp_libc(double *values, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    values[i] = exp(values[i]);
  }
}


x86 assembly (clang, -O0):
<vecexp_libc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115f <vecexp_libc+0x4f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1030 <exp@plt>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <vecexp_libc+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecexp_libc>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    114a <vecexp_libc+0x3a>
mov    %rdi,%r15
mov    %esi,%r14d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r15,%rbx,8),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <vecexp_libc+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @vecexp_libc(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %21, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load double*, double** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %11, i64 %13
%15 = load double, double* %14
%16 = call double @exp(double %15)
%17 = load double*, double** %3
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double, double* %17, i64 %19
store double %16, double* %20
br label %21
21: ; preds = %10
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %6
24: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @vecexp_libc(double* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds double, double* %0, i64 %7
%9 = load double, double* %8
%10 = tail call double @exp(double %9)
store double %10, double* %8
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_qsort(void *, size_t, size_t,
                            int (*)(void const *, void const *));
__attribute__((__weak__, __always___)) void
softboundcets_qsort(void *base, size_t nmemb, size_t size,
                    int (*compar)(const void *, const void *)) {
  my_qsort(base, nmemb, size, compar);
}


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

x86 assembly (clang, -O2):
<softboundcets_qsort>:
jmp    1030 <my_qsort@plt>

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

LLVM IR (-O2):
define weak void @softboundcets_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3) {
%5 = tail call i32 @my_qsort(i8* %0, i64 %1, i64 %2, i32 (i8*, i8*)* %3)
ret void
}
/* Type definitions */
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
int millasleep(int ms) {
  struct timespec tim, tim2;
  tim.tv_sec = ms / 1000;
  tim.tv_nsec = (ms % 1000) * 1000000L;
  return nanosleep(&tim, &tim2);
}


x86 assembly (clang, -O0):
<millasleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
imul   $0xf4240,%rax,%rax
mov    %eax,-0xc(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millasleep>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
mov    %ecx,0x8(%rsp)
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
imul   $0xf4240,%eax,%eax
mov    %eax,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define i32 @millasleep(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca %struct.timespec
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i32 %6, i32* %7
%8 = load i32, i32* %2
%9 = srem i32 %8, 1000
%10 = sext i32 %9 to i64
%11 = mul nsw i64 %10, 1000000
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i32 %12, i32* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, %struct.timespec* %4)
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define i32 @millasleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = sdiv i32 %0, 1000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %6, i32* %7
%8 = srem i32 %0, 1000
%9 = mul nsw i32 %8, 1000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i32 %9, i32* %10
%11 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
ret i32 %11
}
void g_value_dup_object() {}


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

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

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

LLVM IR (-O2):
define void @g_value_dup_object() {
ret void
}
/* Variables and functions */
int cmio_in(int /*<<< orphan*/);
int /*<<< orphan*/ malloc(int);
int test_mio_in(void) { return cmio_in(malloc(sizeof(char))); }


x86 assembly (clang, -O0):
<test_mio_in>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %eax,%edi
call   1040 <cmio_in@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mio_in>:
push   %rax
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <cmio_in@plt>

LLVM IR (-O0):
define i32 @test_mio_in() {
%1 = call i32 @malloc(i32 1)
%2 = call i32 @cmio_in(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
define i32 @test_mio_in() {
%1 = tail call i32 @malloc(i32 1)
%2 = tail call i32 @cmio_in(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ __builtin_nyuzi_write_control_reg(int, int);
void exit(int status) {
  (void)status;
  __builtin_nyuzi_write_control_reg(20, 0xffffffff);
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x14,%edi
mov    $0xffffffff,%esi
call   1030 <__builtin_nyuzi_write_control_reg@plt>
jmp    112a <exit+0x1a>

x86 assembly (clang, -O2):
<exit>:
push   %rax
mov    $0x14,%edi
mov    $0xffffffff,%esi
call   1030 <__builtin_nyuzi_write_control_reg@plt>
jmp    1120 <exit+0x10>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @__builtin_nyuzi_write_control_reg(i32 20, i32 -1)
br label %5
5: ; preds = %1, %5
br label %5
}

LLVM IR (-O2):
define void @exit(i32 %0) {
%2 = tail call i32 @__builtin_nyuzi_write_control_reg(i32 20, i32 -1)
br label %3
3: ; preds = %1, %3
br label %3
}
/* Variables and functions */
scalar_t__ islower(int);
int toupper(int c) { return islower(c) ? c ^ 0x20 : c; }


x86 assembly (clang, -O0):
<toupper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <islower@plt>
cmp    $0x0,%rax
je     113b <toupper+0x2b>
mov    -0x4(%rbp),%eax
xor    $0x20,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <toupper+0x31>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<toupper>:
push   %rbx
mov    %edi,%ebx
call   1030 <islower@plt>
mov    %ebx,%ecx
xor    $0x20,%ecx
test   %rax,%rax
cmove  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = tail call i64 @islower(i32 %0)
%3 = icmp eq i64 %2, 0
%4 = xor i32 %0, 32
%5 = select i1 %3, i32 %0, i32 %4
ret i32 %5
}
int qd_is_positive(const double *a) { return (a[0] > 0.0) ? 1 : 0; }


x86 assembly (clang, -O0):
<qd_is_positive>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
xor    %eax,%eax
mov    $0x1,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qd_is_positive>:
movsd  (%rdi),%xmm0
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm0
seta   %al
ret

LLVM IR (-O0):
define i32 @qd_is_positive(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fcmp ogt double %5, 0.000000e+00
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @qd_is_positive(double* nocapture %0) {
%2 = load double, double* %0
%3 = fcmp ogt double %2, 0.000000e+00
%4 = zext i1 %3 to i32
ret i32 %4
}
int move_odd(int *A, int *len_a, int *B, int *len_b) {
  int disk = A[*len_a];
  A[*len_a] = 0;
  *len_a = *len_a - 1;
  *len_b = *len_b + 1;
  B[*len_b] = disk;
  return (0);
}


x86 assembly (clang, -O0):
<move_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,4)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_odd>:
movslq (%rsi),%rax
mov    (%rdi,%rax,4),%r8d
movl   $0x0,(%rdi,%rax,4)
addl   $0xffffffff,(%rsi)
movslq (%rcx),%rax
lea    0x1(%rax),%rsi
mov    %esi,(%rcx)
mov    %r8d,0x4(%rdx,%rax,4)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @move_odd(i32* %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %5
%11 = load i32*, i32** %6
%12 = load i32, i32* %11
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %10, i64 %13
%15 = load i32, i32* %14
store i32 %15, i32* %9
%16 = load i32*, i32** %5
%17 = load i32*, i32** %6
%18 = load i32, i32* %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %16, i64 %19
store i32 0, i32* %20
%21 = load i32*, i32** %6
%22 = load i32, i32* %21
%23 = sub nsw i32 %22, 1
%24 = load i32*, i32** %6
store i32 %23, i32* %24
%25 = load i32*, i32** %8
%26 = load i32, i32* %25
%27 = add nsw i32 %26, 1
%28 = load i32*, i32** %8
store i32 %27, i32* %28
%29 = load i32, i32* %9
%30 = load i32*, i32** %7
%31 = load i32*, i32** %8
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %30, i64 %33
store i32 %29, i32* %34
ret i32 0
}

LLVM IR (-O2):
define i32 @move_odd(i32* nocapture %0, i32* nocapture %1, i32* nocapture writeonly %2, i32* nocapture %3) {
%5 = load i32, i32* %1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = load i32, i32* %7
store i32 0, i32* %7
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %2, i64 %13
store i32 %8, i32* %14
ret i32 0
}
/* Variables and functions */
int fls(unsigned long);
unsigned long find_zero(unsigned long mask) { return fls(mask) >> 3; }


x86 assembly (clang, -O0):
<find_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <fls@plt>
sar    $0x3,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_zero>:
push   %rax
call   1030 <fls@plt>
sar    $0x3,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @find_zero(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @fls(i64 %3)
%5 = ashr i32 %4, 3
%6 = sext i32 %5 to i64
ret i64 %6
}

LLVM IR (-O2):
define i64 @find_zero(i64 %0) {
%2 = tail call i32 @fls(i64 %0)
%3 = ashr i32 %2, 3
%4 = sext i32 %3 to i64
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void greet() { printf("Hello!\n"); }


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"Hello!\00"
define void @greet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ putchar(int);
int toupper(int);
main() {
  int lower, upper;
  lower = getchar();
  upper = toupper(lower);
  putchar(upper);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%edi
call   1040 <toupper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = tail call i32 @toupper(i32 %1)
%3 = tail call i32 @putchar(i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gl2psPrintf(char *);
void gl2psPrintPostScriptFooter(void) {
  gl2psPrintf("grestore\n"
              "showpage\n"
              "cleartomark\n"
              "%%%%PageTrailer\n"
              "%%%%Trailer\n"
              "end\n"
              "%%%%EOF\n");
}


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

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

LLVM IR (-O0):
@.str = [71 x i8] c"grestore\0Ashowpage\0Acleartomark\0A%%%%PageTrailer\0A%%%%Trailer\0Aend\0A%%%%EOF\0A\00"
define void @gl2psPrintPostScriptFooter() {
%1 = call i32 @gl2psPrintf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"grestore\0Ashowpage\0Acleartomark\0A%%%%PageTrailer\0A%%%%Trailer\0Aend\0A%%%%EOF\0A\00"
define void @gl2psPrintPostScriptFooter() {
%1 = tail call i32 @gl2psPrintf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
ret void
}
long sitoptr(si)
long si;
{ return ((si & 0xff000000) >> 8) | (si & 0xffff); }


x86 assembly (clang, -O0):
<sitoptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0xff000000,%rax
and    -0x8(%rbp),%rax
sar    $0x8,%rax
mov    -0x8(%rbp),%rcx
and    $0xffff,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sitoptr>:
movzwl %di,%eax
shr    $0x8,%rdi
and    $0xff0000,%edi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @sitoptr(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 4278190080
%5 = ashr i64 %4, 8
%6 = load i64, i64* %2
%7 = and i64 %6, 65535
%8 = or i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @sitoptr(i64 %0) {
%2 = lshr i64 %0, 8
%3 = and i64 %2, 16711680
%4 = and i64 %0, 65535
%5 = or i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void close_connection(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<close_connection>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @close_connection(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tr_sortleaf_usage() {
  fprintf(stderr, "Usage: treebest sortleaf <tree1> [<tree2>]\n");
  return 1;
}


x86 assembly (clang, -O0):
<tr_sortleaf_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tr_sortleaf_usage>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: treebest sortleaf <tree1> [<tree2>]\0A\00"
define i32 @tr_sortleaf_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"Usage: treebest sortleaf <tree1> [<tree2>]\0A\00"
define i32 @tr_sortleaf_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
int strcasecmp(char const *, char const *);
int jw_strcasecmp(const char *a, const char *b) {
  if (a == b) {
    return 0;
  }
  if (a == NULL) {
    return -1;
  }
  if (b == NULL) {
    return 1;
  }
  return strcasecmp(a, b);
}


x86 assembly (clang, -O0):
<jw_strcasecmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jne    113a <jw_strcasecmp+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    1178 <jw_strcasecmp+0x68>
cmpq   $0x0,-0x10(%rbp)
jne    1151 <jw_strcasecmp+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1178 <jw_strcasecmp+0x68>
cmpq   $0x0,-0x18(%rbp)
jne    1168 <jw_strcasecmp+0x58>
movl   $0x1,-0x4(%rbp)
jmp    1178 <jw_strcasecmp+0x68>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcasecmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jw_strcasecmp>:
cmp    %rsi,%rdi
je     1124 <jw_strcasecmp+0x14>
test   %rdi,%rdi
je     1127 <jw_strcasecmp+0x17>
test   %rsi,%rsi
je     112d <jw_strcasecmp+0x1d>
jmp    1030 <strcasecmp@plt>
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @jw_strcasecmp(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, %1
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = icmp eq i8* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = icmp eq i8* %1, null
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 @strcasecmp(i8* %0, i8* %1)
br label %10
10: ; preds = %6, %4, %2, %8
%11 = phi i32 [ %9, %8 ], [ 0, %2 ], [ -1, %4 ], [ 1, %6 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ recv_ec_data();
int /*<<< orphan*/ send_ec_command(int);
int /*<<< orphan*/ send_ec_data(int /*<<< orphan*/);
uint8_t ec_read(uint8_t addr) {
  send_ec_command(0x80);
  send_ec_data(addr);
  return recv_ec_data();
}


x86 assembly (clang, -O0):
<ec_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x80,%edi
call   1030 <send_ec_command@plt>
mov    -0x4(%rbp),%edi
call   1050 <send_ec_data@plt>
mov    $0x0,%al
call   1040 <recv_ec_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_read>:
push   %rbx
mov    %edi,%ebx
mov    $0x80,%edi
call   1030 <send_ec_command@plt>
mov    %ebx,%edi
call   1050 <send_ec_data@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <recv_ec_data@plt>

LLVM IR (-O0):
define i32 @ec_read(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @send_ec_command(i32 128)
%4 = load i32, i32* %2
%5 = call i32 @send_ec_data(i32 %4)
%6 = call i32 (...) @recv_ec_data()
ret i32 %6
}

LLVM IR (-O2):
define i32 @ec_read(i32 %0) {
%2 = tail call i32 @send_ec_command(i32 128)
%3 = tail call i32 @send_ec_data(i32 %0)
%4 = tail call i32 (...) @recv_ec_data()
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ stdio_helper_fake_printf(char *, float);
void soru_2(float x) {
  stdio_helper_fake_printf("%f", x);
  stdio_helper_fake_printf("%.3f", x);
}


x86 assembly (clang, -O0):
<soru_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <stdio_helper_fake_printf@plt>
movss  -0x4(%rbp),%xmm0
lea    0xec9(%rip),%rdi
call   1030 <stdio_helper_fake_printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<soru_2>:
push   %rax
movss  %xmm0,0x4(%rsp)
lea    0xee2(%rip),%rdi
call   1030 <stdio_helper_fake_printf@plt>
lea    0xed9(%rip),%rdi
movss  0x4(%rsp),%xmm0
pop    %rax
jmp    1030 <stdio_helper_fake_printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [5 x i8] c"%.3f\00"
define void @soru_2(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %3)
%5 = load float, float* %2
%6 = call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %5)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [5 x i8] c"%.3f\00"
define void @soru_2(float %0) {
%2 = tail call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %0)
%3 = tail call i32 @stdio_helper_fake_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), float %0)
ret void
}
/* Variables and functions */
int capture_stack_func(void **, int);
int hl_internal_capture_stack(void **stack, int size) {
  return capture_stack_func(stack, size);
}


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

x86 assembly (clang, -O2):
<hl_internal_capture_stack>:
jmp    1030 <capture_stack_func@plt>

LLVM IR (-O0):
define i32 @hl_internal_capture_stack(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 @capture_stack_func(i8** %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @hl_internal_capture_stack(i8** %0, i32 %1) {
%3 = tail call i32 @capture_stack_func(i8** %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float num1, num2, r;
  num1 = 5;
  num2 = 2;
  r = num1 / num2;
  printf("%.2f\n", r);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store float 5.000000e+00, float* %2
store float 2.000000e+00, float* %3
%5 = load float, float* %2
%6 = load float, float* %3
%7 = fdiv float %5, %6
store float %7, float* %4
%8 = load float, float* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 2.500000e+00)
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ sys_abort(char *);
void *sys_malloc(size_t size) {
  void *ptr = malloc(size);
  if (ptr == NULL)
    sys_abort("sys_malloc: out of memory");
  return ptr;
}


x86 assembly (clang, -O0):
<sys_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <sys_malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1030 <sys_abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_malloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <sys_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <sys_abort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"sys_malloc: out of memory\00"
define i8* @sys_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @sys_abort(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [26 x i8] c"sys_malloc: out of memory\00"
define noalias i8* @sys_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @sys_abort(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int powernv_hwrng_present(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @powernv_hwrng_present() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ umount();
void quit_command(void) {
  umount();
  exit(0);
}


x86 assembly (clang, -O0):
<quit_command>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <umount@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit_command>:
push   %rax
xor    %eax,%eax
call   1030 <umount@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @quit_command() {
%1 = call i32 (...) @umount()
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @quit_command() {
%1 = tail call i32 (...) @umount()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ test_avl_tree();
int /*<<< orphan*/ test_map();
int main() {
  test_avl_tree();
  test_map();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_avl_tree()
%2 = tail call i32 (...) @test_map()
ret i32 0
}
/* Variables and functions */
int foo2c();
int foo1c(void) { return foo2c(); }


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

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

LLVM IR (-O0):
define i32 @foo1c() {
%1 = call i32 (...) @foo2c()
ret i32 %1
}

LLVM IR (-O2):
define i32 @foo1c() {
%1 = tail call i32 (...) @foo2c()
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int parse_enum_n(char const *, int, char const *const *, int /*<<< orphan*/ *);
int parse_enum(const char *arg, const char *const *names, int8_t *dst) {
  return parse_enum_n(arg, 255, names, dst);
}


x86 assembly (clang, -O0):
<parse_enum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0xff,%esi
call   1030 <parse_enum_n@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_enum>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0xff,%esi
jmp    1030 <parse_enum_n@plt>

LLVM IR (-O0):
define i32 @parse_enum(i8* %0, i8** %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32*, i32** %6
%10 = call i32 @parse_enum_n(i8* %7, i32 255, i8** %8, i32* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @parse_enum(i8* %0, i8** %1, i32* %2) {
%4 = tail call i32 @parse_enum_n(i8* %0, i32 255, i8** %1, i32* %2)
ret i32 %4
}
/* Type definitions */
struct hdmi2usb {
  int dummy;
};

/* Variables and functions */
scalar_t__ pop_sighandler();
int hdmi2usb_close(struct hdmi2usb *app, int rc) {
  while (pop_sighandler())
    ;
  return rc;
}


x86 assembly (clang, -O0):
<hdmi2usb_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <pop_sighandler@plt>
cmp    $0x0,%rax
je     1135 <hdmi2usb_close+0x25>
jmp    111f <hdmi2usb_close+0xf>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdmi2usb_close>:
push   %rbx
mov    %esi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <pop_sighandler@plt>
test   %rax,%rax
jne    1120 <hdmi2usb_close+0x10>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hdmi2usb = type { i32 }
define i32 @hdmi2usb_close(%struct.hdmi2usb* %0, i32 %1) {
%3 = alloca %struct.hdmi2usb*
%4 = alloca i32
store %struct.hdmi2usb* %0, %struct.hdmi2usb** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %8, %2
%6 = call i64 (...) @pop_sighandler()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %5
br label %5
9: ; preds = %5
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
%struct.hdmi2usb = type { i32 }
define i32 @hdmi2usb_close(%struct.hdmi2usb* nocapture readnone %0, i32 returned %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 (...) @pop_sighandler()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %3
6: ; preds = %3
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ CRYPTO_free(void *, char const *, int);
void CRYPTO_secure_free(void *ptr, const char *file, int line) {
  CRYPTO_free(ptr, file, line);
}


x86 assembly (clang, -O0):
<CRYPTO_secure_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <CRYPTO_free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CRYPTO_secure_free>:
jmp    1030 <CRYPTO_free@plt>

LLVM IR (-O0):
define void @CRYPTO_secure_free(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @CRYPTO_free(i8* %7, i8* %8, i32 %9)
ret void
}

LLVM IR (-O2):
define void @CRYPTO_secure_free(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @CRYPTO_free(i8* %0, i8* %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AbsoluteLongSlow(int);
int /*<<< orphan*/ S9xSA1SetPCBase(int /*<<< orphan*/);
void Op5CSlow(void) { S9xSA1SetPCBase(AbsoluteLongSlow(5)); }


x86 assembly (clang, -O0):
<Op5CSlow>:
push   %rbp
mov    %rsp,%rbp
mov    $0x5,%edi
call   1030 <AbsoluteLongSlow@plt>
mov    %eax,%edi
call   1040 <S9xSA1SetPCBase@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op5CSlow>:
push   %rax
mov    $0x5,%edi
call   1030 <AbsoluteLongSlow@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <S9xSA1SetPCBase@plt>

LLVM IR (-O0):
define void @Op5CSlow() {
%1 = call i32 @AbsoluteLongSlow(i32 5)
%2 = call i32 @S9xSA1SetPCBase(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op5CSlow() {
%1 = tail call i32 @AbsoluteLongSlow(i32 5)
%2 = tail call i32 @S9xSA1SetPCBase(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_free(char *);
char *ft_strjoin(char *, char *);
char *i_equal_len(char *c, char *result) {
  char *new;
  new = ft_strjoin(result, c);
  ft_free(result);
  ft_free(c);
  return (new);
}


x86 assembly (clang, -O0):
<i_equal_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <ft_free@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ft_free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i_equal_len>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %r14,%rsi
call   1040 <ft_strjoin@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1030 <ft_free@plt>
mov    %r14,%rdi
call   1030 <ft_free@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @i_equal_len(i8* %0, i8* %1) {
%3 = tail call i8* @ft_strjoin(i8* %1, i8* %0)
%4 = tail call i32 @ft_free(i8* %1)
%5 = tail call i32 @ft_free(i8* %0)
ret i8* %3
}