xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
struct frame {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ get_u64(struct frame *);
void get_u128(struct frame *frm, uint64_t *l, uint64_t *h) {
  *h = get_u64(frm);
  *l = get_u64(frm);
}


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

x86 assembly (clang, -O2):
<get_u128>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <get_u64@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
call   1030 <get_u64@plt>
mov    %eax,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.frame = type { i32 }
define void @get_u128(%struct.frame* %0, i32* %1, i32* %2) {
%4 = alloca %struct.frame*
%5 = alloca i32*
%6 = alloca i32*
store %struct.frame* %0, %struct.frame** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load %struct.frame*, %struct.frame** %4
%8 = call i32 @get_u64(%struct.frame* %7)
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load %struct.frame*, %struct.frame** %4
%11 = call i32 @get_u64(%struct.frame* %10)
%12 = load i32*, i32** %5
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
%struct.frame = type { i32 }
define void @get_u128(%struct.frame* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @get_u64(%struct.frame* %0)
store i32 %4, i32* %2
%5 = tail call i32 @get_u64(%struct.frame* %0)
store i32 %5, i32* %1
ret void
}
int f(_Bool x) {
  int y;
  if (x != 1)
    y = 0;
  else
    y = 1;
  return y;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
and    $0x1,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x1,%eax
je     1129 <f+0x29>
movl   $0x0,-0x8(%rbp)
jmp    1130 <f+0x30>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @f(i1 zeroext %0) {
%2 = zext i1 %0 to i32
ret i32 %2
}
/* Variables and functions */
scalar_t__ strpbrk(char *, char *);
int IsOneOf(char c, char *set) {
  static char buffer[2];
  buffer[1] = '\0';
  buffer[0] = c;
  return (int)strpbrk(buffer, set);
}


x86 assembly (clang, -O0):
<IsOneOf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,0x2f01(%rip)
mov    -0x1(%rbp),%al
mov    %al,0x2ef7(%rip)
mov    -0x10(%rbp),%rsi
lea    0x2eec(%rip),%rdi
call   1030 <strpbrk@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsOneOf>:
movb   $0x0,0x2f13(%rip)
lea    0x2f0b(%rip),%rax
mov    %dil,0x2f04(%rip)
mov    %rax,%rdi
jmp    1030 <strpbrk@plt>

LLVM IR (-O0):
@IsOneOf.buffer = internal global [2 x i8] zeroinitializer
define i32 @IsOneOf(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
store i8 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @IsOneOf.buffer, i64 0, i64 1)
%5 = load i8, i8* %3
store i8 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @IsOneOf.buffer, i64 0, i64 0)
%6 = load i8*, i8** %4
%7 = call i64 @strpbrk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @IsOneOf.buffer, i64 0, i64 0), i8* %6)
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
@IsOneOf.buffer = internal global [2 x i8] zeroinitializer
define i32 @IsOneOf(i8 signext %0, i8* %1) {
store i8 0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @IsOneOf.buffer, i64 0, i64 1)
store i8 %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @IsOneOf.buffer, i64 0, i64 0)
%3 = tail call i64 @strpbrk(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @IsOneOf.buffer, i64 0, i64 0), i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
double M_PI;
int find_wrap(double voxelL_value, double voxelR_value) {
  double difference;
  int wrap_value;
  difference = voxelL_value - voxelR_value;
  if (difference > M_PI)
    wrap_value = -1;
  else if (difference < -M_PI)
    wrap_value = 1;
  else
    wrap_value = 0;
  return wrap_value;
}


