xunge/DecIR huggingface dataset:
/* Variables and functions */
int isspace(unsigned char);
int space_or_null(int c) {
  if (c == 0)
    return 1;
  return isspace((unsigned char)c);
}


x86 assembly (clang, -O0):
<space_or_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <space_or_null+0x21>
movl   $0x1,-0x4(%rbp)
jmp    113f <space_or_null+0x2f>
mov    -0x8(%rbp),%eax
movzbl %al,%edi
call   1030 <isspace@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<space_or_null>:
test   %edi,%edi
je     111d <space_or_null+0xd>
movzbl %dil,%edi
jmp    1030 <isspace@plt>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @space_or_null(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %11
7: ; preds = %1
%8 = load i32, i32* %3
%9 = trunc i32 %8 to i8
%10 = call i32 @isspace(i8 zeroext %9)
store i32 %10, i32* %2
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @space_or_null(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = trunc i32 %0 to i8
%5 = tail call i32 @isspace(i8 zeroext %4)
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 1, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  int a, b;
  if (a > 0 || b > 0) {
    printf("a");
  } else {
    printf("b");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     113a <main+0x2a>
cmpl   $0x0,-0x18(%rbp)
jle    114b <main+0x3b>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
jmp    1157 <main+0x47>
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x62,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @putchar(i32 98)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRD0_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRD0_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRD0_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
union i2c_smbus_data {
  int byte;
};

/* Variables and functions */
int /*<<< orphan*/ I2C_SMBUS_BYTE;
int /*<<< orphan*/ I2C_SMBUS_READ;
scalar_t__ i2c_smbus_access(int, int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, union i2c_smbus_data *);
int wiringPiI2CRead(int fd) {
  union i2c_smbus_data data;
  if (i2c_smbus_access(fd, I2C_SMBUS_READ, 0, I2C_SMBUS_BYTE, &data))
    return -1;
  else
    return data.byte & 0xFF;
}


x86 assembly (clang, -O0):
<wiringPiI2CRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ebb(%rip),%rax
mov    (%rax),%esi
mov    0x2eba(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
lea    -0x10(%rbp),%r8
call   1030 <i2c_smbus_access@plt>
cmp    $0x0,%rax
je     1151 <wiringPiI2CRead+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    115c <wiringPiI2CRead+0x4c>
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wiringPiI2CRead>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    %rsp,%r8
xor    %edx,%edx
call   1030 <i2c_smbus_access@plt>
movzbl (%rsp),%ecx
neg    %rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @wiringPiI2CRead(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %union.i2c_smbus_data
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = load i32, i32* @I2C_SMBUS_READ
%7 = load i32, i32* @I2C_SMBUS_BYTE
%8 = call i64 @i2c_smbus_access(i32 %5, i32 %6, i32 0, i32 %7, %union.i2c_smbus_data* %4)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 -1, i32* %2
br label %15
11: ; preds = %1
%12 = bitcast %union.i2c_smbus_data* %4 to i32*
%13 = load i32, i32* %12
%14 = and i32 %13, 255
store i32 %14, i32* %2
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
%union.i2c_smbus_data = type { i32 }
@I2C_SMBUS_READ = global i32 0
@I2C_SMBUS_BYTE = global i32 0
define i32 @wiringPiI2CRead(i32 %0) {
%2 = alloca %union.i2c_smbus_data
%3 = bitcast %union.i2c_smbus_data* %2 to i8*
%4 = load i32, i32* @I2C_SMBUS_READ
%5 = load i32, i32* @I2C_SMBUS_BYTE
%6 = call i64 @i2c_smbus_access(i32 %0, i32 %4, i32 0, i32 %5, %union.i2c_smbus_data* %2)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds %union.i2c_smbus_data, %union.i2c_smbus_data* %2, i64 0, i32 0
%9 = load i32, i32* %8
%10 = and i32 %9, 255
%11 = select i1 %7, i32 %10, i32 -1
ret i32 %11
}
int test_imm_6Fuint8_mem(unsigned char *val) {
  return ((*val) & (0x6F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_6Fuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, 111
%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_6Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 111
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printmsg(const char *buf) { printf("Hello,world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello,world!\00"
define void @printmsg(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int fun1(int);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Hello World %d", fun1(100));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x64,%edi
call   1040 <fun1@plt>
mov    %eax,%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e92(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x64,%edi
call   1040 <fun1@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"Hello World %d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 @fun1(i32 100)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void print_d(double num) { printf("%lf\n", num); }


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

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

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lf\0A\00"
define void @print_d(double %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), double %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
int ioctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int usb_raw_ep0_stall(int fd) { return ioctl(fd, _IO('U', 12), 0); }


x86 assembly (clang, -O0):
<usb_raw_ep0_stall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x55,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
xor    %edx,%edx
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_raw_ep0_stall>:
push   %rbx
mov    %edi,%ebx
mov    $0x55,%edi
mov    $0xc,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i32 @usb_raw_ep0_stall(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 zeroext 85, i32 12)
%5 = call i32 @ioctl(i32 %3, i32 %4, i32 0)
ret i32 %5
}

LLVM IR (-O2):
define i32 @usb_raw_ep0_stall(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 85, i32 12)
%3 = tail call i32 @ioctl(i32 %0, i32 %2, i32 0)
ret i32 %3
}
/* Variables and functions */
void *malloc(size_t);
void *safe_malloc(size_t count) {
  void *p;
  p = malloc(count);
  if (p == NULL)
    ;
  return p;
}


x86 assembly (clang, -O0):
<safe_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1139 <safe_malloc+0x29>
jmp    1139 <safe_malloc+0x29>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_malloc>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @safe_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @safe_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Variables and functions */
int strcmp(char const *, char const *);
int isame(const void *p1, const void *p2) {
  return strcmp((const char *)p1, (const char *)p2);
}


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

x86 assembly (clang, -O2):
<isame>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @isame(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
__attribute__((always_)) void swapchar(void *a, void *b) {
  char const t = *((char *)b);
  *((char *)b) = *((char *)a);
  *((char *)a) = t;
}


x86 assembly (clang, -O0):
<swapchar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swapchar>:
mov    (%rsi),%al
mov    (%rdi),%cl
mov    %cl,(%rsi)
mov    %al,(%rdi)
ret

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

LLVM IR (-O2):
define void @swapchar(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = load i8, i8* %0
store i8 %4, i8* %1
store i8 %3, i8* %0
ret void
}
/* Variables and functions */
int strlen(char const *);
int Buf_len(const char *x) { return strlen(x) + 1; }


x86 assembly (clang, -O0):
<Buf_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Buf_len>:
push   %rax
call   1030 <strlen@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @Buf_len(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @strlen(i8* %3)
%5 = add nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @Buf_len(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
int main() {
  initscr();
  printw("Hola Bulma!!!");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
lea    0xe93(%rip),%rdi
call   1040 <printw@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
mov    $0x0,%al
call   1060 <getch@plt>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
lea    0xea1(%rip),%rdi
call   1040 <printw@plt>
xor    %eax,%eax
call   1050 <refresh@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hola Bulma!!!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initscr()
%3 = call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @refresh()
%5 = call i32 (...) @getch()
%6 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hola Bulma!!!\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = tail call i32 @printw(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @refresh()
%4 = tail call i32 (...) @getch()
%5 = tail call i32 (...) @endwin()
ret i32 0
}
unsigned char CheckId_SANYO(void) { return 1; }


x86 assembly (clang, -O0):
<CheckId_SANYO>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @CheckId_SANYO() {
ret i8 1
}

LLVM IR (-O2):
define zeroext i8 @CheckId_SANYO() {
ret i8 1
}
/* Type definitions */
struct qcc_message_list {
  int dummy;
};
struct qcc_list {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ qcc_list_init(struct qcc_list *);
void qcc_message_list_init(struct qcc_message_list *list) {
  qcc_list_init((struct qcc_list *)list);
}


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

x86 assembly (clang, -O2):
<qcc_message_list_init>:
jmp    1030 <qcc_list_init@plt>

LLVM IR (-O0):
%struct.qcc_message_list = type { i32 }
%struct.qcc_list = type { i32 }
define void @qcc_message_list_init(%struct.qcc_message_list* %0) {
%2 = alloca %struct.qcc_message_list*
store %struct.qcc_message_list* %0, %struct.qcc_message_list** %2
%3 = load %struct.qcc_message_list*, %struct.qcc_message_list** %2
%4 = bitcast %struct.qcc_message_list* %3 to %struct.qcc_list*
%5 = call i32 @qcc_list_init(%struct.qcc_list* %4)
ret void
}

LLVM IR (-O2):
%struct.qcc_message_list = type { i32 }
%struct.qcc_list = type { i32 }
define void @qcc_message_list_init(%struct.qcc_message_list* %0) {
%2 = bitcast %struct.qcc_message_list* %0 to %struct.qcc_list*
%3 = tail call i32 @qcc_list_init(%struct.qcc_list* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void err_quit(char *msg) {
  fputs(msg, stderr);
  fputc('\n', stderr);
  exit(1);
}


x86 assembly (clang, -O0):
<err_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<err_quit>:
push   %rbx
mov    0x2ea8(%rip),%rbx
mov    (%rbx),%esi
call   1030 <fputs@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1040 <fputc@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @err_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fputc(i8 signext 10, i32 %6)
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
define void @err_quit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fputc(i8 signext 10, i32 %4)
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ drawEndline();
int /*<<< orphan*/ drawWall();
int getMaxW();
void drawHorizontalBorder() {
  for (int i = 0; i <= getMaxW() + 2; ++i)
    drawWall();
  drawEndline();
}


x86 assembly (clang, -O0):
<drawHorizontalBorder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1050 <getMaxW@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    $0x2,%ecx
cmp    %ecx,%eax
jg     1171 <drawHorizontalBorder+0x41>
mov    $0x0,%al
call   1030 <drawWall@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <drawHorizontalBorder+0xf>
mov    $0x0,%al
call   1040 <drawEndline@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawHorizontalBorder>:
push   %rbx
xor    %eax,%eax
call   1050 <getMaxW@plt>
cmp    $0xfffffffe,%eax
jl     1168 <drawHorizontalBorder+0x38>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <drawWall@plt>
xor    %eax,%eax
call   1050 <getMaxW@plt>
add    $0x2,%eax
add    $0x1,%ebx
cmp    %eax,%ebx
jl     1150 <drawHorizontalBorder+0x20>
xor    %eax,%eax
pop    %rbx
jmp    1040 <drawEndline@plt>

LLVM IR (-O0):
define void @drawHorizontalBorder() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %9, %0
%3 = load i32, i32* %1
%4 = call i32 (...) @getMaxW()
%5 = add nsw i32 %4, 2
%6 = icmp sle i32 %3, %5
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = call i32 (...) @drawWall()
br label %9
9: ; preds = %7
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
br label %2
12: ; preds = %2
%13 = call i32 (...) @drawEndline()
ret void
}

LLVM IR (-O2):
define void @drawHorizontalBorder() {
%1 = tail call i32 (...) @getMaxW()
%2 = icmp slt i32 %1, -2
br i1 %2, label %3, label %5
3: ; preds = %5, %0
%4 = tail call i32 (...) @drawEndline()
ret void
5: ; preds = %0, %5
%6 = phi i32 [ %8, %5 ], [ 0, %0 ]
%7 = tail call i32 (...) @drawWall()
%8 = add nuw nsw i32 %6, 1
%9 = tail call i32 (...) @getMaxW()
%10 = add nsw i32 %9, 2
%11 = icmp slt i32 %6, %10
br i1 %11, label %5, label %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int restore_fd(int fd, int fd_restore, int file_no) {
  if ((fd != -1) && (fd_restore != -1)) {
    dup2(fd_restore, file_no);
    close(fd);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<restore_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
je     1164 <restore_fd+0x44>
cmpl   $0xffffffff,-0xc(%rbp)
je     1164 <restore_fd+0x44>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <dup2@plt>
mov    -0x8(%rbp),%edi
call   1040 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    116b <restore_fd+0x4b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<restore_fd>:
xor    %eax,%eax
cmp    $0xffffffff,%edi
je     1145 <restore_fd+0x25>
cmp    $0xffffffff,%esi
je     1145 <restore_fd+0x25>
push   %rbx
mov    %edi,%ebx
mov    %esi,%edi
mov    %edx,%esi
call   1030 <dup2@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @restore_fd(i32 %0, i32 %1, i32 %2) {
%4 = icmp ne i32 %0, -1
%5 = icmp ne i32 %1, -1
%6 = and i1 %4, %5
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = tail call i32 @dup2(i32 %1, i32 %2)
%9 = tail call i32 @close(i32 %0)
br label %10
10: ; preds = %3, %7
%11 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %11
}
/* Type definitions */
struct lifo {
  int dummy;
};

/* Variables and functions */
double exp2(double);
double pop(struct lifo *);
double opr_exp2(struct lifo *stack) {
  double op = pop(stack);
  return exp2(op);
}


x86 assembly (clang, -O0):
<opr_exp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pop@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <exp2@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opr_exp2>:
push   %rax
call   1040 <pop@plt>
pop    %rax
jmp    1030 <exp2@plt>

LLVM IR (-O0):
%struct.lifo = type { i32 }
define double @opr_exp2(%struct.lifo* %0) {
%2 = alloca %struct.lifo*
%3 = alloca double
store %struct.lifo* %0, %struct.lifo** %2
%4 = load %struct.lifo*, %struct.lifo** %2
%5 = call double @pop(%struct.lifo* %4)
store double %5, double* %3
%6 = load double, double* %3
%7 = call double @exp2(double %6)
ret double %7
}

LLVM IR (-O2):
%struct.lifo = type { i32 }
define double @opr_exp2(%struct.lifo* %0) {
%2 = tail call double @pop(%struct.lifo* %0)
%3 = tail call double @exp2(double %2)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ bar(int *);
void foo() {
  int i, j;
  int A[16];
  int X[16];
  int Y[16];
  int Z[16];
  for (i = 2; i < 9; i++) {
    X[i] = Y[i] + Z[i];
    A[i] = X[i - 1] + 1;
  }
  bar(A);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x2,-0x4(%rbp)
cmpl   $0x9,-0x4(%rbp)
jge    1175 <foo+0x65>
movslq -0x4(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%ecx
movslq -0x4(%rbp),%rax
add    -0x110(%rbp,%rax,4),%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x90(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x90(%rbp,%rax,4),%ecx
add    $0x1,%ecx
movslq -0x4(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1122 <foo+0x12>
lea    -0x50(%rbp),%rdi
call   1030 <bar@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x48,%rsp
mov    %rsp,%rdi
call   1030 <bar@plt>
add    $0x48,%rsp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [16 x i32]
%4 = alloca [16 x i32]
%5 = alloca [16 x i32]
%6 = alloca [16 x i32]
store i32 2, i32* %1
br label %7
7: ; preds = %32, %0
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 9
br i1 %9, label %10, label %35
10: ; preds = %7
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [16 x i32], [16 x i32]* %5, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = add nsw i32 %14, %18
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %21
store i32 %19, i32* %22
%23 = load i32, i32* %1
%24 = sub nsw i32 %23, 1
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %1
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %30
store i32 %28, i32* %31
br label %32
32: ; preds = %10
%33 = load i32, i32* %1
%34 = add nsw i32 %33, 1
store i32 %34, i32* %1
br label %7
35: ; preds = %7
%36 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 0
%37 = call i32 @bar(i32* %36)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [16 x i32]
%2 = bitcast [16 x i32]* %1 to i8*
%3 = getelementptr inbounds [16 x i32], [16 x i32]* %1, i64 0, i64 0
%4 = call i32 @bar(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: "
                  "./simple_aes <FILE> [KEY]\n"
                  "FILE: the file to encrypt.\n"
                  "KEY: the key to use; if not specified, "
                  "attempt to read key from stdin.\n"
                  "If no key is found, create a random key and print "
                  "it to stdout once finished.");
}


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

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [209 x i8] c"Usage: ./simple_aes <FILE> [KEY]\0AFILE: the file to encrypt.\0AKEY: the key to use; if not specified, attempt to read key from stdin.\0AIf no key is found, create a random key and print it to stdout once finished.\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [209 x i8] c"Usage: ./simple_aes <FILE> [KEY]\0AFILE: the file to encrypt.\0AKEY: the key to use; if not specified, attempt to read key from stdin.\0AIf no key is found, create a random key and print it to stdout once finished.\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([209 x i8], [209 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned long strtoul(char const *, char **, int);
unsigned long wcfs_strtoul(const char *str) {
  char *end;
  return strtoul(str, &end, 16);
}


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

x86 assembly (clang, -O2):
<wcfs_strtoul>:
push   %rax
mov    %rsp,%rsi
mov    $0x10,%edx
call   1030 <strtoul@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i64 @wcfs_strtoul(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtoul(i8* %4, i8** %3, i32 16)
ret i64 %5
}

LLVM IR (-O2):
define i64 @wcfs_strtoul(i8* %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i64 @strtoul(i8* %0, i8** %2, i32 16)
ret i64 %4
}
double linearInterpolate(double y1, double y2, double x) {
  return (y1 * (1 - x) + y2 * x);
}


x86 assembly (clang, -O0):
<linearInterpolate>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm2
subsd  -0x18(%rbp),%xmm2
movsd  -0x10(%rbp),%xmm1
mulsd  -0x18(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linearInterpolate>:
movsd  0xef8(%rip),%xmm3
subsd  %xmm2,%xmm3
mulsd  %xmm2,%xmm1
mulsd  %xmm3,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @linearInterpolate(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %6
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = load double, double* %6
%12 = fmul double %10, %11
%13 = call double @llvm.fmuladd.f64(double %7, double %9, double %12)
ret double %13
}

LLVM IR (-O2):
define double @linearInterpolate(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %2
%5 = fmul double %1, %2
%6 = tail call double @llvm.fmuladd.f64(double %0, double %4, double %5)
ret double %6
}
void __srpc_wait() {}


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

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

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

LLVM IR (-O2):
define void @__srpc_wait() {
ret void
}
char *langRomTypeWaveSCSI128() { return "128kB WAVE-SCSI"; }


x86 assembly (clang, -O0):
<langRomTypeWaveSCSI128>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"128kB WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI128() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [16 x i8] c"128kB WAVE-SCSI\00"
define i8* @langRomTypeWaveSCSI128() {
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0)
}
void NMI_Handler() {}


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

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

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

LLVM IR (-O2):
define void @NMI_Handler() {
ret void
}
/* Variables and functions */
int stricmp(char const *, char const *);
int strcasecmp(const char *s1, const char *s2) { return stricmp(s1, s2); }


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

x86 assembly (clang, -O2):
<strcasecmp>:
jmp    1030 <stricmp@plt>

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

LLVM IR (-O2):
define i32 @strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @stricmp(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
unsigned short sdmmc_read16(unsigned short);
int /*<<< orphan*/ sdmmc_write16(unsigned short, unsigned short);
void sdmmc_mask16(unsigned short reg, const unsigned short clear,
                  const unsigned short set) {
  unsigned short val = sdmmc_read16(reg);
  val &= ~clear;
  val |= set;
  sdmmc_write16(reg, val);
}


x86 assembly (clang, -O0):
<sdmmc_mask16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movzwl -0x2(%rbp),%edi
call   1040 <sdmmc_read16@plt>
mov    %ax,-0x8(%rbp)
movzwl -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
movzwl -0x8(%rbp),%eax
and    %ecx,%eax
mov    %ax,-0x8(%rbp)
movzwl -0x6(%rbp),%ecx
movzwl -0x8(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x8(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzwl -0x8(%rbp),%esi
call   1030 <sdmmc_write16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdmmc_mask16>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1040 <sdmmc_read16@plt>
not    %ebp
and    %eax,%ebp
or     %r14d,%ebp
movzwl %bp,%esi
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sdmmc_write16@plt>

LLVM IR (-O0):
define void @sdmmc_mask16(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
%7 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%8 = load i16, i16* %4
%9 = call zeroext i16 @sdmmc_read16(i16 zeroext %8)
store i16 %9, i16* %7
%10 = load i16, i16* %5
%11 = zext i16 %10 to i32
%12 = xor i32 %11, -1
%13 = load i16, i16* %7
%14 = zext i16 %13 to i32
%15 = and i32 %14, %12
%16 = trunc i32 %15 to i16
store i16 %16, i16* %7
%17 = load i16, i16* %6
%18 = zext i16 %17 to i32
%19 = load i16, i16* %7
%20 = zext i16 %19 to i32
%21 = or i32 %20, %18
%22 = trunc i32 %21 to i16
store i16 %22, i16* %7
%23 = load i16, i16* %4
%24 = load i16, i16* %7
%25 = call i32 @sdmmc_write16(i16 zeroext %23, i16 zeroext %24)
ret void
}

LLVM IR (-O2):
define void @sdmmc_mask16(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = tail call zeroext i16 @sdmmc_read16(i16 zeroext %0)
%5 = xor i16 %1, -1
%6 = and i16 %4, %5
%7 = or i16 %6, %2
%8 = tail call i32 @sdmmc_write16(i16 zeroext %0, i16 zeroext %7)
ret void
}
int test_imm_BAint8_reg(signed char val) {
  return ((val) & (-0xBA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BAint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff46,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_BAint8_reg>:
test   $0xffffff46,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_BAint8_reg(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = and i32 %2, -186
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int getuid() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @getuid() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ActivateLCDPositioner();
int main() { ActivateLCDPositioner(); }


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @ActivateLCDPositioner()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @ActivateLCDPositioner()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void info() {
  printf("\n [ERROR] The command you are executing is not valid, Execute one "
         "from the following list of commands. \n");
  printf("	vfs create <file_system_name> \n 	vfs open "
         "<file_system_name/file_system_path> \n 	vfs save "
         "<file_name_to_be_saved>\n 	vfs close \n 	vfs extract "
         "<file_name_to_be_extracted>\n 	vfs status \n 	quit \n");
}


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

x86 assembly (clang, -O2):
<info>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf44(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [105 x i8] c"\0A [ERROR] The command you are executing is not valid, Execute one from the following list of commands. \0A\00"
@.str.1 = [193 x i8] c"\09vfs create <file_system_name> \0A \09vfs open <file_system_name/file_system_path> \0A \09vfs save <file_name_to_be_saved>\0A \09vfs close \0A \09vfs extract <file_name_to_be_extracted>\0A \09vfs status \0A \09quit \0A\00"
define void @info() {
%1 = call i32 @printf(i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([193 x i8], [193 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [104 x i8] c"\0A [ERROR] The command you are executing is not valid, Execute one from the following list of commands. \00"
@str.2 = [192 x i8] c"\09vfs create <file_system_name> \0A \09vfs open <file_system_name/file_system_path> \0A \09vfs save <file_name_to_be_saved>\0A \09vfs close \0A \09vfs extract <file_name_to_be_extracted>\0A \09vfs status \0A \09quit \00"
define void @info() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([104 x i8], [104 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([192 x i8], [192 x i8]* @str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _errorloop();
void PendSV_Handler() { _errorloop(); }


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

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

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

LLVM IR (-O2):
define void @PendSV_Handler() {
%1 = tail call i32 (...) @_errorloop()
ret void
}
/* Variables and functions */
int _child_open(int const, char const *, char const *, char *);
int child_open(const int read_flag, const char *fname, const char *filterprog) {
  int fd;
  if (read_flag == 0)
    fd = _child_open(read_flag, fname, filterprog, "-d");
  else
    fd = _child_open(read_flag, fname, filterprog, 0);
  return fd;
}


x86 assembly (clang, -O0):
<child_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    114c <child_open+0x3c>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec1(%rip),%rcx
call   1030 <_child_open@plt>
mov    %eax,-0x1c(%rbp)
jmp    1163 <child_open+0x53>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
call   1030 <_child_open@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_open>:
test   %edi,%edi
je     111b <child_open+0xb>
xor    %ecx,%ecx
jmp    1030 <_child_open@plt>
lea    0xede(%rip),%rcx
xor    %edi,%edi
jmp    1030 <_child_open@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-d\00"
define i32 @child_open(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = call i32 @_child_open(i32 %11, i8* %12, i8* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 %14, i32* %7
br label %20
15: ; preds = %3
%16 = load i32, i32* %4
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 @_child_open(i32 %16, i8* %17, i8* %18, i8* null)
store i32 %19, i32* %7
br label %20
20: ; preds = %15, %10
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
@.str = [3 x i8] c"-d\00"
define i32 @child_open(i32 %0, i8* %1, i8* %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @_child_open(i32 0, i8* %1, i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
7: ; preds = %3
%8 = tail call i32 @_child_open(i32 %0, i8* %1, i8* %2, i8* null)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ %6, %5 ], [ %8, %7 ]
ret i32 %10
}
/* Type definitions */
struct list {
  int dummy;
};

/* Variables and functions */
struct list *list_new(int /*<<< orphan*/);
struct list *dict_new() {
  return list_new(0);
}


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

x86 assembly (clang, -O2):
<dict_new>:
xor    %edi,%edi
jmp    1030 <list_new@plt>

LLVM IR (-O0):
%struct.list = type { i32 }
define %struct.list* @dict_new() {
%1 = call %struct.list* @list_new(i32 0)
ret %struct.list* %1
}

LLVM IR (-O2):
%struct.list = type { i32 }
define %struct.list* @dict_new() {
%1 = tail call %struct.list* @list_new(i32 0)
ret %struct.list* %1
}
void destruirInt(void *e) {}


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

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

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

LLVM IR (-O2):
define void @destruirInt(i8* nocapture %0) {
ret void
}
void open_log_monospace(void) {}


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

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

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

LLVM IR (-O2):
define void @open_log_monospace() {
ret void
}
/* Variables and functions */
bool equalKeys(void *keyA, int hashA, void *keyB, int hashB,
               bool (*equals)(void *, void *)) {
  if (keyA == keyB) {
    return true;
  }
  if (hashA != hashB) {
    return false;
  }
  return equals(keyA, keyB);
}


x86 assembly (clang, -O0):
<equalKeys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1134 <equalKeys+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115d <equalKeys+0x5d>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     114c <equalKeys+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    115d <equalKeys+0x5d>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalKeys>:
cmp    %rdx,%rdi
je     1111 <equalKeys+0x11>
xor    %eax,%eax
cmp    %ecx,%esi
jne    1116 <equalKeys+0x16>
mov    %rdx,%rsi
jmp    *%r8
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @equalKeys(i8* %0, i32 %1, i8* %2, i32 %3, i32 (i8*, i8*)* nocapture %4) {
%6 = icmp eq i8* %0, %2
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i32 %1, %3
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 %4(i8* %0, i8* %2)
br label %11
11: ; preds = %7, %5, %9
%12 = phi i32 [ %10, %9 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
int isPowerOfTwo(int x) { return x > 0 && (x & (x - 1)) == 0; }


x86 assembly (clang, -O0):
<isPowerOfTwo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    112a <isPowerOfTwo+0x2a>
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPowerOfTwo>:
test   %edi,%edi
jle    110f <isPowerOfTwo+0xf>
lea    -0x1(%rdi),%ecx
xor    %eax,%eax
test   %ecx,%edi
sete   %al
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isPowerOfTwo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = and i32 %6, %8
%10 = icmp eq i32 %9, 0
br label %11
11: ; preds = %5, %1
%12 = phi i1 [ false, %1 ], [ %10, %5 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isPowerOfTwo(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i32 @llvm.ctpop.i32(i32 %0)
%5 = icmp ult i32 %4, 2
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %8
}