xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ close(int);
void Net_close(int fd) { close(fd); }


x86 assembly (clang, -O0):
<Net_close>:
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):
<Net_close>:
jmp    1030 <close@plt>

LLVM IR (-O0):
define void @Net_close(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 @Net_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
int pvr_get_plist_posn() {
  unsigned int addr = (*((volatile unsigned long *)((0xA05F8000 + 0x134))))
                      << 2;
  return addr;
}


x86 assembly (clang, -O0):
<pvr_get_plist_posn>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa05f8134,%eax
mov    (%rax),%rax
shl    $0x2,%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvr_get_plist_posn>:
mov    $0xa05f8134,%eax
mov    (%rax),%rax
shl    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @pvr_get_plist_posn() {
%1 = alloca i32
%2 = load volatile i64, i64* inttoptr (i64 2690613556 to i64*)
%3 = shl i64 %2, 2
%4 = trunc i64 %3 to i32
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @pvr_get_plist_posn() {
%1 = load volatile i64, i64* inttoptr (i64 2690613556 to i64*)
%2 = trunc i64 %1 to i32
%3 = shl i32 %2, 2
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ SSL;

/* Variables and functions */
int /*<<< orphan*/ BIO_set_close(int /*<<< orphan*/, int);
int /*<<< orphan*/ SSL_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_get_wbio(int /*<<< orphan*/ *);
void kill_conn(SSL *ssl) {
  (void)BIO_set_close(SSL_get_wbio(ssl), 1);
  SSL_free(ssl);
}


x86 assembly (clang, -O0):
<kill_conn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <SSL_get_wbio@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <BIO_set_close@plt>
mov    -0x8(%rbp),%rdi
call   1040 <SSL_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_conn>:
push   %rbx
mov    %rdi,%rbx
call   1050 <SSL_get_wbio@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1030 <BIO_set_close@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <SSL_free@plt>

LLVM IR (-O0):
define void @kill_conn(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @SSL_get_wbio(i32* %3)
%5 = call i32 @BIO_set_close(i32 %4, i32 1)
%6 = load i32*, i32** %2
%7 = call i32 @SSL_free(i32* %6)
ret void
}

LLVM IR (-O2):
define void @kill_conn(i32* %0) {
%2 = tail call i32 @SSL_get_wbio(i32* %0)
%3 = tail call i32 @BIO_set_close(i32 %2, i32 1)
%4 = tail call i32 @SSL_free(i32* %0)
ret void
}
/* Variables and functions */
size_t base32encsize(size_t count) {
  size_t size = -1;
  size = count << 3;
  if (size % 5 == 0)
    return size / 5;
  else
    return 1 + size / 5;
}


x86 assembly (clang, -O0):
<base32encsize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0xffffffffffffffff,-0x18(%rbp)
ff
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    114b <base32encsize+0x4b>
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x8(%rbp)
jmp    1161 <base32encsize+0x61>
mov    -0x18(%rbp),%rax
mov    $0x5,%ecx
xor    %edx,%edx
div    %rcx
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base32encsize>:
shl    $0x3,%rdi
movabs $0xcccccccccccccccd,%rcx
cc cc cc
mov    %rdi,%rax
mul    %rcx
shr    $0x2,%rdx
lea    (%rdx,%rdx,4),%rcx
xor    %eax,%eax
cmp    %rcx,%rdi
setne  %al
add    %rdx,%rax
ret

LLVM IR (-O0):
define i64 @base32encsize(i64 %0) {
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 -1, i64* %4
%5 = load i64, i64* %3
%6 = shl i64 %5, 3
store i64 %6, i64* %4
%7 = load i64, i64* %4
%8 = urem i64 %7, 5
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i64, i64* %4
%12 = udiv i64 %11, 5
store i64 %12, i64* %2
br label %17
13: ; preds = %1
%14 = load i64, i64* %4
%15 = udiv i64 %14, 5
%16 = add i64 1, %15
store i64 %16, i64* %2
br label %17
17: ; preds = %13, %10
%18 = load i64, i64* %2
ret i64 %18
}

LLVM IR (-O2):
define i64 @base32encsize(i64 %0) {
%2 = shl i64 %0, 3
%3 = urem i64 %2, 5
%4 = icmp ne i64 %3, 0
%5 = udiv i64 %2, 5
%6 = zext i1 %4 to i64
%7 = add nuw nsw i64 %5, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ e_izpx();
int /*<<< orphan*/ e_lda();
void e_lda_izpx() {
  e_izpx();
  e_lda();
}


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

x86 assembly (clang, -O2):
<e_lda_izpx>:
push   %rax
xor    %eax,%eax
call   1030 <e_izpx@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <e_lda@plt>

LLVM IR (-O0):
define void @e_lda_izpx() {
%1 = call i32 (...) @e_izpx()
%2 = call i32 (...) @e_lda()
ret void
}

LLVM IR (-O2):
define void @e_lda_izpx() {
%1 = tail call i32 (...) @e_izpx()
%2 = tail call i32 (...) @e_lda()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int SIGALRM;
int sigismember(int /*<<< orphan*/ *, int);
int test(void) {
  sigset_t signal_set;
  int signal_number;
  int result;
  signal_number = SIGALRM;
  result = sigismember(&signal_set, signal_number);
  return result;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    -0x4(%rbp),%rdi
call   1030 <sigismember@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
call   1030 <sigismember@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
@SIGALRM = global i32 0
define i32 @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @SIGALRM
%4 = call i32 @sigismember(i32* %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int numeroTriangular;
  numeroTriangular = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;
  printf("El octavo numero triangular es %i\n", numeroTriangular);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x24,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed0(%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
mov    $0x24,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"El octavo numero triangular es %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 36, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"El octavo numero triangular es %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 36)
ret i32 0
}
/* Type definitions */
struct timeval {
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int gettimenow(void) {
  struct timeval now;
  gettimeofday(&now, NULL);
  return now.tv_usec;
}


x86 assembly (clang, -O0):
<gettimenow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gettimenow>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
define i32 @gettimenow() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
ret i32 %4
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define i32 @gettimenow() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
unsigned long pud_index(unsigned long address) {
  return (address >> 32) & (1024 - 1);
}


x86 assembly (clang, -O0):
<pud_index>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
and    $0x3ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pud_index>:
mov    %rdi,%rax
shr    $0x20,%rax
and    $0x3ff,%eax
ret

LLVM IR (-O0):
define i64 @pud_index(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 1023
ret i64 %5
}

LLVM IR (-O2):
define i64 @pud_index(i64 %0) {
%2 = lshr i64 %0, 32
%3 = and i64 %2, 1023
ret i64 %3
}
int test_imm_B6uint16_mem(unsigned short *val) {
  return ((*val) & (-0xB6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B6uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffff4a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B6uint16_mem>:
movzwl (%rdi),%eax
test   $0xff4a,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B6uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -182
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_B6uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -182
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void file_error(char *filename) {
  fprintf(stderr, "An error occured when we tried to access the file %s\n",
          filename);
  perror("");
  exit(1);
}


x86 assembly (clang, -O0):
<file_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xed9(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<file_error>:
push   %rax
mov    %rdi,%rdx
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
call   1030 <fprintf@plt>
lea    0xee5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [54 x i8] c"An error occured when we tried to access the file %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @file_error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [54 x i8] c"An error occured when we tried to access the file %s\0A\00"
@.str.1 = [1 x i8] zeroinitializer
define void @file_error(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @perror(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void showErr(int id) {
  printf("\nERRO %d:", id);
  switch (id) {
  case 0: {
    printf("\n\nEmpty! Please, insert into list.\n\n");
    break;
  }
  case 1: {
    printf("\n\nOps! This node not exists. Retry.\n\n");
    break;
  }
  }
}


x86 assembly (clang, -O0):
<showErr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
test   %eax,%eax
je     1150 <showErr+0x40>
jmp    113f <showErr+0x2f>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
je     1163 <showErr+0x53>
jmp    1171 <showErr+0x61>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1171 <showErr+0x61>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showErr>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebx,%ebx
je     1149 <showErr+0x29>
cmp    $0x1,%ebx
jne    1156 <showErr+0x36>
lea    0xec7(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xedf(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"\0AERRO %d:\00"
@.str.1 = [37 x i8] c"\0A\0AEmpty! Please, insert into list.\0A\0A\00"
@.str.2 = [38 x i8] c"\0A\0AOps! This node not exists. Retry.\0A\0A\00"
define void @showErr(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
switch i32 %5, label %10 [
i32 0, label %6
i32 1, label %8
]
6: ; preds = %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
br label %10
8: ; preds = %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %1, %8, %6
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0AERRO %d:\00"
@str = [37 x i8] c"\0A\0AOps! This node not exists. Retry.\0A\00"
@str.3 = [36 x i8] c"\0A\0AEmpty! Please, insert into list.\0A\00"
define void @showErr(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
switch i32 %0, label %7 [
i32 0, label %4
i32 1, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8* [ getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0), %3 ], [ getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0), %1 ]
%6 = tail call i32 @puts(i8* dereferenceable(1) %5)
br label %7
7: ; preds = %4, %1
ret void
}
int ABS(int a) {
  int b = a >> 31;
  return ((a ^ b) - b);
}


x86 assembly (clang, -O0):
<ABS>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
sub    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ABS>:
mov    %edi,%eax
neg    %eax
cmovs  %edi,%eax
ret

LLVM IR (-O0):
define i32 @ABS(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = xor i32 %6, %7
%9 = load i32, i32* %3
%10 = sub nsw i32 %8, %9
ret i32 %10
}

LLVM IR (-O2):
define i32 @ABS(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
void k_hlt() { asm("hlt"); }


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

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

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

LLVM IR (-O2):
define void @k_hlt() {
tail call void asm sideeffect "hlt", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Type definitions */
struct ps_summary {
  int dummy;
};
struct ps_bus_event {
  int dummy;
};
struct obus_bus_event {
  int dummy;
};

/* Variables and functions */
int obus_bus_event_unregister_object(struct obus_bus_event *,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ ps_summary_object(struct ps_summary *);
int ps_bus_event_unregister_summary(struct ps_bus_event *bus_event,
                                    struct ps_summary *object) {
  return obus_bus_event_unregister_object((struct obus_bus_event *)bus_event,
                                          ps_summary_object(object));
}


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

x86 assembly (clang, -O2):
<ps_bus_event_unregister_summary>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <ps_summary_object@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1030 <obus_bus_event_unregister_object@plt>

LLVM IR (-O0):
%struct.ps_bus_event = type { i32 }
%struct.ps_summary = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_unregister_summary(%struct.ps_bus_event* %0, %struct.ps_summary* %1) {
%3 = alloca %struct.ps_bus_event*
%4 = alloca %struct.ps_summary*
store %struct.ps_bus_event* %0, %struct.ps_bus_event** %3
store %struct.ps_summary* %1, %struct.ps_summary** %4
%5 = load %struct.ps_bus_event*, %struct.ps_bus_event** %3
%6 = bitcast %struct.ps_bus_event* %5 to %struct.obus_bus_event*
%7 = load %struct.ps_summary*, %struct.ps_summary** %4
%8 = call i32 @ps_summary_object(%struct.ps_summary* %7)
%9 = call i32 @obus_bus_event_unregister_object(%struct.obus_bus_event* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.ps_bus_event = type { i32 }
%struct.ps_summary = type { i32 }
%struct.obus_bus_event = type { i32 }
define i32 @ps_bus_event_unregister_summary(%struct.ps_bus_event* %0, %struct.ps_summary* %1) {
%3 = bitcast %struct.ps_bus_event* %0 to %struct.obus_bus_event*
%4 = tail call i32 @ps_summary_object(%struct.ps_summary* %1)
%5 = tail call i32 @obus_bus_event_unregister_object(%struct.obus_bus_event* %3, i32 %4)
ret i32 %5
}
int UtfTypeSize(int type) {
  const int TYPE_LENGTH[] = {1, 1, 2, 2, 4, 4, 8, 8, 4, 8, 4, 4, 0, 0, 0, 0};
  if (type >= 0x10)
    return 0;
  return TYPE_LENGTH[type];
}


x86 assembly (clang, -O0):
<UtfTypeSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeda(%rip),%rsi
mov    $0x40,%edx
call   1030 <memcpy@plt>
cmpl   $0x10,-0x8(%rbp)
jl     1146 <UtfTypeSize+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1151 <UtfTypeSize+0x41>
movslq -0x8(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UtfTypeSize>:
xor    %eax,%eax
cmp    $0xf,%edi
jg     1114 <UtfTypeSize+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
@__const.UtfTypeSize.TYPE_LENGTH = [16 x i32] [i32 1, i32 1, i32 2, i32 2, i32 4, i32 4, i32 8, i32 8, i32 4, i32 8, i32 4, i32 4, i32 0, i32 0, i32 0, i32 0]
define i32 @UtfTypeSize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [16 x i32]
store i32 %0, i32* %3
%5 = bitcast [16 x i32]* %4 to i8*
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 16
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %14
9: ; preds = %1
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %11
%13 = load i32, i32* %12
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
@__const.UtfTypeSize.TYPE_LENGTH = [16 x i32] [i32 1, i32 1, i32 2, i32 2, i32 4, i32 4, i32 8, i32 8, i32 4, i32 8, i32 4, i32 4, i32 0, i32 0, i32 0, i32 0]
define i32 @UtfTypeSize(i32 %0) {
%2 = icmp sgt i32 %0, 15
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [16 x i32], [16 x i32]* @__const.UtfTypeSize.TYPE_LENGTH, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
void ff_hevc_put_hevc_bi_pel_pixels64_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels64_8_sse4() {
ret void
}
int isOdd(unsigned int i) { return (i % 2); }


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

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

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

LLVM IR (-O2):
define i32 @isOdd(i32 %0) {
%2 = and i32 %0, 1
ret i32 %2
}
INI_btl_proofCtx() {}


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

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

LLVM IR (-O0):
define i32 @INI_btl_proofCtx() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @INI_btl_proofCtx() {
ret i32 undef
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XErrorEvent;

/* Variables and functions */
int get_XErrorEvent_type(void *_p) { return (int)((XErrorEvent *)_p)->type; }


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XErrorEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XErrorEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int d_blg_mm2(double *a1, double *a2) {
  return !(__builtin_islessgreater(*a1, *a2));
}


x86 assembly (clang, -O0):
<d_blg_mm2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
ucomisd (%rax),%xmm0
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_blg_mm2>:
movsd  (%rdi),%xmm0
xor    %eax,%eax
ucomisd (%rsi),%xmm0
sete   %al
ret

LLVM IR (-O0):
define i32 @d_blg_mm2(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* %5
%7 = load double*, double** %4
%8 = load double, double* %7
%9 = fcmp one double %6, %8
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @d_blg_mm2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
%5 = fcmp ueq double %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
int encrypt(int plain[]) {}


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

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

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

LLVM IR (-O2):
define i32 @encrypt(i32* nocapture readnone %0) {
ret i32 undef
}
sum(int a, ...) {
  __builtin_va_list l;
  __builtin_va_start(l, a);
  int const t = sumv(a, l);
  __builtin_va_end(l);
  return t;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
test   %al,%al
je     114c <sum+0x3c>
movaps %xmm0,-0xb0(%rbp)
movaps %xmm1,-0xa0(%rbp)
movaps %xmm2,-0x90(%rbp)
movaps %xmm3,-0x80(%rbp)
movaps %xmm4,-0x70(%rbp)
movaps %xmm5,-0x60(%rbp)
movaps %xmm6,-0x50(%rbp)
movaps %xmm7,-0x40(%rbp)
mov    %r9,-0xb8(%rbp)
mov    %r8,-0xc0(%rbp)
mov    %rcx,-0xc8(%rbp)
mov    %rdx,-0xd0(%rbp)
mov    %rsi,-0xd8(%rbp)
mov    %edi,-0x4(%rbp)
lea    -0xe0(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
mov    -0x4(%rbp),%edi
xor    %eax,%eax
lea    -0x20(%rbp),%rsi
call   1030 <sumv@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
sub    $0xd8,%rsp
mov    %rsi,0x28(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rcx,0x38(%rsp)
mov    %r8,0x40(%rsp)
mov    %r9,0x48(%rsp)
test   %al,%al
je     116b <sum+0x5b>
movaps %xmm0,0x50(%rsp)
movaps %xmm1,0x60(%rsp)
movaps %xmm2,0x70(%rsp)
movaps %xmm3,0x80(%rsp)
movaps %xmm4,0x90(%rsp)
movaps %xmm5,0xa0(%rsp)
movaps %xmm6,0xb0(%rsp)
movaps %xmm7,0xc0(%rsp)
lea    0x20(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xe0(%rsp),%rax
mov    %rax,0x8(%rsp)
movabs $0x3000000008,%rax
mov    %rax,(%rsp)
mov    %rsp,%rsi
xor    %eax,%eax
call   1030 <sumv@plt>
add    $0xd8,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @sum(i32 %0, ...) {
%2 = alloca i32
%3 = alloca [1 x %struct.__va_list_tag]
%4 = alloca i32
store i32 %0, i32* %2
%5 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%6 = bitcast %struct.__va_list_tag* %5 to i8*
%7 = load i32, i32* %2
%8 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%9 = call i32 (i32, %struct.__va_list_tag*, ...) bitcast (i32 (...)* @sumv to i32 (i32, %struct.__va_list_tag*, ...)*)(i32 %7, %struct.__va_list_tag* %8)
store i32 %9, i32* %4
%10 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%11 = bitcast %struct.__va_list_tag* %10 to i8*
%12 = load i32, i32* %4
ret i32 %12
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define i32 @sum(i32 %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %2, i64 0, i64 0
%5 = call i32 (i32, %struct.__va_list_tag*, ...) bitcast (i32 (...)* @sumv to i32 (i32, %struct.__va_list_tag*, ...)*)(i32 %0, %struct.__va_list_tag* %4)
ret i32 %5
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int stat(char const *const, struct stat *);
int gk_fexists(char const *const restrict fname) {
  struct stat status;
  if (stat(fname, &status) == -1)
    return 0;
  return S_ISREG(status.st_mode);
}


x86 assembly (clang, -O0):
<gk_fexists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
jne    114e <gk_fexists+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1159 <gk_fexists+0x39>
mov    -0x18(%rbp),%edi
call   1040 <S_ISREG@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gk_fexists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
cmp    $0xffffffff,%eax
je     1137 <gk_fexists+0x17>
mov    (%rsp),%edi
pop    %rax
jmp    1040 <S_ISREG@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @gk_fexists(i8* noalias nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i32 @S_ISREG(i32 %8)
br label %10
10: ; preds = %1, %6
%11 = phi i32 [ %9, %6 ], [ 0, %1 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ _get_sysfs_numeric(char *, char *, unsigned long long *);
unsigned long long get_sysfs_ullong(char *sysfs_attr) {
  unsigned long long number;
  if (_get_sysfs_numeric(sysfs_attr, "%llu", &number) == 0)
    return number;
  else
    return ((unsigned long long)-1);
}


x86 assembly (clang, -O0):
<get_sysfs_ullong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1030 <_get_sysfs_numeric@plt>
cmp    $0x0,%rax
jne    1147 <get_sysfs_ullong+0x37>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    114f <get_sysfs_ullong+0x3f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sysfs_ullong>:
push   %rax
lea    0xee8(%rip),%rsi
mov    %rsp,%rdx
call   1030 <_get_sysfs_numeric@plt>
neg    %rax
sbb    %rax,%rax
or     (%rsp),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%llu\00"
define i64 @get_sysfs_ullong(i8* %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
%4 = call i64 @_get_sysfs_numeric(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp eq i64 %4, 0
%6 = load i64, i64* %2
%7 = select i1 %5, i64 %6, i64 -1
ret i64 %7
}
void UART1_IRQHandler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<UART1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <UART1_IRQHandler+0x9>
jmp    1109 <UART1_IRQHandler+0x9>

x86 assembly (clang, -O2):
<UART1_IRQHandler>:
jmp    1100 <UART1_IRQHandler>

LLVM IR (-O0):
define void @UART1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @UART1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
int test_imm_9Aint8_mem(signed char *val) {
  return ((*val) & (0x9A << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Aint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
and    $0x9a,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Aint8_mem>:
testb  $0x9a,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_9Aint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 154
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_9Aint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -102
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void nop_function(void) {}


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

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

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

LLVM IR (-O2):
define void @nop_function() {
ret void
}
/* Type definitions */
struct clad_sb {
  int dummy;
};

/* Variables and functions */
int clad_sb_at(struct clad_sb *, int /*<<< orphan*/);
int clad_sb_firstbyte(struct clad_sb *me) { return clad_sb_at(me, 0); }


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

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

LLVM IR (-O0):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_firstbyte(%struct.clad_sb* %0) {
%2 = alloca %struct.clad_sb*
store %struct.clad_sb* %0, %struct.clad_sb** %2
%3 = load %struct.clad_sb*, %struct.clad_sb** %2
%4 = call i32 @clad_sb_at(%struct.clad_sb* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
%struct.clad_sb = type { i32 }
define i32 @clad_sb_firstbyte(%struct.clad_sb* %0) {
%2 = tail call i32 @clad_sb_at(%struct.clad_sb* %0, i32 0)
ret i32 %2
}
void wpas_p2p_completed(struct wpa_supplicant *wpa_s) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_completed(%struct.wpa_supplicant* %0) {
%2 = alloca %struct.wpa_supplicant*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %2
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
define void @wpas_p2p_completed(%struct.wpa_supplicant* nocapture %0) {
ret void
}
/* Variables and functions */
int syscall(int, int /*<<< orphan*/, int /*<<< orphan*/);
int kswitch() { return syscall(4, 0, 0); }


x86 assembly (clang, -O0):
<kswitch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <syscall@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<kswitch>:
mov    $0x4,%edi
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @kswitch() {
%1 = call i32 @syscall(i32 4, i32 0, i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @kswitch() {
%1 = tail call i32 @syscall(i32 4, i32 0, i32 0)
ret i32 %1
}
char *read(char *s) { return s; }


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

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

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

LLVM IR (-O2):
define i8* @read(i8* readnone returned %0) {
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isalpha(int);
void t_isalpha_0x68() {
  Assert_real((isalpha(104)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              525, ("isalpha should be 1 for h"));
}


x86 assembly (clang, -O0):
<t_isalpha_0x68>:
push   %rbp
mov    %rsp,%rbp
mov    $0x68,%edi
call   1030 <isalpha@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x20d,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0x68>:
push   %rax
mov    $0x68,%edi
call   1030 <isalpha@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x20d,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for h\00"
define void @t_isalpha_0x68() {
%1 = call i32 @isalpha(i32 104)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 525, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [26 x i8] c"isalpha should be 1 for h\00"
define void @t_isalpha_0x68() {
%1 = tail call i32 @isalpha(i32 104)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 525, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int foo(int x[]) { x[0] = 1; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movl   $0x1,(%rdi)
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
store i32* %0, i32** %3
%4 = load i32*, i32** %3
%5 = getelementptr inbounds i32, i32* %4, i64 0
store i32 1, i32* %5
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture writeonly %0) {
store i32 1, i32* %0
ret i32 undef
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int gethostname(char *, int);
int /*<<< orphan*/ perror(char *);
int gid_by_hostname() {
  char hostname[256];
  if (gethostname(hostname, 256) == -1) {
    perror("gethostname");
    return -1;
  }
  return (uint8_t)hostname[2];
}


x86 assembly (clang, -O0):
<gid_by_hostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x110(%rbp),%rdi
mov    $0x100,%esi
call   1040 <gethostname@plt>
cmp    $0xffffffff,%eax
jne    115d <gid_by_hostname+0x3d>
lea    0xeb4(%rip),%rdi
call   1030 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1167 <gid_by_hostname+0x47>
movsbl -0x10e(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gid_by_hostname>:
sub    $0x108,%rsp
mov    %rsp,%rdi
mov    $0x100,%esi
call   1040 <gethostname@plt>
cmp    $0xffffffff,%eax
je     1146 <gid_by_hostname+0x26>
movsbl 0x2(%rsp),%eax
add    $0x108,%rsp
ret
lea    0xeb3(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%eax
add    $0x108,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"gethostname\00"
define i32 @gid_by_hostname() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @gethostname(i8* %3, i32 256)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %12
8: ; preds = %0
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
store i32 %11, i32* %1
br label %12
12: ; preds = %8, %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [12 x i8] c"gethostname\00"
define i32 @gid_by_hostname() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 @gethostname(i8* %2, i32 256)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %11
7: ; preds = %0
%8 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
br label %11
11: ; preds = %7, %5
%12 = phi i32 [ -1, %5 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
struct sha256_ctx {
  int dummy;
};

/* Variables and functions */
void *sha224_read_ctx(struct sha256_ctx *, void *);
int /*<<< orphan*/ sha256_conclude_ctx(struct sha256_ctx *);
void *sha224_finish_ctx(struct sha256_ctx *ctx, void *resbuf) {
  sha256_conclude_ctx(ctx);
  return sha224_read_ctx(ctx, resbuf);
}


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

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

LLVM IR (-O0):
%struct.sha256_ctx = type { i32 }
define i8* @sha224_finish_ctx(%struct.sha256_ctx* %0, i8* %1) {
%3 = alloca %struct.sha256_ctx*
%4 = alloca i8*
store %struct.sha256_ctx* %0, %struct.sha256_ctx** %3
store i8* %1, i8** %4
%5 = load %struct.sha256_ctx*, %struct.sha256_ctx** %3
%6 = call i32 @sha256_conclude_ctx(%struct.sha256_ctx* %5)
%7 = load %struct.sha256_ctx*, %struct.sha256_ctx** %3
%8 = load i8*, i8** %4
%9 = call i8* @sha224_read_ctx(%struct.sha256_ctx* %7, i8* %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.sha256_ctx = type { i32 }
define i8* @sha224_finish_ctx(%struct.sha256_ctx* %0, i8* %1) {
%3 = tail call i32 @sha256_conclude_ctx(%struct.sha256_ctx* %0)
%4 = tail call i8* @sha224_read_ctx(%struct.sha256_ctx* %0, i8* %1)
ret i8* %4
}
/* Type definitions */
struct estimate {
  int dummy;
};

/* Variables and functions */
unsigned int estimate_calc_absolute(struct estimate *, unsigned int,
                                    unsigned int *);
unsigned int estimate_calc_remaining(struct estimate *est, unsigned int value) {
  unsigned int now_seconds;
  unsigned int end_seconds;
  if (!value)
    return 0xffffffff;
  end_seconds = estimate_calc_absolute(est, value, &now_seconds);
  return end_seconds - now_seconds;
}


x86 assembly (clang, -O0):
<estimate_calc_remaining>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1135 <estimate_calc_remaining+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1151 <estimate_calc_remaining+0x41>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x18(%rbp),%rdx
call   1030 <estimate_calc_absolute@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<estimate_calc_remaining>:
test   %esi,%esi
je     1128 <estimate_calc_remaining+0x18>
push   %rax
lea    0x4(%rsp),%rdx
call   1030 <estimate_calc_absolute@plt>
sub    0x4(%rsp),%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
%struct.estimate = type { i32 }
define i32 @estimate_calc_remaining(%struct.estimate* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %1, 0
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = call i32 @estimate_calc_absolute(%struct.estimate* %0, i32 %1, i32* %3)
%8 = load i32, i32* %3
%9 = sub i32 %7, %8
br label %10
10: ; preds = %2, %6
%11 = phi i32 [ %9, %6 ], [ -1, %2 ]
ret i32 %11
}
void gtk_main_iteration() {}


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

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

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

LLVM IR (-O2):
define void @gtk_main_iteration() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ user_hello_part2();
void test__hello_part2() { user_hello_part2(); }


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

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

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

LLVM IR (-O2):
define void @test__hello_part2() {
%1 = tail call i32 (...) @user_hello_part2()
ret void
}
int addDigits(int num) { return num ? ((num % 9) ? num % 9 : 9) : 0; }


x86 assembly (clang, -O0):
<addDigits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <addDigits+0x50>
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1138 <addDigits+0x38>
mov    -0x4(%rbp),%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
jmp    1145 <addDigits+0x45>
mov    $0x9,%eax
mov    %eax,-0x8(%rbp)
jmp    1145 <addDigits+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    115a <addDigits+0x5a>
xor    %eax,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <addDigits+0x5a>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<addDigits>:
test   %edi,%edi
je     1129 <addDigits+0x29>
movslq %edi,%rax
imul   $0x38e38e39,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
sub    %eax,%edi
mov    $0x9,%eax
cmovne %edi,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @addDigits(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i32, i32* %2
%7 = srem i32 %6, 9
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = srem i32 %10, 9
br label %13
12: ; preds = %5
br label %13
13: ; preds = %12, %9
%14 = phi i32 [ %11, %9 ], [ 9, %12 ]
br label %16
15: ; preds = %1
br label %16
16: ; preds = %15, %13
%17 = phi i32 [ %14, %13 ], [ 0, %15 ]
ret i32 %17
}

LLVM IR (-O2):
define i32 @addDigits(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = srem i32 %0, 9
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 9, i32 %4
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ send_command(int);
void normal_screen() { send_command(0xa6); }


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

x86 assembly (clang, -O2):
<normal_screen>:
mov    $0xa6,%edi
jmp    1030 <send_command@plt>

LLVM IR (-O0):
define void @normal_screen() {
%1 = call i32 @send_command(i32 166)
ret void
}

LLVM IR (-O2):
define void @normal_screen() {
%1 = tail call i32 @send_command(i32 166)
ret void
}