x86 assembly (clang, -O0):
<find_wrap>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    0x2ebf(%rip),%rax
ucomisd (%rax),%xmm0
jbe    113f <find_wrap+0x3f>
movl   $0xffffffff,-0x1c(%rbp)
jmp    1188 <find_wrap+0x88>
movsd  -0x18(%rbp),%xmm1
mov    0x2e9d(%rip),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
ucomisd %xmm1,%xmm0
jbe    117c <find_wrap+0x7c>
movl   $0x1,-0x1c(%rbp)
jmp    1183 <find_wrap+0x83>
movl   $0x0,-0x1c(%rbp)
jmp    1188 <find_wrap+0x88>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_wrap>:
subsd  %xmm1,%xmm0
mov    0x2edd(%rip),%rax
movsd  (%rax),%xmm1
movapd 0xee9(%rip),%xmm2
xorpd  %xmm1,%xmm2
xor    %ecx,%ecx
ucomisd %xmm0,%xmm2
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
@M_PI = global double 0.000000e+00
define i32 @find_wrap(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca i32
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = load double, double* %4
%9 = fsub double %7, %8
store double %9, double* %5
%10 = load double, double* %5
%11 = load double, double* @M_PI
%12 = fcmp ogt double %10, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 -1, i32* %6
br label %22
14: ; preds = %2
%15 = load double, double* %5
%16 = load double, double* @M_PI
%17 = fneg double %16
%18 = fcmp olt double %15, %17
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 1, i32* %6
br label %21
20: ; preds = %14
store i32 0, i32* %6
br label %21
21: ; preds = %20, %19
br label %22
22: ; preds = %21, %13
%23 = load i32, i32* %6
ret i32 %23
}

