xunge/DecIR huggingface dataset:
int videoinput_get_norm_height(int norm) {
  if (norm == 0 || norm == 6 || norm == 4 || norm == 7) {
    return 480;
  } else {
    return 576;
  }
}


x86 assembly (clang, -O0):
<videoinput_get_norm_height>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     112f <videoinput_get_norm_height+0x2f>
cmpl   $0x6,-0x8(%rbp)
je     112f <videoinput_get_norm_height+0x2f>
cmpl   $0x4,-0x8(%rbp)
je     112f <videoinput_get_norm_height+0x2f>
cmpl   $0x7,-0x8(%rbp)
jne    113b <videoinput_get_norm_height+0x3b>
movl   $0x1e0,-0x4(%rbp)
jmp    1142 <videoinput_get_norm_height+0x42>
movl   $0x240,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<videoinput_get_norm_height>:
mov    $0x240,%eax
cmp    $0x7,%edi
ja     1117 <videoinput_get_norm_height+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.videoinput_get_norm_height = [8 x i32] [i32 480, i32 576, i32 576, i32 576, i32 480, i32 576, i32 480, i32 480]
define i32 @videoinput_get_norm_height(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [8 x i32], [8 x i32]* @switch.table.videoinput_get_norm_height, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 576, %1 ]
ret i32 %8
}
void i8042_pnp_exit(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ volatile *mem_get_reg32(int);
volatile uint32_t *flash_get_PDKEYR() {
  return mem_get_reg32(0x40023C00 + 0x08);
}


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

x86 assembly (clang, -O2):
<flash_get_PDKEYR>:
mov    $0x40023c08,%edi
jmp    1030 <mem_get_reg32@plt>

LLVM IR (-O0):
define i32* @flash_get_PDKEYR() {
%1 = call i32* @mem_get_reg32(i32 1073888264)
ret i32* %1
}

LLVM IR (-O2):
define i32* @flash_get_PDKEYR() {
%1 = tail call i32* @mem_get_reg32(i32 1073888264)
ret i32* %1
}
/* Variables and functions */
int *allocate();
void uses_allocator() {
  int *p;
  p = allocate();
  *p = 42;
}


x86 assembly (clang, -O0):
<uses_allocator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <allocate@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2a,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uses_allocator>:
push   %rax
xor    %eax,%eax
call   1030 <allocate@plt>
movl   $0x2a,(%rax)
pop    %rax
ret

LLVM IR (-O0):
define void @uses_allocator() {
%1 = alloca i32*
%2 = call i32* (...) @allocate()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
store i32 42, i32* %3
ret void
}

LLVM IR (-O2):
define void @uses_allocator() {
%1 = tail call i32* (...) @allocate()
store i32 42, i32* %1
ret void
}
unsigned int fx(unsigned int n) { return 3 * n * (n + 1) + 1; }


x86 assembly (clang, -O0):
<fx>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0x3,-0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fx>:
lea    0x1(%rdi),%eax
imul   %edi,%eax
lea    (%rax,%rax,2),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @fx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 3, %3
%5 = load i32, i32* %2
%6 = add i32 %5, 1
%7 = mul i32 %4, %6
%8 = add i32 %7, 1
ret i32 %8
}

LLVM IR (-O2):
define i32 @fx(i32 %0) {
%2 = mul i32 %0, 3
%3 = add i32 %0, 1
%4 = mul i32 %2, %3
%5 = add i32 %4, 1
ret i32 %5
}
/* Type definitions */
struct _Locale_monetary {
  int dummy;
};

/* Variables and functions */
int CHAR_MAX;
int _Locale_p_cs_precedes(struct _Locale_monetary *lmon
                          __attribute__((__unused__))) {
  return CHAR_MAX;
}


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

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

LLVM IR (-O0):
%struct._Locale_monetary = type { i32 }
@CHAR_MAX = global i32 0
define i32 @_Locale_p_cs_precedes(%struct._Locale_monetary* %0) {
%2 = alloca %struct._Locale_monetary*
store %struct._Locale_monetary* %0, %struct._Locale_monetary** %2
%3 = load i32, i32* @CHAR_MAX
ret i32 %3
}

