xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Msp430UsartShareP__0__RawInterrupts__txDone();
void HplMsp430Usart1P__Interrupts__txDone(void) {
  Msp430UsartShareP__0__RawInterrupts__txDone();
}


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

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

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

LLVM IR (-O2):
define void @HplMsp430Usart1P__Interrupts__txDone() {
%1 = tail call i32 (...) @Msp430UsartShareP__0__RawInterrupts__txDone()
ret void
}
int compare_integer(const void *a, const void *b) {
  return (*(int *)a - *(int *)b);
}


x86 assembly (clang, -O0):
<compare_integer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @compare_integer(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compare_integer(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
void crc32_combine(void) {}


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

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

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

LLVM IR (-O2):
define void @crc32_combine() {
ret void
}
long int scr_env_seconds_remaining() {
  long int secs = -1;
  return secs;
}


x86 assembly (clang, -O0):
<scr_env_seconds_remaining>:
push   %rbp
mov    %rsp,%rbp
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scr_env_seconds_remaining>:
mov    $0xffffffffffffffff,%rax
ret

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

LLVM IR (-O2):
define i64 @scr_env_seconds_remaining() {
ret i64 -1
}
/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
unsigned int __sw_hweight32(unsigned int);
int /*<<< orphan*/ gen___sw_hweight32(unsigned int, unsigned int);
int /*<<< orphan*/ limit2_u32(unsigned int *, int /*<<< orphan*/,
                              int /*<<< orphan*/);
unsigned int mksym_u32();
int test_1() {
  unsigned int w;
  unsigned int res;
  w = mksym_u32();
  limit2_u32(&w, 0, UINT_MAX);
  res = 0;
  res = __sw_hweight32(w);
  gen___sw_hweight32(w, res);
  return 0;
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <mksym_u32@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%edx
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
call   1030 <limit2_u32@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1060 <__sw_hweight32@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <gen___sw_hweight32@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rax
xor    %eax,%eax
call   1040 <mksym_u32@plt>
mov    %eax,0x4(%rsp)
mov    0x2e95(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rdi
xor    %esi,%esi
call   1030 <limit2_u32@plt>
mov    0x4(%rsp),%edi
call   1060 <__sw_hweight32@plt>
mov    0x4(%rsp),%edi
mov    %eax,%esi
call   1050 <gen___sw_hweight32@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@UINT_MAX = global i32 0
define i32 @test_1() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @mksym_u32()
store i32 %3, i32* %1
%4 = load i32, i32* @UINT_MAX
%5 = call i32 @limit2_u32(i32* %1, i32 0, i32 %4)
store i32 0, i32* %2
%6 = load i32, i32* %1
%7 = call i32 @__sw_hweight32(i32 %6)
store i32 %7, i32* %2
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = call i32 @gen___sw_hweight32(i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@UINT_MAX = global i32 0
define i32 @test_1() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @mksym_u32()
store i32 %3, i32* %1
%4 = load i32, i32* @UINT_MAX
%5 = call i32 @limit2_u32(i32* %1, i32 0, i32 %4)
%6 = load i32, i32* %1
%7 = call i32 @__sw_hweight32(i32 %6)
%8 = load i32, i32* %1
%9 = call i32 @gen___sw_hweight32(i32 %8, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
FILE *GetCompressed(char *name) {
  char cmd[256];
  sprintf(cmd, "gunzip -c %s", name);
  return (popen(cmd, "r"));
}


x86 assembly (clang, -O0):
<GetCompressed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
lea    0xeb9(%rip),%rsi
call   1030 <popen@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetCompressed>:
push   %rbx
sub    $0x100,%rsp
mov    %rdi,%rdx
lea    0xece(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <popen@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"gunzip -c %s\00"
@.str.1 = [2 x i8] c"r\00"
define i32* @GetCompressed(i8* %0) {
%2 = alloca i8*
%3 = alloca [256 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%8 = call i32* @popen(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"gunzip -c %s\00"
@.str.1 = [2 x i8] c"r\00"
define noalias i32* @GetCompressed(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32* @popen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int random_integer(int);
int random_integer_range(int n, int m) {
  assert(n >= 0);
  assert(m >= n);
  return n + random_integer(m - n);
}


x86 assembly (clang, -O0):
<random_integer_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x4(%rbp),%edi
call   1040 <random_integer@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_integer_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
sub    %ebp,%ebx
setge  %dil
call   1030 <assert@plt>
mov    %ebx,%edi
call   1040 <random_integer@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_integer_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp sge i32 %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = load i32, i32* %3
%17 = sub nsw i32 %15, %16
%18 = call i32 @random_integer(i32 %17)
%19 = add nsw i32 %14, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @random_integer_range(i32 %0, i32 %1) {
%3 = xor i32 %0, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = icmp sge i32 %1, %0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = sub nsw i32 %1, %0
%10 = tail call i32 @random_integer(i32 %9)
%11 = add nsw i32 %10, %0
ret i32 %11
}
int prefix(pfx, string)
register char const *pfx;
register char const *string;
{
  while (*pfx) {
    if (*pfx++ != *string++)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<prefix>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <prefix+0x56>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1151 <prefix+0x51>
movl   $0x0,-0x4(%rbp)
jmp    115d <prefix+0x5d>
jmp    110c <prefix+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prefix>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1127 <prefix+0x27>
lea    0x1(%rax),%rdx
cmp    (%rsi,%rax,1),%cl
mov    %rdx,%rax
je     1110 <prefix+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @prefix(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %9, %8 ]
%5 = phi i8* [ %1, %2 ], [ %10, %8 ]
%6 = load i8, i8* %4
%7 = icmp eq i8 %6, 0
br i1 %7, label %13, label %8
8: ; preds = %3
%9 = getelementptr inbounds i8, i8* %4, i64 1
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = icmp eq i8 %6, %11
br i1 %12, label %3, label %13
13: ; preds = %3, %8
%14 = phi i32 [ 0, %8 ], [ 1, %3 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_vector(double *v, int nl) { free((char *)(v + nl)); }


x86 assembly (clang, -O0):
<free_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_vector>:
movslq %esi,%rax
lea    (%rdi,%rax,8),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_vector(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds double, double* %5, i64 %7
%9 = bitcast double* %8 to i8*
%10 = call i32 @free(i8* %9)
ret void
}

LLVM IR (-O2):
define void @free_vector(double* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds double, double* %0, i64 %3
%5 = bitcast double* %4 to i8*
%6 = tail call i32 @free(i8* %5)
ret void
}
char *procprt_RDDSK_e(struct tstat *curstat, int avgval, int nsecs) {
  return "     -";
}


x86 assembly (clang, -O0):
<procprt_RDDSK_e>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xeeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<procprt_RDDSK_e>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.tstat = type opaque
@.str = [7 x i8] c" -\00"
define i8* @procprt_RDDSK_e(%struct.tstat* %0, i32 %1, i32 %2) {
%4 = alloca %struct.tstat*
%5 = alloca i32
%6 = alloca i32
store %struct.tstat* %0, %struct.tstat** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.tstat = type opaque
@.str = [7 x i8] c" -\00"
define i8* @procprt_RDDSK_e(%struct.tstat* nocapture readnone %0, i32 %1, i32 %2) {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ convSint2doub();
void convSlong2doub(void) { convSint2doub(); }


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

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

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

LLVM IR (-O2):
define void @convSlong2doub() {
%1 = tail call i32 (...) @convSint2doub()
ret void
}
/* Variables and functions */
int __builtin_aarch64_get_fpcr();
void f4(int *x) { *x = __builtin_aarch64_get_fpcr(); }


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

x86 assembly (clang, -O2):
<f4>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <__builtin_aarch64_get_fpcr@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @f4(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @__builtin_aarch64_get_fpcr()
store i32 %2, i32* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ isspace(char);
char getLetter(FILE *file) {
  char ch;
  while (!feof(file)) {
    ch = fgetc(file);
    if (!isspace(ch)) {
      return ch;
    }
  }
  assert(0);
  return 0;
}


x86 assembly (clang, -O0):
<getLetter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116a <getLetter+0x2a>
jmp    1198 <getLetter+0x58>
mov    -0x10(%rbp),%rdi
call   1030 <fgetc@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    1193 <getLetter+0x53>
mov    -0x11(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    11a3 <getLetter+0x63>
jmp    114c <getLetter+0xc>
xor    %edi,%edi
call   1050 <assert@plt>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLetter>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1060 <feof@plt>
test   %eax,%eax
jne    1174 <getLetter+0x34>
mov    %rbx,%rdi
call   1030 <fgetc@plt>
mov    %eax,%ebp
movsbl %al,%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    1150 <getLetter+0x10>
jmp    117d <getLetter+0x3d>
xor    %ebp,%ebp
xor    %edi,%edi
call   1050 <assert@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @getLetter(i32* %0) {
%2 = alloca i8
%3 = alloca i32*
%4 = alloca i8
store i32* %0, i32** %3
br label %5
5: ; preds = %18, %1
%6 = load i32*, i32** %3
%7 = call i32 @feof(i32* %6)
%8 = icmp ne i32 %7, 0
%9 = xor i1 %8, true
br i1 %9, label %10, label %19
10: ; preds = %5
%11 = load i32*, i32** %3
%12 = call signext i8 @fgetc(i32* %11)
store i8 %12, i8* %4
%13 = load i8, i8* %4
%14 = call i32 @isspace(i8 signext %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %10
%17 = load i8, i8* %4
store i8 %17, i8* %2
br label %21
18: ; preds = %10
br label %5
19: ; preds = %5
%20 = call i32 @assert(i32 0)
store i8 0, i8* %2
br label %21
21: ; preds = %19, %16
%22 = load i8, i8* %2
ret i8 %22
}

LLVM IR (-O2):
define signext i8 @getLetter(i32* nocapture %0) {
br label %2
2: ; preds = %5, %1
%3 = tail call i32 @feof(i32* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call signext i8 @fgetc(i32* %0)
%7 = tail call i32 @isspace(i8 signext %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %2
9: ; preds = %2
%10 = tail call i32 @assert(i32 0)
br label %11
11: ; preds = %5, %9
%12 = phi i8 [ 0, %9 ], [ %6, %5 ]
ret i8 %12
}
void ff_h264chroma_init_arm() {}


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

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

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

LLVM IR (-O2):
define void @ff_h264chroma_init_arm() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ glPopMatrix();
void pop_matrix(void) { glPopMatrix(); }


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

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

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

LLVM IR (-O2):
define void @pop_matrix() {
%1 = tail call i32 (...) @glPopMatrix()
ret void
}
void cfg80211_debugfs_rdev_del(struct cfg80211_registered_device *rdev) {}


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

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

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

LLVM IR (-O2):
%struct.cfg80211_registered_device = type opaque
define void @cfg80211_debugfs_rdev_del(%struct.cfg80211_registered_device* nocapture %0) {
ret void
}
swap(char **first, char **second) {
  char *temp;
  temp = *first;
  *first = *second;
  *second = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @swap(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
store i8* %4, i8** %0
store i8* %3, i8** %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse_string(char *);
int main() {
  char s[] = "Hello";
  reverse_string(s);
  puts(s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0xa(%rbp),%rdi
call   1030 <reverse_string@plt>
lea    -0xa(%rbp),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movw   $0x6f,0xc(%rsp)
movl   $0x6c6c6548,0x8(%rsp)
6c
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <reverse_string@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.s = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i8]
store i32 0, i32* %1
%3 = bitcast [6 x i8]* %2 to i8*
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @reverse_string(i8* %4)
%6 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%7 = call i32 @puts(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [6 x i8] c"Hello\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @reverse_string(i8* %2)
%4 = call i32 @puts(i8* %2)
ret i32 0
}
/* Variables and functions */
int omp_get_num_threads();
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int id, np;
#pragma omp parallel private(id, np)
  {
    np = omp_get_num_threads();
    id = omp_get_thread_num();
    printf("Hello from thread %d, out of %d threads\n", id, np);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <omp_get_num_threads@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <omp_get_thread_num@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xea7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <omp_get_num_threads@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <omp_get_thread_num@plt>
lea    0xeb8(%rip),%rdi
mov    %eax,%esi
mov    %ebx,%edx
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"Hello from thread %d, out of %d threads\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @omp_get_num_threads()
store i32 %3, i32* %2
%4 = call i32 (...) @omp_get_thread_num()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"Hello from thread %d, out of %d threads\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @omp_get_num_threads()
%2 = tail call i32 (...) @omp_get_thread_num()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %1)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ INFINITY;
int asuint64(int /*<<< orphan*/);
int zeroinfnan(uint64_t i) { return 2 * i - 1 >= 2 * asuint64(INFINITY) - 1; }


x86 assembly (clang, -O0):
<zeroinfnan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    0x2eba(%rip),%rax
mov    (%rax),%edi
call   1030 <asuint64@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zeroinfnan>:
push   %rbx
mov    %edi,%ebx
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
call   1030 <asuint64@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setle  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INFINITY = global i32 0
define i32 @zeroinfnan(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 2, %3
%5 = sub nsw i32 %4, 1
%6 = load i32, i32* @INFINITY
%7 = call i32 @asuint64(i32 %6)
%8 = mul nsw i32 2, %7
%9 = sub nsw i32 %8, 1
%10 = icmp sge i32 %5, %9
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
@INFINITY = global i32 0
define i32 @zeroinfnan(i32 %0) {
%2 = load i32, i32* @INFINITY
%3 = tail call i32 @asuint64(i32 %2)
%4 = icmp sle i32 %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ isvalidkey(char const *);
int /*<<< orphan*/ *strchr(char const *, char);
int haskey(const char *line) {
  return strchr(line, ':') != NULL && isvalidkey(line);
}


x86 assembly (clang, -O0):
<haskey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115f <haskey+0x3f>
mov    -0x8(%rbp),%rdi
call   1040 <isvalidkey@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<haskey>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1148 <haskey+0x28>
mov    %rbx,%rdi
call   1040 <isvalidkey@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @haskey(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32* @strchr(i8* %3, i8 signext 58)
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @isvalidkey(i8* %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @haskey(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 58)
%3 = icmp eq i32* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @isvalidkey(i8* %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
char getchar();
void clean_stdin(void) {
  while (getchar() != '\n')
    ;
}


x86 assembly (clang, -O0):
<clean_stdin>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <clean_stdin+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <clean_stdin+0x21>
jmp    1119 <clean_stdin+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_stdin>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <clean_stdin+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @clean_stdin() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @clean_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo();
void isr() { foo(); }


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

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

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

LLVM IR (-O2):
define void @isr() {
%1 = tail call i32 (...) @foo()
ret void
}
int vobb(void) { return 15; }


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

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

LLVM IR (-O0):
define i32 @vobb() {
ret i32 15
}

LLVM IR (-O2):
define i32 @vobb() {
ret i32 15
}
/* Variables and functions */
int partition(int *, int, int);
void quick_sort(int values[], int first, int last) {
  if (first < last) {
    int p = partition(values, first, last);
    quick_sort(values, first, p - 1);
    quick_sort(values, p + 1, last);
  }
}


x86 assembly (clang, -O0):
<quick_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1174 <quick_sort+0x54>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <partition@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1040 <quick_sort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1040 <quick_sort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quick_sort>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    %edx,%esi
jge    1166 <quick_sort+0x46>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r15
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <partition@plt>
mov    %eax,%ebx
lea    -0x1(%rbx),%edx
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <quick_sort@plt>
add    $0x1,%ebx
mov    %ebx,%ebp
cmp    %r14d,%ebx
jl     1140 <quick_sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %1, %2
br i1 %4, label %5, label %11
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ %1, %3 ]
%7 = tail call i32 @partition(i32* %0, i32 %6, i32 %2)
%8 = add nsw i32 %7, -1
tail call void @quick_sort(i32* %0, i32 %6, i32 %8)
%9 = add nsw i32 %7, 1
%10 = icmp slt i32 %9, %2
br i1 %10, label %5, label %11
11: ; preds = %5, %3
ret void
}
/* Variables and functions */
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
void print_error(void) {
  printf(gettext("Error setting new values. Common errors:\n"
                 "- Do you have proper administration rights? (super-user?)\n"
                 "- Is the governor you requested available and modprobed?\n"
                 "- Trying to set an invalid policy?\n"
                 "- Trying to set a specific frequency, but userspace governor "
                 "is not available,\n"
                 "   for example because of hardware which cannot be set to a "
                 "specific frequency\n"
                 "   or because the userspace governor isn't loaded?\n"));
}


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

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

LLVM IR (-O0):
@.str = [401 x i8] c"Error setting new values. Common errors:\0A- Do you have proper administration rights? (super-user?)\0A- Is the governor you requested available and modprobed?\0A- Trying to set an invalid policy?\0A- Trying to set a specific frequency, but userspace governor is not available,\0A for example because of hardware which cannot be set to a specific frequency\0A or because the userspace governor isn't loaded?\0A\00"
define void @print_error() {
%1 = call i8* @gettext(i8* getelementptr inbounds ([401 x i8], [401 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* %1)
ret void
}

LLVM IR (-O2):
@.str = [401 x i8] c"Error setting new values. Common errors:\0A- Do you have proper administration rights? (super-user?)\0A- Is the governor you requested available and modprobed?\0A- Trying to set an invalid policy?\0A- Trying to set a specific frequency, but userspace governor is not available,\0A for example because of hardware which cannot be set to a specific frequency\0A or because the userspace governor isn't loaded?\0A\00"
define void @print_error() {
%1 = tail call i8* @gettext(i8* getelementptr inbounds ([401 x i8], [401 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) %1)
ret void
}
int function(int a, int b) {
  int array[5];
  char c;
  return a + b + c;
}


x86 assembly (clang, -O0):
<function>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
movsbl -0x21(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<function>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @function(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [5 x i32]
%6 = alloca i8
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = add nsw i32 %7, %8
%10 = load i8, i8* %6
%11 = sext i8 %10 to i32
%12 = add nsw i32 %9, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @function(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int semget(key_t key, int nsems, int semflg) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<semget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<semget>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @semget(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @semget(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
char *strchr(char *, char);
char *string_trim_spaces(char *);
char *parse_executable_name(char *command) {
  command = string_trim_spaces(command);
  char *space = strchr(command, ' ');
  if (space)
    *space = '\0';
  char *executable = command;
  if (space)
    *space = ' ';
  return executable;
}


x86 assembly (clang, -O0):
<parse_executable_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_trim_spaces@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <parse_executable_name+0x3d>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1177 <parse_executable_name+0x57>
mov    -0x10(%rbp),%rax
movb   $0x20,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_executable_name>:
push   %rbx
call   1040 <string_trim_spaces@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113e <parse_executable_name+0x1e>
movb   $0x20,(%rax)
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @parse_executable_name(i8* %0) {
%2 = tail call i8* @string_trim_spaces(i8* %0)
%3 = tail call i8* @strchr(i8* dereferenceable(1) %2, i8 signext 32)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %1
store i8 32, i8* %3
br label %6
6: ; preds = %1, %5
ret i8* %2
}
/* Variables and functions */
unsigned int INT_MAX;
unsigned int main(int argc, char **argv) { return INT_MAX; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* @INT_MAX
ret i32 %5
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @INT_MAX
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(char *pname) {
  fprintf(stderr, "usage: %s [-s] [-c] [-p portnum]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"usage: %s [-s] [-c] [-p portnum]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"usage: %s [-s] [-c] [-p portnum]\0A\00"
define void @usage(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint32_t;

/* Variables and functions */
uint32_t get32(const void *p) {
  const uint8_t *x = (const uint8_t *)p;
  return (x[0] << 24) | (x[1] << 16) | (x[2] << 8) | x[3];
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
or     0xc(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x8(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0xc(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get32(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = shl i32 %8, 24
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
%13 = shl i32 %12, 16
%14 = or i32 %9, %13
%15 = load i32*, i32** %3
%16 = getelementptr inbounds i32, i32* %15, i64 2
%17 = load i32, i32* %16
%18 = shl i32 %17, 8
%19 = or i32 %14, %18
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 3
%22 = load i32, i32* %21
%23 = or i32 %19, %22
ret i32 %23
}

LLVM IR (-O2):
define i32 @get32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 4
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = shl i32 %7, 16
%9 = or i32 %8, %4
%10 = getelementptr inbounds i8, i8* %0, i64 8
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
%13 = shl i32 %12, 8
%14 = or i32 %9, %13
%15 = getelementptr inbounds i8, i8* %0, i64 12
%16 = bitcast i8* %15 to i32*
%17 = load i32, i32* %16
%18 = or i32 %14, %17
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ ispunct(int);
void t_ispunct_0x58() {
  Assert_real((ispunct(88) == 0),
              "/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_ispunct.c",
              445, ("ispunct should be 0 for X"));
}


x86 assembly (clang, -O0):
<t_ispunct_0x58>:
push   %rbp
mov    %rsp,%rbp
mov    $0x58,%edi
call   1030 <ispunct@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x1bd,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_ispunct_0x58>:
push   %rax
mov    $0x58,%edi
call   1030 <ispunct@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1bd,%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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for X\00"
define void @t_ispunct_0x58() {
%1 = call i64 @ispunct(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, 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_ispunct.c\00"
@.str.1 = [26 x i8] c"ispunct should be 0 for X\00"
define void @t_ispunct_0x58() {
%1 = tail call i64 @ispunct(i32 88)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 445, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
char uart_getc() {
  int val;
  while (((val = (*(volatile int *)((((0x7f000000) | 0x9000000000000000))))) &
          0x00800000) == 0)
    ;
  val >>= 24;
  return (char)val;
}


x86 assembly (clang, -O0):
<uart_getc>:
push   %rbp
mov    %rsp,%rbp
movabs $0x900000007f000000,%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
and    $0x800000,%eax
cmp    $0x0,%eax
jne    1126 <uart_getc+0x26>
jmp    1104 <uart_getc+0x4>
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_getc>:
movabs $0x900000007f000000,%rcx
nopw   0x0(%rax,%rax,1)
mov    (%rcx),%eax
test   $0x800000,%eax
je     1110 <uart_getc+0x10>
shr    $0x18,%eax
ret

LLVM IR (-O0):
define signext i8 @uart_getc() {
%1 = alloca i32
br label %2
2: ; preds = %6, %0
%3 = load volatile i32, i32* inttoptr (i64 -8070450530117222400 to i32*)
store i32 %3, i32* %1
%4 = and i32 %3, 8388608
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = load i32, i32* %1
%9 = ashr i32 %8, 24
store i32 %9, i32* %1
%10 = load i32, i32* %1
%11 = trunc i32 %10 to i8
ret i8 %11
}

LLVM IR (-O2):
define signext i8 @uart_getc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 -8070450530117222400 to i32*)
%3 = and i32 %2, 8388608
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = lshr i32 %2, 24
%7 = trunc i32 %6 to i8
ret i8 %7
}
int the_answer_is(void) { return 42; }


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

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

LLVM IR (-O0):
define i32 @the_answer_is() {
ret i32 42
}

LLVM IR (-O2):
define i32 @the_answer_is() {
ret i32 42
}
unsigned tegra_emc_dvfs_latency(unsigned int freq_khz) { return 4; }


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

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

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

LLVM IR (-O2):
define i32 @tegra_emc_dvfs_latency(i32 %0) {
ret i32 4
}
char xtob(c)
int c;
{ return (c - (((c >= '0') && (c <= '9')) ? '0' : '7')); }


x86 assembly (clang, -O0):
<xtob>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xtob+0x26>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x5(%rbp),%sil
mov    $0x37,%ecx
mov    $0x30,%edx
test   $0x1,%sil
cmovne %edx,%ecx
sub    %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtob>:
lea    -0x30(%rdi),%ecx
lea    0xc9(%rdi),%edx
lea    0xd0(%rdi),%eax
cmp    $0xa,%ecx
cmovae %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @xtob(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 57
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 48, i32 55
%13 = sub nsw i32 %3, %12
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @xtob(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = select i1 %3, i32 208, i32 201
%5 = add i32 %4, %0
%6 = trunc i32 %5 to i8
ret i8 %6
}
void slow_down() {
  int k;
  for (k = 0; k < 10000; k++)
    ;
}


x86 assembly (clang, -O0):
<slow_down>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x2710,-0x4(%rbp)
jge    112b <slow_down+0x2b>
jmp    111d <slow_down+0x1d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <slow_down+0xb>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @slow_down() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 10000
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @slow_down() {
ret void
}
int do_664() { return 664; }


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

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

LLVM IR (-O0):
define i32 @do_664() {
ret i32 664
}

LLVM IR (-O2):
define i32 @do_664() {
ret i32 664
}