xunge/DecIR huggingface dataset:
long find_zero(unsigned long mask) {
  long byte = 0;
  if (mask >> 16)
    mask >>= 16;
  else
    byte += 2;
  return (mask >> 8) ? byte : byte + 1;
}


x86 assembly (clang, -O0):
<find_zero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
cmp    $0x0,%rax
je     1133 <find_zero+0x33>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    %rax,-0x8(%rbp)
jmp    113f <find_zero+0x3f>
mov    -0x10(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
cmp    $0x0,%rax
je     115e <find_zero+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    116a <find_zero+0x6a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_zero>:
mov    %rdi,%rax
shr    $0x10,%rax
xor    %ecx,%ecx
cmp    $0x10000,%rdi
setb   %cl
cmovb  %rdi,%rax
xor    %edx,%edx
cmp    $0x100,%rax
setb   %dl
lea    (%rdx,%rcx,2),%rax
ret

LLVM IR (-O0):
define i64 @find_zero(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
store i64 0, i64* %3
%4 = load i64, i64* %2
%5 = lshr i64 %4, 16
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = lshr i64 %8, 16
store i64 %9, i64* %2
br label %13
10: ; preds = %1
%11 = load i64, i64* %3
%12 = add nsw i64 %11, 2
store i64 %12, i64* %3
br label %13
13: ; preds = %10, %7
%14 = load i64, i64* %2
%15 = lshr i64 %14, 8
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = load i64, i64* %3
br label %22
19: ; preds = %13
%20 = load i64, i64* %3
%21 = add nsw i64 %20, 1
br label %22
22: ; preds = %19, %17
%23 = phi i64 [ %18, %17 ], [ %21, %19 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @find_zero(i64 %0) {
%2 = icmp ult i64 %0, 65536
%3 = lshr i64 %0, 16
%4 = select i1 %2, i64 %0, i64 %3
%5 = select i1 %2, i64 2, i64 0
%6 = icmp ult i64 %4, 256
%7 = zext i1 %6 to i64
%8 = or i64 %5, %7
ret i64 %8
}
unsigned int hexval(char c) {
  unsigned int v = (unsigned char)c;
  if (v >= '0' && v <= '9')
    return v - '0';
  else
    return (v | 0x20) - 'a' + 10;
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jb     1133 <hexval+0x33>
cmpl   $0x39,-0xc(%rbp)
ja     1133 <hexval+0x33>
mov    -0xc(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1142 <hexval+0x42>
mov    -0xc(%rbp),%eax
or     $0x20,%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
movzbl %dil,%eax
lea    -0x30(%rax),%ecx
lea    -0x30(%rax),%edx
or     $0x20,%eax
add    $0xffffffa9,%eax
cmp    $0xa,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @hexval(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %3
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp uge i32 %7, 48
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i32, i32* %4
%11 = icmp ule i32 %10, 57
br i1 %11, label %12, label %15
12: ; preds = %9
%13 = load i32, i32* %4
%14 = sub i32 %13, 48
store i32 %14, i32* %2
br label %20
15: ; preds = %9, %1
%16 = load i32, i32* %4
%17 = or i32 %16, 32
%18 = sub i32 %17, 97
%19 = add i32 %18, 10
store i32 %19, i32* %2
br label %20
20: ; preds = %15, %12
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @hexval(i8 signext %0) {
%2 = zext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add nsw i32 %2, -48
%6 = or i32 %2, 32
%7 = add nsw i32 %6, -87
%8 = select i1 %4, i32 %5, i32 %7
ret i32 %8
}
/* Variables and functions */
int tuner_set_freq(void *, unsigned int);
int bbm_com_tuner_set_freq(void *handle, unsigned int freq) {
  int res = 0;
  res = tuner_set_freq(handle, freq);
  return res;
}


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

x86 assembly (clang, -O2):
<bbm_com_tuner_set_freq>:
jmp    1030 <tuner_set_freq@plt>

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

LLVM IR (-O2):
define i32 @bbm_com_tuner_set_freq(i8* %0, i32 %1) {
%3 = tail call i32 @tuner_set_freq(i8* %0, i32 %1)
ret i32 %3
}
void codegen_close() {}


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

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

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

LLVM IR (-O2):
define void @codegen_close() {
ret void
}
/* Variables and functions */
scalar_t__ to_baudrate_constant(int);
int is_custom_speed(int speed) { return to_baudrate_constant(speed) < 0; }


x86 assembly (clang, -O0):
<is_custom_speed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <to_baudrate_constant@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_custom_speed>:
push   %rax
call   1030 <to_baudrate_constant@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @is_custom_speed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @to_baudrate_constant(i32 %3)
%5 = icmp slt i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @is_custom_speed(i32 %0) {
%2 = tail call i64 @to_baudrate_constant(i32 %0)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
void _acc_log_unlock() {}


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

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

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

LLVM IR (-O2):
define void @_acc_log_unlock() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
void gffi_set_int_16_swapped(uint8_t *location, int offset, int16_t value) {
  uint8_t *buf = (uint8_t *)&value;
  location[offset + 0] = buf[1];
  location[offset + 1] = buf[0];
}


x86 assembly (clang, -O0):
<gffi_set_int_16_swapped>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gffi_set_int_16_swapped>:
movslq %esi,%rax
mov    %edx,0x4(%rdi,%rax,4)
ret

LLVM IR (-O0):
define void @gffi_set_int_16_swapped(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32* %6, i32** %7
%8 = load i32*, i32** %7
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = load i32*, i32** %4
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 0
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %11, i64 %14
store i32 %10, i32* %15
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = load i32*, i32** %4
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
store i32 %18, i32* %23
ret void
}

LLVM IR (-O2):
define void @gffi_set_int_16_swapped(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
store i32 %2, i32* %6
ret void
}
void removeFromBTree(int info, int cmpKey1, int cmpKey2) {}


x86 assembly (clang, -O0):
<removeFromBTree>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @removeFromBTree(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @removeFromBTree(i32 %0, i32 %1, i32 %2) {
ret void
}
void flush(void *addr) { asm("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @flush(i8* nocapture readnone %0) {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
char *append_with_space(w1, w2)
char *w1, *w2;
{
  char *result;
  result = (char *)malloc((strlen(w1) + strlen(w2) + 2) * sizeof(char));
  strcpy(result, w1);
  strcat(result, " ");
  strcat(result, w2);
  return (result);
}


x86 assembly (clang, -O0):
<append_with_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
shl    $0x0,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_with_space>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x2,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
movw   $0x20,(%rbx,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1060 <strcat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define i8* @append_with_space(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** %3
%7 = call i64 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i64 @strlen(i8* %8)
%10 = add i64 %7, %9
%11 = add i64 %10, 2
%12 = mul i64 %11, 1
%13 = call i8* @malloc(i64 %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = load i8*, i8** %3
%16 = call i8* @strcpy(i8* %14, i8* %15)
%17 = load i8*, i8** %5
%18 = call i8* @strcat(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = load i8*, i8** %5
%20 = load i8*, i8** %4
%21 = call i8* @strcat(i8* %19, i8* %20)
%22 = load i8*, i8** %5
ret i8* %22
}

LLVM IR (-O2):
define i8* @append_with_space(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = add i64 %3, 2
%6 = add i64 %5, %4
%7 = tail call i8* @malloc(i64 %6)
%8 = tail call i8* @strcpy(i8* dereferenceable(1) %7, i8* dereferenceable(1) %0)
%9 = tail call i64 @strlen(i8* dereferenceable(1) %7)
%10 = getelementptr i8, i8* %7, i64 %9
%11 = bitcast i8* %10 to i16*
store i16 32, i16* %11
%12 = tail call i8* @strcat(i8* dereferenceable(1) %7, i8* dereferenceable(1) %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x93() {
  Assert_real((isprint(147) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              740, ("isprint should be 0 for 0x93"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x93>:
push   %rax
mov    $0x93,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e4,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x93\00"
define void @t_isprint_0x93() {
%1 = call i64 @isprint(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [29 x i8] c"isprint should be 0 for 0x93\00"
define void @t_isprint_0x93() {
%1 = tail call i64 @isprint(i32 147)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 740, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ isalnum(unsigned char);
scalar_t__ isascii(unsigned char);
int issymchar(unsigned char c) {
  return (isascii(c) && (isalnum(c) || (c == '_') || (c == '$')));
}


x86 assembly (clang, -O0):
<issymchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1040 <isascii@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x2(%rbp)
je     1189 <issymchar+0x69>
movzbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x3(%rbp)
jne    1183 <issymchar+0x63>
movzbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5f,%ecx
mov    %al,-0x3(%rbp)
je     1183 <issymchar+0x63>
movzbl -0x1(%rbp),%eax
cmp    $0x24,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issymchar>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
call   1040 <isascii@plt>
test   %rax,%rax
je     1156 <issymchar+0x36>
movzbl %bl,%ebp
mov    %ebp,%edi
call   1030 <isalnum@plt>
mov    %rax,%rcx
mov    $0x1,%eax
cmp    $0x5f,%bpl
je     1158 <issymchar+0x38>
test   %rcx,%rcx
jne    1158 <issymchar+0x38>
xor    %eax,%eax
cmp    $0x24,%bl
sete   %al
jmp    1158 <issymchar+0x38>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @issymchar(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i64 @isascii(i8 zeroext %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %20
6: ; preds = %1
%7 = load i8, i8* %2
%8 = call i64 @isalnum(i8 zeroext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %18, label %10
10: ; preds = %6
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = icmp eq i32 %12, 95
br i1 %13, label %18, label %14
14: ; preds = %10
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = icmp eq i32 %16, 36
br label %18
18: ; preds = %14, %10, %6
%19 = phi i1 [ true, %10 ], [ true, %6 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %1
%21 = phi i1 [ false, %1 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @issymchar(i8 zeroext %0) {
%2 = tail call i64 @isascii(i8 zeroext %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1
%5 = tail call i64 @isalnum(i8 zeroext %0)
%6 = icmp ne i64 %5, 0
%7 = icmp eq i8 %0, 95
%8 = or i1 %7, %6
br i1 %8, label %12, label %9
9: ; preds = %4
%10 = icmp eq i8 %0, 36
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %4, %9, %1
%13 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %11, %9 ]
ret i32 %13
}
int s_max(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<s_max>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <s_max+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <s_max+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_max>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @s_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
void sip_add_local_uri(_Bool bIP, _Bool bPort) {}


x86 assembly (clang, -O0):
<sip_add_local_uri>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
and    $0x1,%cl
mov    %cl,-0x1(%rbp)
and    $0x1,%al
mov    %al,-0x2(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sip_add_local_uri(i1 zeroext %0, i1 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = zext i1 %0 to i8
store i8 %5, i8* %3
%6 = zext i1 %1 to i8
store i8 %6, i8* %4
ret void
}

LLVM IR (-O2):
define void @sip_add_local_uri(i1 zeroext %0, i1 zeroext %1) {
ret void
}
/* Type definitions */
struct timeval {
  long long tv_sec;
  unsigned long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long long int phys_gettime_us(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000000LL + tv.tv_usec;
}


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

x86 assembly (clang, -O2):
<phys_gettime_us>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define i64 @phys_gettime_us() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i64, i64* %3
%5 = mul nsw i64 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i64, i64* %6
%8 = add i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define i64 @phys_gettime_us() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = mul nsw i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_78C10(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_78C10() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void printscreen(char *param1) {
  puts(param1);
  return;
}


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

x86 assembly (clang, -O2):
<printscreen>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @printscreen(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Variables and functions */
void *Memcpy(void *dest, const void *src, size_t n) {}


x86 assembly (clang, -O0):
<Memcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @Memcpy(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %4
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @Memcpy(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void usage(const char *mess) {
  fprintf(stderr, "Error: %s\n", mess);
  fprintf(stderr, "Usage: r7600 input_file output_file\n");
  fprintf(stderr, "\n");
  exit(1);
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rbx
mov    (%rbx),%edi
lea    0xecc(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec7(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeda(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [37 x i8] c"Usage: r7600 input_file output_file\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%8 = load i32, i32* @stderr
%9 = call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"Error: %s\0A\00"
@.str.1 = [37 x i8] c"Usage: r7600 input_file output_file\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 (i32, i8*, ...) @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
}
unsigned char get_I_TBS(unsigned char I_MCS) {
  if (I_MCS < 10)
    return (I_MCS);
  else if (I_MCS == 10)
    return (9);
  else if (I_MCS < 17)
    return (I_MCS - 1);
  else if (I_MCS == 17)
    return (15);
  else
    return (I_MCS - 2);
}


x86 assembly (clang, -O0):
<get_I_TBS>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1122 <get_I_TBS+0x22>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
jmp    1174 <get_I_TBS+0x74>
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jne    1138 <get_I_TBS+0x38>
movb   $0x9,-0x1(%rbp)
jmp    1174 <get_I_TBS+0x74>
movzbl -0x2(%rbp),%eax
cmp    $0x11,%eax
jge    1154 <get_I_TBS+0x54>
movzbl -0x2(%rbp),%eax
sub    $0x1,%eax
mov    %al,-0x1(%rbp)
jmp    1174 <get_I_TBS+0x74>
movzbl -0x2(%rbp),%eax
cmp    $0x11,%eax
jne    116a <get_I_TBS+0x6a>
movb   $0xf,-0x1(%rbp)
jmp    1174 <get_I_TBS+0x74>
movzbl -0x2(%rbp),%eax
sub    $0x2,%eax
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_I_TBS>:
cmp    $0xa,%dil
jb     111a <get_I_TBS+0x1a>
mov    $0x9,%al
je     111c <get_I_TBS+0x1c>
cmp    $0x10,%dil
ja     1116 <get_I_TBS+0x16>
add    $0xff,%dil
jmp    111a <get_I_TBS+0x1a>
add    $0xfe,%dil
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @get_I_TBS(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i8, i8* %3
store i8 %8, i8* %2
br label %33
9: ; preds = %1
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 10
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 9, i8* %2
br label %33
14: ; preds = %9
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = icmp slt i32 %16, 17
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = load i8, i8* %3
%20 = zext i8 %19 to i32
%21 = sub nsw i32 %20, 1
%22 = trunc i32 %21 to i8
store i8 %22, i8* %2
br label %33
23: ; preds = %14
%24 = load i8, i8* %3
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 17
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 15, i8* %2
br label %33
28: ; preds = %23
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = sub nsw i32 %30, 2
%32 = trunc i32 %31 to i8
store i8 %32, i8* %2
br label %33
33: ; preds = %28, %27, %18, %13, %7
%34 = load i8, i8* %2
ret i8 %34
}

LLVM IR (-O2):
define zeroext i8 @get_I_TBS(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = icmp eq i8 %0, 10
br i1 %4, label %11, label %5
5: ; preds = %3
%6 = icmp ult i8 %0, 17
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = add nsw i8 %0, -1
br label %11
9: ; preds = %5
%10 = add i8 %0, -2
br label %11
11: ; preds = %9, %3, %1, %7
%12 = phi i8 [ %8, %7 ], [ %0, %1 ], [ 9, %3 ], [ %10, %9 ]
ret i8 %12
}
/* Variables and functions */
char *strncpy(char *, char const *, int);
char *Strncpy(char *s1, const char *s2, int len) {
  char *res = strncpy(s1, s2, len);
  s1[len - 1] = '\0';
  return res;
}


x86 assembly (clang, -O0):
<Strncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Strncpy>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rdi,%rbx
call   1030 <strncpy@plt>
movslq %ebp,%rcx
movb   $0x0,-0x1(%rcx,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @Strncpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i8* @strncpy(i8* %8, i8* %9, i32 %10)
store i8* %11, i8** %7
%12 = load i8*, i8** %4
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %12, i64 %15
store i8 0, i8* %16
%17 = load i8*, i8** %7
ret i8* %17
}

LLVM IR (-O2):
define i8* @Strncpy(i8* %0, i8* %1, i32 %2) {
%4 = tail call i8* @strncpy(i8* %0, i8* %1, i32 %2)
%5 = add nsw i32 %2, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i8* %4
}
/* Type definitions */
struct ht_table {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ht_add(struct ht_table *, char *, void *,
                          int /*<<< orphan*/ *);
void ht_add_value(struct ht_table *ht, char *key, void *value) {
  ht_add(ht, key, value, NULL);
}


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

x86 assembly (clang, -O2):
<ht_add_value>:
xor    %ecx,%ecx
jmp    1030 <ht_add@plt>

LLVM IR (-O0):
%struct.ht_table = type { i32 }
define void @ht_add_value(%struct.ht_table* %0, i8* %1, i8* %2) {
%4 = alloca %struct.ht_table*
%5 = alloca i8*
%6 = alloca i8*
store %struct.ht_table* %0, %struct.ht_table** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load %struct.ht_table*, %struct.ht_table** %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @ht_add(%struct.ht_table* %7, i8* %8, i8* %9, i32* null)
ret void
}

LLVM IR (-O2):
%struct.ht_table = type { i32 }
define void @ht_add_value(%struct.ht_table* %0, i8* %1, i8* %2) {
%4 = tail call i32 @ht_add(%struct.ht_table* %0, i8* %1, i8* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int *);
int main() {
  int array[] = {0, 1, 2, 3, 4};
  f(array);
  array[1] *= 2;
  return array[1] + array[2];
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <f@plt>
mov    -0x1c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1030 <f@plt>
mov    0x4(%rsp),%eax
add    %eax,%eax
add    0x8(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @f(i32* %4)
%6 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 2
store i32 %8, i32* %6
%9 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 1
%10 = load i32, i32* %9
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 2
%12 = load i32, i32* %11
%13 = add nsw i32 %10, %12
ret i32 %13
}

LLVM IR (-O2):
@__const.main.array = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @f(i32* %3)
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = shl nsw i32 %6, 1
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 2
%9 = load i32, i32* %8
%10 = add nsw i32 %9, %7
ret i32 %10
}
int lsl(int x, int y) { return (x << y); }


x86 assembly (clang, -O0):
<lsl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsl>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @lsl(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ _PROCEDURE_LINKAGE_TABLE_();
void __urem64() {
  _PROCEDURE_LINKAGE_TABLE_();
  return;
}


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

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

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

LLVM IR (-O2):
define void @__urem64() {
%1 = tail call i32 (...) @_PROCEDURE_LINKAGE_TABLE_()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite_int64;
typedef int /*<<< orphan*/ sqlite3_file;

/* Variables and functions */
int SQLITE_READONLY;
int memTruncate(sqlite3_file *pFile, sqlite_int64 size) {
  return SQLITE_READONLY;
}


x86 assembly (clang, -O0):
<memTruncate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
@SQLITE_READONLY = global i32 0
define i32 @memTruncate(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @SQLITE_READONLY
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ dsyev_(char *, char *, int *, double *, int *, double *,
                          double *, int *, int *);
void DSYEV(char JOBZ, char UPLO, int N, double *A, int LDA, double *W,
           double *WORK, int LWORK, int INFO) {
  dsyev_(&JOBZ, &UPLO, &N, A, &LDA, W, WORK, &LWORK, &INFO);
}


x86 assembly (clang, -O0):
<DSYEV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %sil,%al
mov    %dil,%sil
mov    0x20(%rbp),%edi
mov    0x18(%rbp),%edi
mov    0x10(%rbp),%rdi
mov    %sil,-0x1(%rbp)
mov    %al,-0x2(%rbp)
mov    %edx,-0x8(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r9
mov    0x10(%rbp),%r11
lea    -0x1(%rbp),%rdi
lea    -0x2(%rbp),%rsi
lea    -0x8(%rbp),%rdx
lea    -0x14(%rbp),%r8
lea    0x18(%rbp),%r10
lea    0x20(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <dsyev_@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DSYEV>:
sub    $0x18,%rsp
mov    0x20(%rsp),%r10
mov    %dil,0xf(%rsp)
mov    %sil,0xe(%rsp)
mov    %edx,0x14(%rsp)
mov    %r8d,0x10(%rsp)
sub    $0x8,%rsp
lea    0x38(%rsp),%rax
lea    0x30(%rsp),%r11
lea    0x17(%rsp),%rdi
lea    0x16(%rsp),%rsi
lea    0x1c(%rsp),%rdx
lea    0x18(%rsp),%r8
push   %rax
push   %r11
push   %r10
call   1030 <dsyev_@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define void @DSYEV(i8 signext %0, i8 signext %1, i32 %2, double* %3, i32 %4, double* %5, double* %6, i32 %7, i32 %8) {
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca double*
%14 = alloca i32
%15 = alloca double*
%16 = alloca double*
%17 = alloca i32
%18 = alloca i32
store i8 %0, i8* %10
store i8 %1, i8* %11
store i32 %2, i32* %12
store double* %3, double** %13
store i32 %4, i32* %14
store double* %5, double** %15
store double* %6, double** %16
store i32 %7, i32* %17
store i32 %8, i32* %18
%19 = load double*, double** %13
%20 = load double*, double** %15
%21 = load double*, double** %16
%22 = call i32 @dsyev_(i8* %10, i8* %11, i32* %12, double* %19, i32* %14, double* %20, double* %21, i32* %17, i32* %18)
ret void
}

LLVM IR (-O2):
define void @DSYEV(i8 signext %0, i8 signext %1, i32 %2, double* %3, i32 %4, double* %5, double* %6, i32 %7, i32 %8) {
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i8 %0, i8* %10
store i8 %1, i8* %11
store i32 %2, i32* %12
store i32 %4, i32* %13
store i32 %7, i32* %14
store i32 %8, i32* %15
%16 = call i32 @dsyev_(i8* %10, i8* %11, i32* %12, double* %3, i32* %13, double* %5, double* %6, i32* %14, i32* %15)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ crc_common(int /*<<< orphan*/ const *, int /*<<< orphan*/,
                              int, int);
uint8_t mmcsd_spi_crc7(const void *buffer, uint32_t cnt) {
  return crc_common((const uint8_t *)buffer, cnt, 0x89, 7);
}


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

x86 assembly (clang, -O2):
<mmcsd_spi_crc7>:
mov    $0x89,%edx
mov    $0x7,%ecx
jmp    1030 <crc_common@plt>

LLVM IR (-O0):
define i32 @mmcsd_spi_crc7(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %4
%8 = call i32 @crc_common(i32* %6, i32 %7, i32 137, i32 7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @mmcsd_spi_crc7(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
%4 = tail call i32 @crc_common(i32* %3, i32 %1, i32 137, i32 7)
ret i32 %4
}
long f(long argc, char **argv) {
  char *g;
  g = "dog";
  argv[0] = g;
  return g[0];
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeed(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
movsbq (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
lea    0xef9(%rip),%rax
mov    %rax,(%rsi)
mov    $0x64,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"dog\00"
define i64 @f(i64 %0, i8** %1) {
%3 = alloca i64
%4 = alloca i8**
%5 = alloca i8*
store i64 %0, i64* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %5
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 0
store i8* %6, i8** %8
%9 = load i8*, i8** %5
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
@.str = [4 x i8] c"dog\00"
define i64 @f(i64 %0, i8** nocapture writeonly %1) {
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %1
ret i64 100
}
/* Variables and functions */
int /*<<< orphan*/ foo(int /*<<< orphan*/);
__attribute__((no, noclone)) unsigned short f3(unsigned short x) {
  unsigned short r = 2U - x;
  if (r > 2U)
    foo(0);
  return r;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0x2,%eax
sub    %ecx,%eax
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
cmp    $0x2,%eax
jbe    1142 <f3+0x32>
xor    %edi,%edi
call   1030 <foo@plt>
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
push   %rbx
mov    %edi,%ebx
cmp    $0x3,%bx
jb     1120 <f3+0x10>
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0x2,%eax
sub    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @f3(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
%6 = sub i32 2, %5
%7 = trunc i32 %6 to i16
store i16 %7, i16* %3
%8 = load i16, i16* %3
%9 = zext i16 %8 to i32
%10 = icmp ugt i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @foo(i32 0)
br label %13
13: ; preds = %11, %1
%14 = load i16, i16* %3
ret i16 %14
}

LLVM IR (-O2):
define zeroext i16 @f3(i16 zeroext %0) {
%2 = icmp ugt i16 %0, 2
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @foo(i32 0)
br label %5
5: ; preds = %3, %1
%6 = sub i16 2, %0
ret i16 %6
}
/* Variables and functions */
int *cauchy_good_general_coding_matrix(int, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int *cauchy_coding_matrix(int k, int m, int w) {
  int *matrix;
  matrix = cauchy_good_general_coding_matrix(k, m, w);
  if (matrix == NULL) {
    printf("Couldn't make coding matrix --- Please check coding parameters!\n");
    exit(1);
  }
  return matrix;
}


x86 assembly (clang, -O0):
<cauchy_coding_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <cauchy_good_general_coding_matrix@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1174 <cauchy_coding_matrix+0x44>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cauchy_coding_matrix>:
push   %rax
call   1050 <cauchy_good_general_coding_matrix@plt>
test   %rax,%rax
je     113d <cauchy_coding_matrix+0xd>
pop    %rcx
ret
lea    0xebc(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Couldn't make coding matrix --- Please check coding parameters!\0A\00"
define i32* @cauchy_coding_matrix(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32* @cauchy_good_general_coding_matrix(i32 %8, i32 %9, i32 %10)
store i32* %11, i32** %7
%12 = load i32*, i32** %7
%13 = icmp eq i32* %12, null
br i1 %13, label %14, label %17
14: ; preds = %3
%15 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %3
%18 = load i32*, i32** %7
ret i32* %18
}

LLVM IR (-O2):
@str = [64 x i8] c"Couldn't make coding matrix --- Please check coding parameters!\00"
define i32* @cauchy_coding_matrix(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32* @cauchy_good_general_coding_matrix(i32 %0, i32 %1, i32 %2)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3
ret i32* %4
}
/* Type definitions */
struct CRYPTO_HASH_CTX {
  int dummy;
};
typedef int /*<<< orphan*/ EVP_MD_CTX;

/* Variables and functions */
int /*<<< orphan*/ EVP_MD_CTX_cleanup(int /*<<< orphan*/ *);
int /*<<< orphan*/ ssh_free(int /*<<< orphan*/ *);
void crypto_sha2_free(struct CRYPTO_HASH_CTX *crypto_ctx) {
  EVP_MD_CTX *ctx = ((EVP_MD_CTX *)(crypto_ctx));
  EVP_MD_CTX_cleanup(ctx);
  ssh_free(ctx);
}


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

x86 assembly (clang, -O2):
<crypto_sha2_free>:
push   %rbx
mov    %rdi,%rbx
call   1040 <EVP_MD_CTX_cleanup@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <ssh_free@plt>

LLVM IR (-O0):
%struct.CRYPTO_HASH_CTX = type { i32 }
define void @crypto_sha2_free(%struct.CRYPTO_HASH_CTX* %0) {
%2 = alloca %struct.CRYPTO_HASH_CTX*
%3 = alloca i32*
store %struct.CRYPTO_HASH_CTX* %0, %struct.CRYPTO_HASH_CTX** %2
%4 = load %struct.CRYPTO_HASH_CTX*, %struct.CRYPTO_HASH_CTX** %2
%5 = bitcast %struct.CRYPTO_HASH_CTX* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @EVP_MD_CTX_cleanup(i32* %6)
%8 = load i32*, i32** %3
%9 = call i32 @ssh_free(i32* %8)
ret void
}

LLVM IR (-O2):
%struct.CRYPTO_HASH_CTX = type { i32 }
define void @crypto_sha2_free(%struct.CRYPTO_HASH_CTX* %0) {
%2 = getelementptr %struct.CRYPTO_HASH_CTX, %struct.CRYPTO_HASH_CTX* %0, i64 0, i32 0
%3 = tail call i32 @EVP_MD_CTX_cleanup(i32* %2)
%4 = tail call i32 @ssh_free(i32* %2)
ret void
}
int instructions_fldcw(void) {
  int saved_cw, result, cw;
  double three = 3.0;
  asm("	mov	$100000,%%ecx\n"
      "big_loop:\n"
      "	fldl	%1		# load value onto fp stack\n"
      "	fnstcw	%0		# store control word to mem\n"
      "	movzwl	%0, %%eax	# load cw from mem, zero extending\n"
      "	movb	$12, %%ah	# set cw for \"round to zero\"\n"
      "	movw	%%ax, %3	# store back to memory\n"
      "	fldcw	%3		# save new rounding mode\n"
      "	fistpl	%2		# save stack value as integer to mem\n"
      "	fldcw	%0		# restore old cw\n"
      "	loop	big_loop	# loop to make the count more obvious\n"
      :
      : "m"(saved_cw), "m"(three), "m"(result), "m"(cw)
      : "cc", "%ecx", "%eax");
  return 0;
  return -1;
}


x86 assembly (clang, -O0):
<instructions_fldcw>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    $0x186a0,%ecx

x86 assembly (clang, -O2):
<instructions_fldcw>:
movabs $0x4008000000000000,%rax
mov    %rax,-0x18(%rsp)
mov    $0x186a0,%ecx

LLVM IR (-O0):
define i32 @instructions_fldcw() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store double 3.000000e+00, double* %4
ret i32 0
}

LLVM IR (-O2):
define i32 @instructions_fldcw() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast double* %4 to i8*
store double 3.000000e+00, double* %4
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print_compiler_version() {
  if (1 == 1) {
    printf("%s\n", "C99");
  } else if (1 == 1) {
    printf("%s\n", "C94");
  } else if (1 == 1) {
    printf("%s\n", "C94");
  } else if (1 == 1) {
    printf("%s\n", "C89");
  } else {
    printf("%s\n", "Unknown Version");
  }
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"C99\00"
define void @print_compiler_version() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}