LLVM IR (-O2):
%struct._Locale_monetary = type { i32 }
@CHAR_MAX = global i32 0
define i32 @_Locale_p_cs_precedes(%struct._Locale_monetary* nocapture readnone %0) {
%2 = load i32, i32* @CHAR_MAX
ret i32 %2
}
const char *SkipUntilWhiteSpaceReverse(const char *pSrc, const char *pStart) {
  while (pSrc && (pSrc > pStart)) {
    if ((*pSrc == ' ') || (*pSrc == '\t')) {
      break;
    }
    pSrc--;
  }
  return pSrc;
}


x86 assembly (clang, -O0):
<SkipUntilWhiteSpaceReverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     112a <SkipUntilWhiteSpaceReverse+0x2a>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    113a <SkipUntilWhiteSpaceReverse+0x3a>
jmp    1170 <SkipUntilWhiteSpaceReverse+0x70>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     115a <SkipUntilWhiteSpaceReverse+0x5a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    115f <SkipUntilWhiteSpaceReverse+0x5f>
jmp    1170 <SkipUntilWhiteSpaceReverse+0x70>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    110c <SkipUntilWhiteSpaceReverse+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SkipUntilWhiteSpaceReverse>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jbe    1129 <SkipUntilWhiteSpaceReverse+0x29>
nopl   0x0(%rax,%rax,1)
movzbl (%rax),%ecx
cmp    $0x9,%cl
je     1129 <SkipUntilWhiteSpaceReverse+0x29>
cmp    $0x20,%cl
je     1129 <SkipUntilWhiteSpaceReverse+0x29>
add    $0xffffffffffffffff,%rax
cmp    %rsi,%rax
ja     1110 <SkipUntilWhiteSpaceReverse+0x10>
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @SkipUntilWhiteSpaceReverse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %25, %2
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = icmp ugt i8* %9, %10
br label %12
12: ; preds = %8, %5
%13 = phi i1 [ false, %5 ], [ %11, %8 ]
br i1 %13, label %14, label %28
14: ; preds = %12
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 32
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 9
br i1 %23, label %24, label %25
24: ; preds = %19, %14
br label %28
25: ; preds = %19
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 -1
store i8* %27, i8** %3
br label %5
28: ; preds = %24, %12
%29 = load i8*, i8** %3
ret i8* %29
}

LLVM IR (-O2):
define i8* @SkipUntilWhiteSpaceReverse(i8* %0, i8* readnone %1) {
%3 = icmp ugt i8* %0, %1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = getelementptr i8, i8* %0, i64 %7
br label %9
9: ; preds = %4, %12
%10 = phi i8* [ %13, %12 ], [ %0, %4 ]
%11 = load i8, i8* %10
switch i8 %11, label %12 [
i8 32, label %15
i8 9, label %15
]
12: ; preds = %9
%13 = getelementptr inbounds i8, i8* %10, i64 -1
%14 = icmp ugt i8* %13, %1
br i1 %14, label %9, label %15
15: ; preds = %12, %9, %9, %2
%16 = phi i8* [ %0, %2 ], [ %10, %9 ], [ %10, %9 ], [ %8, %12 ]
ret i8* %16
}
void test19_BlinkMilli2_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test19_BlinkMilli2_targetInit__I() {
ret void
}
/* Variables and functions */
scalar_t__ abs(long);
__attribute__((no)) int lisp_atan2(long dy, long dx) {
  if (dx <= 0)
    if (dy > 0)
      return abs(dx) <= abs(dy);
  return 0;
}


