xunge/DecIR huggingface dataset:
int progressbar_max(int x, int y) { return x > y ? x : y; }


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

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

LLVM IR (-O0):
define i32 @progressbar_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 @progressbar_max(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
char *gai_strerror(int code) { return "unknown error"; }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"unknown error\00"
define i8* @gai_strerror(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [14 x i8] c"unknown error\00"
define i8* @gai_strerror(i32 %0) {
ret i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0)
}
int GetN() { return 1 << 30; }


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

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

LLVM IR (-O0):
define i32 @GetN() {
ret i32 1073741824
}

LLVM IR (-O2):
define i32 @GetN() {
ret i32 1073741824
}
/* Variables and functions */
int /*<<< orphan*/ test_hash();
int /*<<< orphan*/ test_rbtree();
int main(void) {
  test_rbtree();
  test_hash();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_rbtree()
%2 = tail call i32 (...) @test_hash()
ret i32 0
}
void ADC_IRQHandler() {}


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

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

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

LLVM IR (-O2):
define void @ADC_IRQHandler() {
ret void
}
void pcp_print_huge_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_huge_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_huge_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void printint(int i) { printf("%d", i); }


x86 assembly (clang, -O0):
<printint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printint>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @printint(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
unsigned float_neg(unsigned uf) {}


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

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

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

LLVM IR (-O2):
define i32 @float_neg(i32 %0) {
ret i32 undef
}
/* Variables and functions */
int isdigit(char);
bool isDecimalDigit(char ch) { return isdigit(ch); }


x86 assembly (clang, -O0):
<isDecimalDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isdigit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDecimalDigit>:
jmp    1030 <isdigit@plt>

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

LLVM IR (-O2):
define i32 @isDecimalDigit(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__20__IO__set();
void LedsP__Led2__set(void) { HplAtm128GeneralIOPinP__20__IO__set(); }


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

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

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

LLVM IR (-O2):
define void @LedsP__Led2__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__20__IO__set()
ret void
}
OP(ed, e9) { illegal_2(); }


x86 assembly (clang, -O0):
<OP>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <illegal_2@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
char *strdup(char *);
char *C_mkFixedEndH() {
  char *text = strdup("#endif //PERVASIVES_H\n");
  return text;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"#endif //PERVASIVES_H\0A\00"
define i8* @C_mkFixedEndH() {
%1 = alloca i8*
%2 = call i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@.str = [23 x i8] c"#endif //PERVASIVES_H\0A\00"
define noalias i8* @C_mkFixedEndH() {
%1 = tail call dereferenceable_or_null(23) i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
void ieee802_1x_dealloc_kay_sm_hapd(struct hostapd_data *hapd) {}


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

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

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

LLVM IR (-O2):
%struct.hostapd_data = type opaque
define void @ieee802_1x_dealloc_kay_sm_hapd(%struct.hostapd_data* nocapture %0) {
ret void
}
/* Variables and functions */
size_t lsx_ima_bytes_per_block(size_t chans, size_t samplesPerBlock) {
  size_t n;
  n = ((size_t)samplesPerBlock + 14) / 8 * 4 * chans;
  return n;
}


x86 assembly (clang, -O0):
<lsx_ima_bytes_per_block>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0xe,%rax
shr    $0x3,%rax
shl    $0x2,%rax
imul   -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lsx_ima_bytes_per_block>:
lea    0xe(%rsi),%rax
shr    %rax
and    $0xfffffffffffffffc,%rax
imul   %rdi,%rax
ret

LLVM IR (-O0):
define i64 @lsx_ima_bytes_per_block(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* %4
%7 = add i64 %6, 14
%8 = udiv i64 %7, 8
%9 = mul i64 %8, 4
%10 = load i64, i64* %3
%11 = mul i64 %9, %10
store i64 %11, i64* %5
%12 = load i64, i64* %5
ret i64 %12
}

LLVM IR (-O2):
define i64 @lsx_ima_bytes_per_block(i64 %0, i64 %1) {
%3 = add i64 %1, 14
%4 = lshr i64 %3, 1
%5 = and i64 %4, 9223372036854775804
%6 = mul i64 %5, %0
ret i64 %6
}
/* Variables and functions */
int strlen(char const *);
char *strreverse(const char *str) {
  char *dest;
  int len = 0;
  for (int i = strlen(str); str[i]; i--, len++)
    dest[len] = str[i];
  return dest;
}


x86 assembly (clang, -O0):
<strreverse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116e <strreverse+0x5e>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112f <strreverse+0x1f>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strreverse>:
jmp    1030 <strlen@plt>

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

LLVM IR (-O2):
define noalias i8* @strreverse(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
tail call void @llvm.assume(i1 %6)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void data_free(void *data) { free(data); }


x86 assembly (clang, -O0):
<data_free>:
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):
<data_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @data_free(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 @data_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int yahoo_M1ObfuscatedTableCommon(int, int, unsigned char *);
int yahoo_f01_30(int Salt, int Parameter) {
  static unsigned char LUT[32] = {
      0x19, 0x13, 0x1B, 0x01, 0x1C, 0x0D, 0x0C, 0x15, 0x0B, 0x00, 0x1A,
      0x0F, 0x12, 0x16, 0x08, 0x0A, 0x03, 0x06, 0x14, 0x10, 0x18, 0x04,
      0x11, 0x1D, 0x1F, 0x07, 0x17, 0x05, 0x02, 0x0E, 0x1E, 0x09,
  };
  return yahoo_M1ObfuscatedTableCommon(Salt, Parameter, LUT);
}


x86 assembly (clang, -O0):
<yahoo_f01_30>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    0x2f05(%rip),%rdx
call   1030 <yahoo_M1ObfuscatedTableCommon@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<yahoo_f01_30>:
lea    0x2f19(%rip),%rdx
jmp    1030 <yahoo_M1ObfuscatedTableCommon@plt>

LLVM IR (-O0):
@yahoo_f01_30.LUT = internal global [32 x i8] c"\19\13\1B\01\1C\0D\0C\15\0B\00\1A\0F\12\16\08\0A\03\06\14\10\18\04\11\1D\1F\07\17\05\02\0E\1E\09"
define i32 @yahoo_f01_30(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 = call i32 @yahoo_M1ObfuscatedTableCommon(i32 %5, i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_30.LUT, i64 0, i64 0))
ret i32 %7
}

LLVM IR (-O2):
@yahoo_f01_30.LUT = internal global [32 x i8] c"\19\13\1B\01\1C\0D\0C\15\0B\00\1A\0F\12\16\08\0A\03\06\14\10\18\04\11\1D\1F\07\17\05\02\0E\1E\09"
define i32 @yahoo_f01_30(i32 %0, i32 %1) {
%3 = tail call i32 @yahoo_M1ObfuscatedTableCommon(i32 %0, i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @yahoo_f01_30.LUT, i64 0, i64 0))
ret i32 %3
}
int wps_validate_m7_encr(const struct wpabuf *tlvs, int ap, int wps2) {
  return 0;
}


x86 assembly (clang, -O0):
<wps_validate_m7_encr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.wpabuf = type opaque
define i32 @wps_validate_m7_encr(%struct.wpabuf* %0, i32 %1, i32 %2) {
%4 = alloca %struct.wpabuf*
%5 = alloca i32
%6 = alloca i32
store %struct.wpabuf* %0, %struct.wpabuf** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.wpabuf = type opaque
define i32 @wps_validate_m7_encr(%struct.wpabuf* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
int subs_si_test1(int a, int b, int c) {
  int d = a - b;
  if (d <= 0)
    return a + c;
  else
    return b + d + c;
}


x86 assembly (clang, -O0):
<subs_si_test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     112e <subs_si_test1+0x2e>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    113a <subs_si_test1+0x3a>
mov    -0xc(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @subs_si_test1(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, %0
ret i32 %4
}
double max3(double a, double b, double c) {
  if (a > b) {
    if (a > c)
      return a;
    else
      return c;
  } else {
    if (b > c)
      return b;
    else
      return c;
  }
}


x86 assembly (clang, -O0):
<max3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1151 <max3+0x51>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1142 <max3+0x42>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <max3+0x7a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <max3+0x7a>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1170 <max3+0x70>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    117a <max3+0x7a>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<max3>:
maxsd  %xmm1,%xmm0
maxsd  %xmm2,%xmm0
ret

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

LLVM IR (-O2):
define double @max3(double %0, double %1, double %2) {
%4 = fcmp ogt double %0, %1
%5 = fcmp ogt double %0, %2
%6 = select i1 %5, double %0, double %2
%7 = fcmp ogt double %1, %2
%8 = select i1 %7, double %1, double %2
%9 = select i1 %4, double %6, double %8
ret double %9
}
/* Variables and functions */
int strtol(char *, char **, int);
int mystrtoi(char **p, int base, int *res) {
  char *start = *p;
  *res = strtol(*p, p, base);
  if (*p != start)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<mystrtoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtol@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x28(%rbp),%rax
je     1166 <mystrtoi+0x56>
movl   $0x1,-0x4(%rbp)
jmp    116d <mystrtoi+0x5d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrtoi>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%edx
mov    %rdi,%rbx
mov    (%rdi),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strtol@plt>
mov    %eax,(%r14)
xor    %eax,%eax
cmp    %r15,(%rbx)
setne  %al
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @mystrtoi(i8** nocapture %0, i32 %1, i32* nocapture writeonly %2) {
%4 = load i8*, i8** %0
%5 = tail call i32 @strtol(i8* %4, i8** %0, i32 %1)
store i32 %5, i32* %2
%6 = load i8*, i8** %0
%7 = icmp ne i8* %6, %4
%8 = zext i1 %7 to i32
ret i32 %8
}
void Setup() {}


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

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

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

LLVM IR (-O2):
define void @Setup() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  char foo[10];
  strcpy(foo, "123456789");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
lea    0xed6(%rip),%rsi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee5(%rip),%rsi
lea    0xe(%rsp),%rdi
call   1030 <strcpy@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"123456789\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void signals_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @signals_reset() {
ret void
}
int main(void) {
  volatile int stack1 = 0;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x0,-0x4(%rsp)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ ST7735_Circle(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
void LCD_DrawCircle(uint16_t x, uint16_t y, uint16_t radius, uint16_t color) {
  ST7735_Circle(x, y, radius, color);
}


x86 assembly (clang, -O0):
<LCD_DrawCircle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <ST7735_Circle@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_DrawCircle>:
jmp    1030 <ST7735_Circle@plt>

LLVM IR (-O0):
define void @LCD_DrawCircle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @ST7735_Circle(i32 %9, i32 %10, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @LCD_DrawCircle(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @ST7735_Circle(i32 %0, i32 %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Redirect(char const *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ STDERR_FILENO;
void RedirectStderr(const char *stderr_path) {
  Redirect(stderr_path, STDERR_FILENO, "stderr");
}


x86 assembly (clang, -O0):
<RedirectStderr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xed0(%rip),%rdx
call   1030 <Redirect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RedirectStderr>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xee0(%rip),%rdx
jmp    1030 <Redirect@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
@.str = [7 x i8] c"stderr\00"
define void @RedirectStderr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @STDERR_FILENO
%5 = call i32 @Redirect(i8* %3, i32 %4, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
@.str = [7 x i8] c"stderr\00"
define void @RedirectStderr(i8* %0) {
%2 = load i32, i32* @STDERR_FILENO
%3 = tail call i32 @Redirect(i8* %0, i32 %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}
main() {
  int y, a;
  int *p, *q, *t;
  q = &a;
  p = q;
  t = p;
  *p = 5;
  *t = 7;
  y = *q;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x7,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
int read_frame() {}


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

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

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

LLVM IR (-O2):
define i32 @read_frame() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ SDL_DestroyRenderer(void *);
void lSDL_Renderer_destroy(void *ptr) { SDL_DestroyRenderer(ptr); }


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

x86 assembly (clang, -O2):
<lSDL_Renderer_destroy>:
jmp    1030 <SDL_DestroyRenderer@plt>

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

LLVM IR (-O2):
define void @lSDL_Renderer_destroy(i8* %0) {
%2 = tail call i32 @SDL_DestroyRenderer(i8* %0)
ret void
}
/* Type definitions */
struct snck_string {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ snck_string_init_ref_buffer(struct snck_string *const,
                                               char const *const,
                                               int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *const);
void snck_string_init_ref(struct snck_string *const p_string,
                          char const *const p_ref) {
  snck_string_init_ref_buffer(p_string, p_ref, strlen(p_ref));
}


x86 assembly (clang, -O0):
<snck_string_init_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1040 <snck_string_init_ref_buffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<snck_string_init_ref>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <snck_string_init_ref_buffer@plt>

LLVM IR (-O0):
%struct.snck_string = type { i32 }
define void @snck_string_init_ref(%struct.snck_string* %0, i8* %1) {
%3 = alloca %struct.snck_string*
%4 = alloca i8*
store %struct.snck_string* %0, %struct.snck_string** %3
store i8* %1, i8** %4
%5 = load %struct.snck_string*, %struct.snck_string** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @snck_string_init_ref_buffer(%struct.snck_string* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.snck_string = type { i32 }
define void @snck_string_init_ref(%struct.snck_string* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @snck_string_init_ref_buffer(%struct.snck_string* %0, i8* %1, i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fdopen(int, char *);
FILE *file_int_fdtostream(int fd, char *mode) { return fdopen(fd, mode); }


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

x86 assembly (clang, -O2):
<file_int_fdtostream>:
jmp    1030 <fdopen@plt>

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

LLVM IR (-O2):
define noalias i32* @file_int_fdtostream(i32 %0, i8* nocapture %1) {
%3 = tail call i32* @fdopen(i32 %0, i8* %1)
ret i32* %3
}
/* Variables and functions */
char tolower(char);
void strlower(char *s) {
  while (*s) {
    *s = tolower(*s);
    s++;
  }
}


x86 assembly (clang, -O0):
<strlower>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114e <strlower+0x3e>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <tolower@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <strlower+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlower>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1136 <strlower+0x26>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tolower@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <strlower+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strlower(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call signext i8 @tolower(i8 signext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ environ_appaserver_home();
void add_appaserver_home_to_environment(void) { environ_appaserver_home(); }


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

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

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

LLVM IR (-O2):
define void @add_appaserver_home_to_environment() {
%1 = tail call i32 (...) @environ_appaserver_home()
ret void
}
double jul_and_time_to_jul(long jul, int hour, int min, double sec) {
  return ((double)jul) +
         (((double)(((hour - 12) * 60 + min) * 60)) + sec) / 86400.0;
}


x86 assembly (clang, -O0):
<jul_and_time_to_jul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdq -0x8(%rbp),%xmm0
mov    -0xc(%rbp),%eax
sub    $0xc,%eax
imul   $0x3c,%eax,%eax
add    -0x10(%rbp),%eax
imul   $0x3c,%eax,%eax
cvtsi2sd %eax,%xmm1
addsd  -0x18(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jul_and_time_to_jul>:
cvtsi2sd %rdi,%xmm1
imul   $0x3c,%esi,%eax
add    %edx,%eax
imul   $0x3c,%eax,%eax
add    $0xffff5740,%eax
cvtsi2sd %eax,%xmm2
addsd  %xmm2,%xmm0
divsd  0xede(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @jul_and_time_to_jul(i64 %0, i32 %1, i32 %2, double %3) {
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i64 %0, i64* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
%9 = load i64, i64* %5
%10 = sitofp i64 %9 to double
%11 = load i32, i32* %6
%12 = sub nsw i32 %11, 12
%13 = mul nsw i32 %12, 60
%14 = load i32, i32* %7
%15 = add nsw i32 %13, %14
%16 = mul nsw i32 %15, 60
%17 = sitofp i32 %16 to double
%18 = load double, double* %8
%19 = fadd double %17, %18
%20 = fdiv double %19, 8.640000e+04
%21 = fadd double %10, %20
ret double %21
}

LLVM IR (-O2):
define double @jul_and_time_to_jul(i64 %0, i32 %1, i32 %2, double %3) {
%5 = sitofp i64 %0 to double
%6 = mul i32 %1, 60
%7 = add i32 %6, -720
%8 = add nsw i32 %7, %2
%9 = mul nsw i32 %8, 60
%10 = sitofp i32 %9 to double
%11 = fadd double %10, %3
%12 = fdiv double %11, 8.640000e+04
%13 = fadd double %12, %5
ret double %13
}
int exe$rmsrundwn(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$rmsrundwn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$rmsrundwn>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$rmsrundwn"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$rmsrundwn"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ CommandPrev(unsigned int);
void CommandPrevLine(unsigned int arg) {
  if (0 == arg)
    arg = 1;
  CommandPrev(arg);
}


x86 assembly (clang, -O0):
<CommandPrevLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    112d <CommandPrevLine+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <CommandPrev@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommandPrevLine>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <CommandPrev@plt>

LLVM IR (-O0):
define void @CommandPrevLine(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 0, %3
br i1 %4, label %5, label %6
5: ; preds = %1
store i32 1, i32* %2
br label %6
6: ; preds = %5, %1
%7 = load i32, i32* %2
%8 = call i32 @CommandPrev(i32 %7)
ret void
}

LLVM IR (-O2):
define void @CommandPrevLine(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i32 @CommandPrev(i32 %3)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int send_event;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
void set_XLeaveWindowEvent_send_event(void *_p, int _v) {
  ((XLeaveWindowEvent *)_p)->send_event = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XLeaveWindowEvent_send_event>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @set_XLeaveWindowEvent_send_event(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i32 %5, i32* %8
ret void
}

LLVM IR (-O2):
define void @set_XLeaveWindowEvent_send_event(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ block();
int f1(int, int);
int main(int argc, char *argv[]) {
  block();
  return f1(1, 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <block@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <f1@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <block@plt>
mov    $0x1,%edi
mov    $0x2,%esi
pop    %rax
jmp    1030 <f1@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @block()
%7 = call i32 @f1(i32 1, i32 2)
ret i32 %7
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @block()
%4 = tail call i32 @f1(i32 1, i32 2)
ret i32 %4
}
int IsStringEnd(c)
char c;
{ return ((c == '\0')); }


x86 assembly (clang, -O0):
<IsStringEnd>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsStringEnd>:
xor    %eax,%eax
test   %dil,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @IsStringEnd(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @IsStringEnd(i32 %0) {
%2 = and i32 %0, 255
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct YsGLSL3DRenderer {
  int dummy;
};

/* Variables and functions */
struct YsGLSL3DRenderer *YsGLSLCreateVariColorMarker3DRenderer();
struct YsGLSL3DRenderer *YsGLSLCreateMonoColorMarker3DRenderer(void) {
  return YsGLSLCreateVariColorMarker3DRenderer();
}


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

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

LLVM IR (-O0):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorMarker3DRenderer() {
%1 = call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorMarker3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}

LLVM IR (-O2):
%struct.YsGLSL3DRenderer = type { i32 }
define %struct.YsGLSL3DRenderer* @YsGLSLCreateMonoColorMarker3DRenderer() {
%1 = tail call %struct.YsGLSL3DRenderer* (...) @YsGLSLCreateVariColorMarker3DRenderer()
ret %struct.YsGLSL3DRenderer* %1
}
int __ccv_filter_size(double sigma) {
  int fsz = (int)(5 * sigma);
  if (fsz % 2 == 0)
    fsz++;
  if (fsz < 3)
    fsz = 3;
  return fsz;
}


x86 assembly (clang, -O0):
<__ccv_filter_size>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    113a <__ccv_filter_size+0x3a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    114b <__ccv_filter_size+0x4b>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ccv_filter_size>:
mulsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,%ecx
not    %ecx
and    $0x1,%ecx
add    %eax,%ecx
cmp    $0x4,%ecx
mov    $0x3,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @__ccv_filter_size(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 5.000000e+00, %4
%6 = fptosi double %5 to i32
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = srem i32 %7, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %1
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %1
%14 = load i32, i32* %3
%15 = icmp slt i32 %14, 3
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 3, i32* %3
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
define i32 @__ccv_filter_size(double %0) {
%2 = fmul double %0, 5.000000e+00
%3 = fptosi double %2 to i32
%4 = and i32 %3, 1
%5 = xor i32 %4, 1
%6 = add nsw i32 %5, %3
%7 = icmp sgt i32 %6, 3
%8 = select i1 %7, i32 %6, i32 3
ret i32 %8
}
int main() {
  int arg = 0xA0000000;
  int out = 0;
  __asm__("movl %1, %0;" : "=r"(out) : "m"(arg));
  return arg == out;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xa0000000,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0xa0000000,-0x4(%rsp)
a0
mov    -0x4(%rsp),%ecx
xor    %eax,%eax
cmp    $0xa0000000,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 -1610612736, i32* %2
store i32 0, i32* %3
%4 = call i32 asm "movl $1, $0;", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2)
store i32 %4, i32* %3
%5 = load i32, i32* %2
%6 = load i32, i32* %3
%7 = icmp eq i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 -1610612736, i32* %1
%3 = call i32 asm "movl $1, $0;", "=r,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %1)
%4 = icmp eq i32 %3, -1610612736
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void _mesa_dlclose(void *handle) { dlclose(handle); }


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

x86 assembly (clang, -O2):
<_mesa_dlclose>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @_mesa_dlclose(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Variables and functions */
char *login();
int /*<<< orphan*/ print_menu();
int /*<<< orphan*/ print_sys_msg();
int /*<<< orphan*/ print_welcome_msg();
int /*<<< orphan*/ process(char *);
int main(int argc, char *argv[]) {
  char *username = NULL;
  print_sys_msg();
  username = login();
  print_welcome_msg();
  while (0) {
    print_menu();
    process(username);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    $0x0,%al
call   1050 <print_sys_msg@plt>
mov    $0x0,%al
call   1040 <login@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1070 <print_welcome_msg@plt>
xor    %eax,%eax
test   $0x1,%al
jne    1196 <main+0x46>
jmp    11ab <main+0x5b>
mov    $0x0,%al
call   1060 <print_menu@plt>
mov    -0x18(%rbp),%rdi
call   1030 <process@plt>
jmp    1187 <main+0x37>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = call i32 (...) @print_sys_msg()
%8 = call i8* (...) @login()
store i8* %8, i8** %6
%9 = call i32 (...) @print_welcome_msg()
br label %10
10: ; preds = %11, %2
br i1 false, label %11, label %15
11: ; preds = %10
%12 = call i32 (...) @print_menu()
%13 = load i8*, i8** %6
%14 = call i32 @process(i8* %13)
br label %10
15: ; preds = %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @print_sys_msg()
%4 = tail call i8* (...) @login()
%5 = tail call i32 (...) @print_welcome_msg()
ret i32 0
}
int mDB_kill(fn) { return mDBi_msg('k', fn, 0, 0, 0, 0, 0, 0); }


x86 assembly (clang, -O0):
<mDB_kill>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x6b,%edi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
mov    $0x0,%al
call   1030 <mDBi_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mDB_kill>:
push   %rax
mov    %edi,%esi
mov    $0x6b,%edi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
xor    %eax,%eax
push   $0x0
push   $0x0
call   1030 <mDBi_msg@plt>
add    $0x10,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @mDB_kill(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 107, i32 %3, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @mDB_kill(i32 %0) {
%2 = tail call i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...) bitcast (i32 (...)* @mDBi_msg to i32 (i32, i32, i32, i32, i32, i32, i32, i32, ...)*)(i32 107, i32 %0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i32 %2
}