LLVM IR (-O2):
@M_PI = global double 0.000000e+00
define i32 @find_wrap(double %0, double %1) {
%3 = fsub double %0, %1
%4 = load double, double* @M_PI
%5 = fcmp ogt double %3, %4
%6 = fneg double %4
%7 = fcmp olt double %3, %6
%8 = zext i1 %7 to i32
%9 = select i1 %5, i32 -1, i32 %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ hd44780_ll_data_read();
uint8_t hd44780_read_data_from_cg_or_ddram(void) {
  return (hd44780_ll_data_read());
}


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

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

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

LLVM IR (-O2):
define i32 @hd44780_read_data_from_cg_or_ddram() {
%1 = tail call i32 (...) @hd44780_ll_data_read()
ret i32 %1
}
int function_c() { return 3; }


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

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

LLVM IR (-O0):
define i32 @function_c() {
ret i32 3
}

LLVM IR (-O2):
define i32 @function_c() {
ret i32 3
}
double time_used(void) { return 0.; }


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

x86 assembly (clang, -O2):
<time_used>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @time_used() {
ret double 0.000000e+00
}

LLVM IR (-O2):
define double @time_used() {
ret double 0.000000e+00
}
/* Variables and functions */
scalar_t__ io_is_transmit_empty();
int /*<<< orphan*/ outportb(int, char);
void write_serial(char a) {
  while (io_is_transmit_empty() == 0)
    ;
  outportb(0x3f8, a);
}


x86 assembly (clang, -O0):
<write_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <io_is_transmit_empty@plt>
cmp    $0x0,%rax
jne    1144 <write_serial+0x24>
jmp    112e <write_serial+0xe>
mov    $0x3f8,%edi
movsbl -0x1(%rbp),%esi
call   1040 <outportb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <io_is_transmit_empty@plt>
test   %rax,%rax
je     1130 <write_serial+0x10>
movsbl %bl,%esi
mov    $0x3f8,%edi
pop    %rbx
jmp    1040 <outportb@plt>

LLVM IR (-O0):
define void @write_serial(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %6, %1
%4 = call i64 (...) @io_is_transmit_empty()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
br label %3
7: ; preds = %3
%8 = load i8, i8* %2
%9 = call i32 @outportb(i32 1016, i8 signext %8)
ret void
}

LLVM IR (-O2):
define void @write_serial(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i64 (...) @io_is_transmit_empty()
%4 = icmp eq i64 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
%6 = tail call i32 @outportb(i32 1016, i8 signext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lt_fatal(char *, int, char *);
scalar_t__ malloc(size_t);
void *xmalloc(size_t num) {
  void *p = (void *)malloc(num);
  if (!p)
    lt_fatal("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/"
             "src/xzdec/.libs/lt-lzmadec.c",
             311, "memory exhausted");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115c <xmalloc+0x3c>
lea    0xeb5(%rip),%rdi
mov    $0x137,%esi
lea    0xf47(%rip),%rdx
call   1030 <lt_fatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1146 <xmalloc+0x26>
lea    0xecb(%rip),%rdi
lea    0xf62(%rip),%rdx
mov    $0x137,%esi
call   1030 <lt_fatal@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/src/xzdec/.libs/lt-lzmadec.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = icmp ne i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %1
%10 = call i32 @lt_fatal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sim9108/SDKS/refs/heads/master/LibLzma/src/xzdec/.libs/lt-lzmadec.c\00"
@.str.1 = [17 x i8] c"memory exhausted\00"
define i8* @xmalloc(i64 %0) {
%2 = tail call i64 @malloc(i64 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lt_fatal(i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str, i64 0, i64 0), i32 311, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
%7 = inttoptr i64 %2 to i8*
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvSetShutterMode(char byBoardNum, char byMode) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvSetShutterMode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
lea    0xed5(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvSetShutterMode(i8 signext %0, i8 signext %1) {
%3 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
short ishortand(short x, short y) {
  x &= 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<ishortand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x2(%rbp),%eax
and    $0x18,%eax
mov    %ax,-0x2(%rbp)
cmpw   $0x0,-0x2(%rbp)
jne    1145 <ishortand+0x35>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishortand>:
push   %rbx
mov    %edi,%ebx
and    $0x18,%bx
jne    1120 <ishortand+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i16 @ishortand(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = and i32 %6, 24
%8 = trunc i32 %7 to i16
store i16 %8, i16* %3
%9 = load i16, i16* %3
%10 = icmp ne i16 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %2
%12 = call i32 @foo(i8* null)
br label %13
13: ; preds = %11, %2
%14 = load i16, i16* %3
ret i16 %14
}

LLVM IR (-O2):
define signext i16 @ishortand(i16 signext %0, i16 signext %1) {
%3 = and i16 %0, 24
%4 = icmp eq i16 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i16 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ reverse_words1(char *);
void main() {
  char str[] = "  t um jo aaye    jindagi me baat ban gayi";
  printf("string is  before \n %s\n", str);
  reverse_words1(str);
  printf("string is  after \n %s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x2b,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rsi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
call   1050 <reverse_words1@plt>
lea    -0x30(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movups 0xeef(%rip),%xmm0
movups %xmm0,0x1b(%rsp)
movaps 0xed8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebc(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xedc(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <reverse_words1@plt>
lea    0xeda(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [43 x i8] c" t um jo aaye jindagi me baat ban gayi\00"
@.str = [24 x i8] c"string is before \0A %s\0A\00"
@.str.1 = [23 x i8] c"string is after \0A %s\0A\00"
define void @main() {
%1 = alloca [43 x i8]
%2 = bitcast [43 x i8]* %1 to i8*
%3 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%6 = call i32 @reverse_words1(i8* %5)
%7 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
@__const.main.str = [43 x i8] c" t um jo aaye jindagi me baat ban gayi\00"
@.str = [24 x i8] c"string is before \0A %s\0A\00"
@.str.1 = [23 x i8] c"string is after \0A %s\0A\00"
define void @main() {
%1 = alloca [43 x i8]
%2 = getelementptr inbounds [43 x i8], [43 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @reverse_words1(i8* %2)
%5 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret void
}
int test_imm_BDint8_reg(signed char val) {
  return ((val) & (0xBD << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_BDint8_reg>:
test   $0xbd,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_BDint8_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, 189
%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_BDint8_reg(i8 signext %0) {
%2 = and i8 %0, -67
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int is_whitespace(char c) { return c == ' ' || c == '\n' || c == '\t'; }


x86 assembly (clang, -O0):
<is_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x2(%rbp)
je     113b <is_whitespace+0x3b>
movsbl -0x1(%rbp),%eax
cmp    $0x9,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_whitespace>:
mov    $0x1,%eax
cmp    $0xa,%dil
je     1111 <is_whitespace+0x11>
cmp    $0x20,%dil
jne    1112 <is_whitespace+0x12>
ret
xor    %eax,%eax
cmp    $0x9,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @is_whitespace(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp eq i32 %4, 32
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 10
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 9
br label %14
14: ; preds = %10, %6, %1
%15 = phi i1 [ true, %6 ], [ true, %1 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_whitespace(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %5
i8 10, label %5
]
2: ; preds = %1
%3 = icmp eq i8 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
void EPIConfigNoModeSet(unsigned long ulBase, unsigned long ulConfig,
                        unsigned long ulFrameCount, unsigned long ulMaxWait) {
  ;
  ;
  ;
  ulConfig &= ~0x03C00000;
  ulConfig |= ulFrameCount << 22;
  ulConfig &= ~0x0000FF00;
  ulConfig |= ulMaxWait << 8;
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = ulConfig;
}


x86 assembly (clang, -O0):
<EPIConfigNoModeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
and    $0xfffffffffc3fffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
shl    $0x16,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
and    $0xffffffffffff00ff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPIConfigNoModeSet>:
and    $0xfffffffffc3f00ff,%rsi
shl    $0x16,%rdx
or     %rsi,%rdx
shl    $0x8,%rcx
or     %rdx,%rcx
mov    %rcx,0x10(%rdi)
ret

LLVM IR (-O0):
define void @EPIConfigNoModeSet(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = and i64 %9, -62914561
store i64 %10, i64* %6
%11 = load i64, i64* %7
%12 = shl i64 %11, 22
%13 = load i64, i64* %6
%14 = or i64 %13, %12
store i64 %14, i64* %6
%15 = load i64, i64* %6
%16 = and i64 %15, -65281
store i64 %16, i64* %6
%17 = load i64, i64* %8
%18 = shl i64 %17, 8
%19 = load i64, i64* %6
%20 = or i64 %19, %18
store i64 %20, i64* %6
%21 = load i64, i64* %6
%22 = load i64, i64* %5
%23 = add i64 %22, 16
%24 = inttoptr i64 %23 to i64*
store volatile i64 %21, i64* %24
ret void
}

LLVM IR (-O2):
define void @EPIConfigNoModeSet(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = and i64 %1, -62979841
%6 = shl i64 %2, 22
%7 = or i64 %6, %5
%8 = shl i64 %3, 8
%9 = or i64 %7, %8
%10 = add i64 %0, 16
%11 = inttoptr i64 %10 to i64*
store volatile i64 %9, i64* %11
ret void
}
/* Variables and functions */
float pi();
float rad(float deg) { return deg / 180.0 * pi(); }


x86 assembly (clang, -O0):
<rad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <pi@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rad>:
push   %rax
cvtss2sd %xmm0,%xmm0
divsd  0xee3(%rip),%xmm0
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1030 <pi@plt>
cvtss2sd %xmm0,%xmm0
mulsd  (%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rad(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 1.800000e+02
%6 = call float (...) @pi()
%7 = fpext float %6 to double
%8 = fmul double %5, %7
%9 = fptrunc double %8 to float
ret float %9
}

LLVM IR (-O2):
define float @rad(float %0) {
%2 = fpext float %0 to double
%3 = fdiv double %2, 1.800000e+02
%4 = tail call float (...) @pi()
%5 = fpext float %4 to double
%6 = fmul double %3, %5
%7 = fptrunc double %6 to float
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int memset21_scalar() {
  int *x = malloc(sizeof(int));
  memset(x, 0, 1);
  int num = 1 / *x;
  free(x);
  return num;
}


x86 assembly (clang, -O0):
<memset21_scalar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%rcx
mov    $0x1,%eax
cltd
idivl  (%rcx)
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memset21_scalar>:
push   %rbp
push   %rbx
push   %rax
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    (%rbx),%eax
lea    0x1(%rax),%ecx
cmp    $0x3,%ecx
cmovb  %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @memset21_scalar() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @malloc(i32 4)
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @memset(i32* %4, i32 0, i32 1)
%6 = load i32*, i32** %1
%7 = load i32, i32* %6
%8 = sdiv i32 1, %7
store i32 %8, i32* %2
%9 = load i32*, i32** %1
%10 = call i32 @free(i32* %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @memset21_scalar() {
%1 = tail call i32* @malloc(i32 4)
%2 = tail call i32 @memset(i32* %1, i32 0, i32 1)
%3 = load i32, i32* %1
%4 = add i32 %3, 1
%5 = icmp ult i32 %4, 3
%6 = select i1 %5, i32 %3, i32 0
%7 = tail call i32 @free(i32* %1)
ret i32 %6
}
void TA1_0_IRQHandler(void) {
  while (1) {
  }
}


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

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

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

LLVM IR (-O2):
define void @TA1_0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int open(char *, int, int /*<<< orphan*/);
int libc_open(char *p, int flags, mode_t mode) { return open(p, flags, mode); }


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

x86 assembly (clang, -O2):
<libc_open>:
jmp    1030 <open@plt>

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

LLVM IR (-O2):
define i32 @libc_open(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ glad_glClear(int);
void clear_screen() { glad_glClear(0x00004000 | 0x00000100); }


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

x86 assembly (clang, -O2):
<clear_screen>:
mov    $0x4100,%edi
jmp    1030 <glad_glClear@plt>

LLVM IR (-O0):
define void @clear_screen() {
%1 = call i32 @glad_glClear(i32 16640)
ret void
}

LLVM IR (-O2):
define void @clear_screen() {
%1 = tail call i32 @glad_glClear(i32 16640)
ret void
}
INI_Scalar_TYPE() {}


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

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

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

LLVM IR (-O2):
define i32 @INI_Scalar_TYPE() {
ret i32 undef
}
int do_008() { return 8; }


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @do_008() {
ret i32 8
}

LLVM IR (-O2):
define i32 @do_008() {
ret i32 8
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_cur_time(char *buf, int size) {
  time_t t;
  struct tm *ptm;
  int len = 0;
  time(&t);
  ptm = localtime(&t);
  len = strftime(buf, size, "%H:%M:%S", ptm);
  buf[len] = '\0';
  return buf;
}


x86 assembly (clang, -O0):
<get_cur_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <time@plt>
lea    -0x10(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xe92(%rip),%rdx
call   1050 <strftime@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cur_time>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1040 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xea7(%rip),%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %rax,%rcx
call   1050 <strftime@plt>
cltq
movb   $0x0,(%rbx,%rax,1)
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%H:%M:%S\00"
define i8* @get_cur_time(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.tm*
%7 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %7
%8 = call i32 @time(i32* %5)
%9 = call %struct.tm* @localtime(i32* %5)
store %struct.tm* %9, %struct.tm** %6
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = load %struct.tm*, %struct.tm** %6
%13 = call i32 @strftime(i8* %10, i32 %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %12)
store i32 %13, i32* %7
%14 = load i8*, i8** %3
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [9 x i8] c"%H:%M:%S\00"
define i8* @get_cur_time(i8* returned %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @time(i32* %3)
%6 = call %struct.tm* @localtime(i32* %3)
%7 = call i32 @strftime(i8* %0, i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %0, i64 %8
store i8 0, i8* %9
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ perror(char const *);
char *readStringFromFile(char const *);
char *maybeReadFile(const char *filename) {
  if (filename == NULL)
    return NULL;
  char *str = readStringFromFile(filename);
  if (str == NULL) {
    perror(filename);
    exit(1);
  }
  return str;
}


x86 assembly (clang, -O0):
<maybeReadFile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <maybeReadFile+0x24>
movq   $0x0,-0x8(%rbp)
jmp    1187 <maybeReadFile+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <readStringFromFile@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <maybeReadFile+0x4f>
mov    -0x10(%rbp),%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maybeReadFile>:
push   %rbx
test   %rdi,%rdi
je     1145 <maybeReadFile+0x15>
mov    %rdi,%rbx
call   1030 <readStringFromFile@plt>
test   %rax,%rax
je     1149 <maybeReadFile+0x19>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <perror@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define i8* @maybeReadFile(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @readStringFromFile(i8* %0)
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @perror(i8* %0)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
char numberOfPlayersInZone(short zone, short *world) {
  char num = 0;
  for (int j = 4; j < 8; j++) {
    num += !!world[zone * 8 + j];
  }
  return num;
}


x86 assembly (clang, -O0):
<numberOfPlayersInZone>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x0,-0x11(%rbp)
movl   $0x4,-0x18(%rbp)
cmpl   $0x8,-0x18(%rbp)
jge    115d <numberOfPlayersInZone+0x5d>
mov    -0x10(%rbp),%rax
movswl -0x2(%rbp),%ecx
shl    $0x3,%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
cmpw   $0x0,(%rax,%rcx,2)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
movsbl -0x11(%rbp),%eax
add    %ecx,%eax
mov    %al,-0x11(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    111a <numberOfPlayersInZone+0x1a>
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numberOfPlayersInZone>:
lea    0x4(,%rdi,8),%eax
cltq
movq   (%rsi,%rax,2),%xmm0
pxor   %xmm1,%xmm1
pcmpeqw %xmm0,%xmm1
pcmpeqd %xmm0,%xmm0
pxor   %xmm1,%xmm0
punpcklwd %xmm0,%xmm0
movmskps %xmm0,%ecx
mov    %ecx,%eax
shr    %al
and    $0x5,%al
sub    %al,%cl
mov    %ecx,%eax
and    $0x33,%al
shr    $0x2,%cl
and    $0x33,%cl
add    %al,%cl
mov    %ecx,%eax
shr    $0x4,%al
add    %cl,%al
and    $0xf,%al
ret

LLVM IR (-O0):
define signext i8 @numberOfPlayersInZone(i16 signext %0, i16* %1) {
%3 = alloca i16
%4 = alloca i16*
%5 = alloca i8
%6 = alloca i32
store i16 %0, i16* %3
store i16* %1, i16** %4
store i8 0, i8* %5
store i32 4, i32* %6
br label %7
7: ; preds = %28, %2
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %31
10: ; preds = %7
%11 = load i16*, i16** %4
%12 = load i16, i16* %3
%13 = sext i16 %12 to i32
%14 = mul nsw i32 %13, 8
%15 = load i32, i32* %6
%16 = add nsw i32 %14, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* %11, i64 %17
%19 = load i16, i16* %18
%20 = icmp ne i16 %19, 0
%21 = xor i1 %20, true
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
%26 = add nsw i32 %25, %23
%27 = trunc i32 %26 to i8
store i8 %27, i8* %5
br label %28
28: ; preds = %10
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %7
31: ; preds = %7
%32 = load i8, i8* %5
ret i8 %32
}

LLVM IR (-O2):
define signext i8 @numberOfPlayersInZone(i16 signext %0, i16* nocapture %1) {
%3 = sext i16 %0 to i32
%4 = shl nsw i32 %3, 3
%5 = or i32 %4, 4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i16, i16* %1, i64 %6
%8 = bitcast i16* %7 to <4 x i16>*
%9 = load <4 x i16>, <4 x i16>* %8
%10 = icmp ne <4 x i16> %9, zeroinitializer
%11 = bitcast <4 x i1> %10 to i4
%12 = call i4 @llvm.ctpop.i4(i4 %11)
%13 = zext i4 %12 to i8
ret i8 %13
}
/* Variables and functions */
int /*<<< orphan*/ EVP_ripemd160();
int /*<<< orphan*/ HMAC(int /*<<< orphan*/, unsigned char const *, size_t,
                        unsigned char const *, size_t, unsigned char *,
                        size_t *);
void hmac(const unsigned char *data, size_t len, const unsigned char *key,
          size_t keylen, unsigned char *res, size_t *reslen) {
  HMAC(EVP_ripemd160(), key, keylen, data, len, res, reslen);
}


x86 assembly (clang, -O0):
<hmac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x0,%al
call   1040 <EVP_ripemd160@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <HMAC@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmac>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r12
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,%rbp
xor    %eax,%eax
call   1040 <EVP_ripemd160@plt>
mov    %r12,(%rsp)
mov    %eax,%edi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
mov    %r13,%r8
mov    %r14,%r9
call   1030 <HMAC@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @hmac(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64* %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64*
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i64* %5, i64** %12
%13 = call i32 (...) @EVP_ripemd160()
%14 = load i8*, i8** %9
%15 = load i64, i64* %10
%16 = load i8*, i8** %7
%17 = load i64, i64* %8
%18 = load i8*, i8** %11
%19 = load i64*, i64** %12
%20 = call i32 @HMAC(i32 %13, i8* %14, i64 %15, i8* %16, i64 %17, i8* %18, i64* %19)
ret void
}

LLVM IR (-O2):
define void @hmac(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64* %5) {
%7 = tail call i32 (...) @EVP_ripemd160()
%8 = tail call i32 @HMAC(i32 %7, i8* %2, i64 %3, i8* %0, i64 %1, i8* %4, i64* %5)
ret void
}
void gtk_range_get_update_policy() {}


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

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

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

LLVM IR (-O2):
define void @gtk_range_get_update_policy() {
ret void
}
void HEX2BIN_ErrorsEnter() { printf("%s \r\n", __FUNCTION__); }


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

x86 assembly (clang, -O2):
<HEX2BIN_ErrorsEnter>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s \0D\0A\00"
@__FUNCTION__.HEX2BIN_ErrorsEnter = [20 x i8] c"HEX2BIN_ErrorsEnter\00"
define void @HEX2BIN_ErrorsEnter() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.HEX2BIN_ErrorsEnter, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s \0D\0A\00"
@__FUNCTION__.HEX2BIN_ErrorsEnter = [20 x i8] c"HEX2BIN_ErrorsEnter\00"
define void @HEX2BIN_ErrorsEnter() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.HEX2BIN_ErrorsEnter, i64 0, i64 0))
ret void
}
char *mklower(str)
char *str;
{
  char *sp;
  sp = str;
  while (*sp)
    lowercase(sp++);
  return (str);
}


x86 assembly (clang, -O0):
<mklower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <mklower+0x3c>
mov    -0x10(%rbp),%rdi
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <lowercase@plt>
jmp    1124 <mklower+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mklower>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
je     1137 <mklower+0x27>
mov    %r14,%rbx
lea    0x1(%rbx),%r15
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <lowercase@plt>
cmpb   $0x0,0x1(%rbx)
mov    %r15,%rbx
jne    1120 <mklower+0x10>
mov    %r14,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @mklower(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %6, %4 ], [ %0, %1 ]
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @lowercase to i32 (i8*, ...)*)(i8* %5)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3_stmt;

/* Variables and functions */
int sqlite3_column_int(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sqlite3_finalize(int /*<<< orphan*/ *);
int /*<<< orphan*/ *stmt_get(char *);
int settings_getInt(char *name, int defaultValue) {
  int res;
  sqlite3_stmt *stmt = stmt_get(name);
  if (stmt == NULL)
    return defaultValue;
  res = sqlite3_column_int(stmt, 0);
  sqlite3_finalize(stmt);
  return res;
}


x86 assembly (clang, -O0):
<settings_getInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <stmt_get@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1162 <settings_getInt+0x32>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117f <settings_getInt+0x4f>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1040 <sqlite3_column_int@plt>
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <sqlite3_finalize@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<settings_getInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
call   1030 <stmt_get@plt>
test   %rax,%rax
je     1156 <settings_getInt+0x26>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <sqlite3_column_int@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <sqlite3_finalize@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @settings_getInt(i8* %0, i32 %1) {
%3 = tail call i32* @stmt_get(i8* %0)
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @sqlite3_column_int(i32* %3, i32 0)
%7 = tail call i32 @sqlite3_finalize(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ %6, %5 ], [ %1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((nomips16)) nofoo(void) { printf("in foo: mips32\n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"in foo: mips32\00"
define void @nofoo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int show_pointers() {
  int x = 10;
  int *ptr_x;
  ptr_x = &x;
  printf("*ptr_x = %d\n", *ptr_x);
  printf("ptr_x = %u\n", ptr_x);
  printf("&x = %u\n", &x);
}


x86 assembly (clang, -O0):
<show_pointers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_pointers>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
lea    0xedc(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"*ptr_x = %d\0A\00"
@.str.1 = [12 x i8] c"ptr_x = %u\0A\00"
@.str.2 = [9 x i8] c"&x = %u\0A\00"
define i32 @show_pointers() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 10, i32* %2
store i32* %2, i32** %3
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32*, i32** %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"*ptr_x = %d\0A\00"
@.str.1 = [12 x i8] c"ptr_x = %u\0A\00"
@.str.2 = [9 x i8] c"&x = %u\0A\00"
define i32 @show_pointers() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %1)
ret i32 undef
}
char *ordinal(const int number) { return ""; }


x86 assembly (clang, -O0):
<ordinal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @ordinal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @ordinal(i32 %0) {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ lcdhal_write(int, int /*<<< orphan*/);
void _helper_pixel8(uint8_t color1) { lcdhal_write(1, color1); }


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

x86 assembly (clang, -O2):
<_helper_pixel8>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <lcdhal_write@plt>

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

LLVM IR (-O2):
define void @_helper_pixel8(i32 %0) {
%2 = tail call i32 @lcdhal_write(i32 1, i32 %0)
ret void
}
void handle_ILL(sig) int sig;
{}


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

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

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

LLVM IR (-O2):
define void @handle_ILL(i32 %0) {
ret void
}