x86 assembly (clang, -O0):
<lisp_atan2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jg     116b <lisp_atan2+0x5b>
cmpq   $0x0,-0x10(%rbp)
jle    1166 <lisp_atan2+0x56>
mov    -0x18(%rbp),%rdi
call   1030 <abs@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setle  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <lisp_atan2+0x62>
jmp    116b <lisp_atan2+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lisp_atan2>:
test   %rsi,%rsi
setle  %al
test   %rdi,%rdi
setg   %cl
and    %al,%cl
mov    %rsi,%rax
neg    %rax
cmovs  %rsi,%rax
cmp    %rdi,%rax
setle  %al
and    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @lisp_atan2(i64 %0, i64 %1) {
%3 = icmp slt i64 %1, 1
%4 = icmp sgt i64 %0, 0
%5 = and i1 %4, %3
%6 = tail call i64 @llvm.abs.i64(i64 %1, i1 true)
%7 = icmp sle i64 %6, %0
%8 = select i1 %5, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
_Bool Char__LT_(char a, char b) { return a < b; }


x86 assembly (clang, -O0):
<Char__LT_>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Char__LT_>:
cmp    %sil,%dil
setl   %al
ret

LLVM IR (-O0):
define zeroext i1 @Char__LT_(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp slt i32 %6, %8
ret i1 %9
}

LLVM IR (-O2):
define zeroext i1 @Char__LT_(i8 signext %0, i8 signext %1) {
%3 = icmp slt i8 %0, %1
ret i1 %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_sha1(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<free_sha1>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_sha1(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
long absdiff(long x, long y) {
  long result;
  if (x < y) {
    result = y - x;
  } else {
    result = x - y;
  }
  return result;
}


x86 assembly (clang, -O0):
<absdiff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    112b <absdiff+0x2b>
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1137 <absdiff+0x37>
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<absdiff>:
mov    %rdi,%rax
sub    %rsi,%rax
neg    %rax
sub    %rsi,%rdi
cmovge %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @absdiff(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = sub nsw i64 %1, %0
%5 = sub nsw i64 %0, %1
%6 = select i1 %3, i64 %4, i64 %5
ret i64 %6
}
void endpwent(void) { anvil_syslog(0, "%s unimplemented\n", __FUNCTION__); }


x86 assembly (clang, -O0):
<endpwent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
lea    0xeee(%rip),%rdx
mov    $0x0,%al
call   1030 <anvil_syslog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<endpwent>:
lea    0xee9(%rip),%rsi
lea    0xef4(%rip),%rdx
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <anvil_syslog@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endpwent = [9 x i8] c"endpwent\00"
define void @endpwent() {
%1 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.endpwent, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s unimplemented\0A\00"
@__FUNCTION__.endpwent = [9 x i8] c"endpwent\00"
define void @endpwent() {
%1 = tail call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @anvil_syslog to i32 (i32, i8*, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__FUNCTION__.endpwent, i64 0, i64 0))
ret void
}
void gtk_text_iter_begins_tag() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_begins_tag() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ halt(char *, int /*<<< orphan*/ *);
void *get_mem(size_t nitems, size_t size) {
  void *tmp;
  if (((tmp = calloc(nitems, size)) == NULL) && (nitems != 0))
    halt("Not enough memory.", NULL);
  return (tmp);
}


x86 assembly (clang, -O0):
<get_mem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1166 <get_mem+0x46>
cmpq   $0x0,-0x8(%rbp)
je     1166 <get_mem+0x46>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <halt@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_mem>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <calloc@plt>
mov    %rax,%r14
test   %rbx,%rbx
je     1147 <get_mem+0x27>
test   %r14,%r14
jne    1147 <get_mem+0x27>
lea    0xec0(%rip),%rdi
xor    %esi,%esi
call   1040 <halt@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"Not enough memory.\00"
define noalias i8* @get_mem(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
%5 = icmp ne i64 %0, 0
%6 = and i1 %5, %4
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @halt(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* null)
br label %9
9: ; preds = %7, %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void freeContext(void *context) { free(context); }


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

x86 assembly (clang, -O2):
<freeContext>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freeContext(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int is_prime(int n) {
  int i, i2;
  int prime;
  prime = 0;
  for (i = 2; i <= n - 1; i++) {
    if (n % i == 0) {
      prime = 1;
      break;
    }
  }
  return prime;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1155 <is_prime+0x55>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1142 <is_prime+0x42>
movl   $0x1,-0x10(%rbp)
jmp    1155 <is_prime+0x55>
jmp    1147 <is_prime+0x47>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <is_prime+0x15>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
xor    %ecx,%ecx
cmp    $0x3,%edi
jl     1120 <is_prime+0x20>
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1123 <is_prime+0x23>
add    $0x1,%esi
cmp    %esi,%edi
jne    1110 <is_prime+0x10>
mov    %ecx,%eax
ret
mov    $0x1,%ecx
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 2, %1 ]
%7 = srem i32 %0, %6
%8 = icmp eq i32 %7, 0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %3, %5, %1
%11 = phi i32 [ 0, %1 ], [ 1, %5 ], [ 0, %3 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ test1();
void test_test1() { test1(); }


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

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

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

LLVM IR (-O2):
define void @test_test1() {
%1 = tail call i32 (...) @test1()
ret void
}
/* Variables and functions */
char inb(int);
scalar_t__ serial_received();
char read_serial() {
  while (serial_received() == 0)
    ;
  return inb(0x3f8);
}


x86 assembly (clang, -O0):
<read_serial>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <read_serial+0x9>
mov    $0x0,%al
call   1030 <serial_received@plt>
cmp    $0x0,%rax
jne    113f <read_serial+0x1f>
jmp    1129 <read_serial+0x9>
mov    $0x3f8,%edi
call   1040 <inb@plt>
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_serial>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <serial_received@plt>
test   %rax,%rax
je     1130 <read_serial+0x10>
mov    $0x3f8,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define signext i8 @read_serial() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @serial_received()
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
%6 = call signext i8 @inb(i32 1016)
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @read_serial() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 (...) @serial_received()
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call signext i8 @inb(i32 1016)
ret i8 %5
}
void foo_1_1_2_1_2_2_2_2_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_1_1_2_1_2_2_2_2_1() {
ret void
}
/* Variables and functions */
scalar_t__ EEXIST;
int S_IRUSR;
int S_IWUSR;
int S_IXUSR;
scalar_t__ errno;
scalar_t__ mkdir(char *, int);
int utilMkdir(char *dn) {
  if (mkdir(dn, S_IRUSR | S_IWUSR | S_IXUSR) == 0 || errno == EEXIST) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<utilMkdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
mov    0x2eb0(%rip),%rax
or     (%rax),%esi
mov    0x2eaf(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     1164 <utilMkdir+0x54>
mov    0x2e77(%rip),%rax
mov    (%rax),%rax
mov    0x2e75(%rip),%rcx
cmp    (%rcx),%rax
jne    1170 <utilMkdir+0x60>
movl   $0x0,-0x4(%rbp)
jmp    1177 <utilMkdir+0x67>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utilMkdir>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ebe(%rip),%rax
or     (%rax),%esi
call   1030 <mkdir@plt>
test   %rax,%rax
setne  %al
mov    0x2e8a(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e88(%rip),%rdx
cmp    (%rdx),%rcx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rcx
ret

LLVM IR (-O0):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
define i32 @utilMkdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = load i32, i32* @S_IRUSR
%6 = load i32, i32* @S_IWUSR
%7 = or i32 %5, %6
%8 = load i32, i32* @S_IXUSR
%9 = or i32 %7, %8
%10 = call i64 @mkdir(i8* %4, i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %1
%13 = load i64, i64* @errno
%14 = load i64, i64* @EEXIST
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12, %1
store i32 0, i32* %2
br label %18
17: ; preds = %12
store i32 1, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@S_IXUSR = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
define i32 @utilMkdir(i8* nocapture %0) {
%2 = load i32, i32* @S_IRUSR
%3 = load i32, i32* @S_IWUSR
%4 = or i32 %3, %2
%5 = load i32, i32* @S_IXUSR
%6 = or i32 %4, %5
%7 = tail call i64 @mkdir(i8* %0, i32 %6)
%8 = icmp ne i64 %7, 0
%9 = load i64, i64* @errno
%10 = load i64, i64* @EEXIST
%11 = icmp ne i64 %9, %10
%12 = select i1 %8, i1 %11, i1 false
%13 = zext i1 %12 to i32
ret i32 %13
}
void finalizoClients() {}


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

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

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

LLVM IR (-O2):
define void @finalizoClients() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert_int_equal(int, unsigned long);
void west_one_test(void **state) {
  assert_int_equal((((0x0202020202020202ul) >> 1) & ~0x8080808080808080ul),
                   0x0101010101010101ul);
  assert_int_equal((((0x0101010101010101ul) >> 1) & ~0x8080808080808080ul),
                   0ul);
}


x86 assembly (clang, -O0):
<west_one_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1010101,%edi
movabs $0x101010101010101,%rsi
01 01 01
call   1030 <assert_int_equal@plt>
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <assert_int_equal@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<west_one_test>:
push   %rax
movabs $0x101010101010101,%rsi
01 01 01
mov    $0x1010101,%edi
call   1030 <assert_int_equal@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <assert_int_equal@plt>

LLVM IR (-O0):
define void @west_one_test(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 @assert_int_equal(i32 16843009, i64 72340172838076673)
%4 = call i32 @assert_int_equal(i32 0, i64 0)
ret void
}

LLVM IR (-O2):
define void @west_one_test(i8** nocapture readnone %0) {
%2 = tail call i32 @assert_int_equal(i32 16843009, i64 72340172838076673)
%3 = tail call i32 @assert_int_equal(i32 0, i64 0)
ret void
}
long hash(char *word) {
  long ascii_counter = 42;
  long counter = 0;
  while (word[counter] != '\0') {
    ascii_counter = ascii_counter + (word[counter] * (counter + 1));
    counter++;
  }
  return ascii_counter;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x2a,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1162 <hash+0x62>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
mov    -0x18(%rbp),%rdx
add    $0x1,%rdx
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <hash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%dl
mov    $0x2a,%eax
test   %dl,%dl
je     1127 <hash+0x27>
mov    $0x1,%ecx
movsbq %dl,%rdx
imul   %rcx,%rdx
add    %rdx,%rax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <hash+0x10>
ret

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

LLVM IR (-O2):
define i64 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i64 [ %9, %4 ], [ 0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 42, %1 ]
%8 = sext i8 %5 to i64
%9 = add nuw nsw i64 %6, 1
%10 = mul nsw i64 %9, %8
%11 = add nsw i64 %10, %7
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 42, %1 ], [ %11, %4 ]
ret i64 %16
}
void MMU_InvalidateTlbDatasAll(void) {}


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

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

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

LLVM IR (-O2):
define void @MMU_InvalidateTlbDatasAll() {
ret void
}
void save_intermediate_forward_arrays_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @save_intermediate_forward_arrays_adios_() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void number_one() {
  int a = 0b1100;
  int b = -1;
  int complement = a ^ b;
  int final = complement + 1;
  printf("%d\n", final);
}


x86 assembly (clang, -O0):
<number_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xc,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_one>:
lea    0xee9(%rip),%rdi
mov    $0xfffffff4,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @number_one() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 -12)
ret void
}
int mm() {
  int y = 0;
  int x = 0;
  {
    int x = 5;
    if (x == 5)
      return x / y;
  }
  if (x == 0)
    return x / y;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mm>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jne    1132 <mm+0x32>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1152 <mm+0x52>
cmpl   $0x0,-0xc(%rbp)
jne    114b <mm+0x4b>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1152 <mm+0x52>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mm() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int a = 2;
  switch (a) {
  case 1:
    printf("%d \n", a);
  case 2:
    printf("%d \n", a);
  case 3:
    printf("%d \n", a);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     115c <main+0x4c>
jmp    113a <main+0x2a>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116b <main+0x5b>
jmp    114b <main+0x3b>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     117a <main+0x6a>
jmp    1189 <main+0x79>
mov    -0x8(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe8b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isprint(int);
void t_isprint_0x15() {
  Assert_real((isprint(21) == 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",
              110, ("isprint should be 0 for 0x15"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x15>:
push   %rax
mov    $0x15,%edi
call   1030 <isprint@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x6e,%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 0x15\00"
define void @t_isprint_0x15() {
%1 = call i64 @isprint(i32 21)
%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 110, 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 0x15\00"
define void @t_isprint_0x15() {
%1 = tail call i64 @isprint(i32 21)
%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 110, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pclog(char *);
void iso_resume(void) {
  pclog("iso_resume stub\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"iso_resume stub\0A\00"
define void @iso_resume() {
%1 = call i32 @pclog(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"iso_resume stub\0A\00"
define void @iso_resume() {
%1 = tail call i32 @pclog(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret void
}
int test_imm_A6int64_highword_reg(long long val) {
  return ((val >> 32) & (0xA6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_A6int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xa6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_A6int64_highword_reg>:
movabs $0xa600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_A6int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 166
%6 = icmp ne i64 %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_A6int64_highword_reg(i64 %0) {
%2 = and i64 %0, 712964571136
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct packed_buffer {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
scalar_t__ dtos32(double, int /*<<< orphan*/);
int packed_buffer_append_u32(struct packed_buffer *, int /*<<< orphan*/);
int packed_buffer_append_ds32(struct packed_buffer *pb, double d,
                              int32_t scale) {
  return packed_buffer_append_u32(pb, (uint32_t)dtos32(d, scale));
}


x86 assembly (clang, -O0):
<packed_buffer_append_ds32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <dtos32@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <packed_buffer_append_u32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<packed_buffer_append_ds32>:
push   %rbx
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <dtos32@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <packed_buffer_append_u32@plt>

LLVM IR (-O0):
%struct.packed_buffer = type { i32 }
define i32 @packed_buffer_append_ds32(%struct.packed_buffer* %0, double %1, i32 %2) {
%4 = alloca %struct.packed_buffer*
%5 = alloca double
%6 = alloca i32
store %struct.packed_buffer* %0, %struct.packed_buffer** %4
store double %1, double* %5
store i32 %2, i32* %6
%7 = load %struct.packed_buffer*, %struct.packed_buffer** %4
%8 = load double, double* %5
%9 = load i32, i32* %6
%10 = call i64 @dtos32(double %8, i32 %9)
%11 = trunc i64 %10 to i32
%12 = call i32 @packed_buffer_append_u32(%struct.packed_buffer* %7, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.packed_buffer = type { i32 }
define i32 @packed_buffer_append_ds32(%struct.packed_buffer* %0, double %1, i32 %2) {
%4 = tail call i64 @dtos32(double %1, i32 %2)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @packed_buffer_append_u32(%struct.packed_buffer* %0, i32 %5)
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ASN1_BMPSTRING;

/* Variables and functions */
int /*<<< orphan*/ ASN1_BMPSTRING_it;
scalar_t__ ASN1_item_new(int /*<<< orphan*/ *);
ASN1_BMPSTRING *ASN1_BMPSTRING_new(void) {
  return (ASN1_BMPSTRING *)ASN1_item_new(&ASN1_BMPSTRING_it);
}


x86 assembly (clang, -O0):
<ASN1_BMPSTRING_new>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rdi
call   1030 <ASN1_item_new@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ASN1_BMPSTRING_new>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <ASN1_item_new@plt>

LLVM IR (-O0):
@ASN1_BMPSTRING_it = global i32 0
define i32* @ASN1_BMPSTRING_new() {
%1 = call i64 @ASN1_item_new(i32* @ASN1_BMPSTRING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}

LLVM IR (-O2):
@ASN1_BMPSTRING_it = global i32 0
define i32* @ASN1_BMPSTRING_new() {
%1 = tail call i64 @ASN1_item_new(i32* @ASN1_BMPSTRING_it)
%2 = inttoptr i64 %1 to i32*
ret i32* %2
}
char convertUpperLetter(char c) { return (char)(c - 32); }


x86 assembly (clang, -O0):
<convertUpperLetter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<convertUpperLetter>:
lea    -0x20(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @convertUpperLetter(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = sub nsw i32 %4, 32
%6 = trunc i32 %5 to i8
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @convertUpperLetter(i8 signext %0) {
%2 = add i8 %0, -32
ret i8 %2
}
/* Variables and functions */
int print(char **, int *);
int sprintf(char *out, const char *format, ...) {
  int *varg = (int *)(&format);
  return print(&out, varg);
}


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

x86 assembly (clang, -O2):
<sprintf>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <print@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast i8** %4 to i32*
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = call i32 @print(i8** %3, i32* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @sprintf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = bitcast i8** %4 to i32*
%6 = call i32 @print(i8** %3, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void cleanup_conf(void) {
  unlink("/tmp/myntp.conf");
  unlink("/tmp/myntp.drift");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"/tmp/myntp.conf\00"
@.str.1 = [17 x i8] c"/tmp/myntp.drift\00"
define void @cleanup_conf() {
%1 = call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/tmp/myntp.conf\00"
@.str.1 = [17 x i8] c"/tmp/myntp.drift\00"
define void @cleanup_conf() {
%1 = tail call i32 @unlink(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @unlink(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void gdk_window_set_focus_on_map() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_set_focus_on_map() {
ret void
}
void vecsub(float t[], float u[], float v[]) {
  t[0] = u[0] - v[0];
  t[1] = u[1] - v[1];
  t[2] = u[2] - v[2];
}


x86 assembly (clang, -O0):
<vecsub>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<vecsub>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @vecsub(float* %0, float* %1, float* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
store float* %0, float** %4
store float* %1, float** %5
store float* %2, float** %6
%7 = load float*, float** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @vecsub(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
void ARGBGrayRow_C() {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ free(struct cell *);
void cell_dispose(struct cell *c) { free(c); }


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

x86 assembly (clang, -O2):
<cell_dispose>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.cell = type { i32 }
define void @cell_dispose(%struct.cell* nocapture %0) {
%2 = tail call i32 @free(%struct.cell* %0)
ret void
}