xunge/DecIR huggingface dataset:
int isascii(int c) { return ('!' <= c && c <= '~'); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x21,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <isascii+0x24>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isascii(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 33, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int get_gpio_number(int);
int input_gpio(int);
int digitalRead(int gpio) {
  int gpioPin = get_gpio_number(gpio);
  return input_gpio(gpioPin);
}


x86 assembly (clang, -O0):
<digitalRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_gpio_number@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <input_gpio@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalRead>:
push   %rax
call   1030 <get_gpio_number@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <input_gpio@plt>

LLVM IR (-O0):
define i32 @digitalRead(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @get_gpio_number(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @input_gpio(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @digitalRead(i32 %0) {
%2 = tail call i32 @get_gpio_number(i32 %0)
%3 = tail call i32 @input_gpio(i32 %2)
ret i32 %3
}
double f(void) { return 3.1415926; }


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @f() {
ret double 0x400921FB4D12D84A
}

LLVM IR (-O2):
define double @f() {
ret double 0x400921FB4D12D84A
}
/* Variables and functions */
scalar_t__ iswhitespace(char);
char *eatwhite(char *str) {
  while (*str && iswhitespace(*str))
    str++;
  return str;
}


x86 assembly (clang, -O0):
<eatwhite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <eatwhite+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <iswhitespace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <eatwhite+0x47>
jmp    1168 <eatwhite+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <eatwhite+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatwhite>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <eatwhite+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <iswhitespace@plt>
test   %rax,%rax
je     1139 <eatwhite+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <eatwhite+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @eatwhite(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %15, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = call i64 @iswhitespace(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %3
%14 = phi i1 [ false, %3 ], [ %12, %8 ]
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %3
18: ; preds = %13
%19 = load i8*, i8** %2
ret i8* %19
}

LLVM IR (-O2):
define i8* @eatwhite(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @iswhitespace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ clog_flush(int *);
void clog_flush_(int *flag) { clog_flush(flag); }


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

x86 assembly (clang, -O2):
<clog_flush_>:
jmp    1030 <clog_flush@plt>

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

LLVM IR (-O2):
define void @clog_flush_(i32* %0) {
%2 = tail call i32 @clog_flush(i32* %0)
ret void
}
int x38_process_request(struct mypacket *packet) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.mypacket = type opaque
define i32 @x38_process_request(%struct.mypacket* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void hint(char *s) {
  fprintf(stderr, "Try `%s' --help for more information.\n", s);
}


x86 assembly (clang, -O0):
<hint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xed0(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hint>:
mov    %rdi,%rdx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"Try `%s' --help for more information.\0A\00"
define void @hint(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"Try `%s' --help for more information.\0A\00"
define void @hint(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ pthread_mutex_lock(int /*<<< orphan*/ *);
void lockb(pthread_mutex_t *a, pthread_mutex_t *b) {
  pthread_mutex_lock(b);
  return;
}


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

x86 assembly (clang, -O2):
<lockb>:
mov    %rsi,%rdi
jmp    1030 <pthread_mutex_lock@plt>

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

LLVM IR (-O2):
define void @lockb(i32* nocapture readnone %0, i32* %1) {
%3 = tail call i32 @pthread_mutex_lock(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void DefaultFreeFunc(void *opaque, void *address) {
  (void)(opaque);
  free(address);
}


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

x86 assembly (clang, -O2):
<DefaultFreeFunc>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @DefaultFreeFunc(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EEPROMBlockHide(uint32_t ui32Block) {
  ASSERT(!ui32Block);
  ASSERT(ui32Block <
         ((((*((volatile uint32_t *)(0x400AF000)))) & 0x07FF0000) >> 16));
  (*((volatile uint32_t *)(0x400AF050))) = (1 << ui32Block);
}


x86 assembly (clang, -O0):
<EEPROMBlockHide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
mov    $0x400af000,%ecx
mov    (%rcx),%ecx
and    $0x7ff0000,%ecx
sar    $0x10,%ecx
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400af050,%eax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EEPROMBlockHide>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
sete   %dil
call   1030 <ASSERT@plt>
mov    0x400af000,%eax
shr    $0x10,%eax
and    $0x7ff,%eax
xor    %edi,%edi
cmp    %ebx,%eax
setg   %dil
call   1030 <ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
mov    %eax,0x400af050
pop    %rbx
ret

LLVM IR (-O0):
define void @EEPROMBlockHide(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
%7 = call i32 @ASSERT(i32 %6)
%8 = load i32, i32* %2
%9 = load volatile i32, i32* inttoptr (i64 1074458624 to i32*)
%10 = and i32 %9, 134152192
%11 = ashr i32 %10, 16
%12 = icmp slt i32 %8, %11
%13 = zext i1 %12 to i32
%14 = call i32 @ASSERT(i32 %13)
%15 = load i32, i32* %2
%16 = shl i32 1, %15
store volatile i32 %16, i32* inttoptr (i64 1074458704 to i32*)
ret void
}

LLVM IR (-O2):
define void @EEPROMBlockHide(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @ASSERT(i32 %3)
%5 = load volatile i32, i32* inttoptr (i64 1074458624 to i32*)
%6 = lshr i32 %5, 16
%7 = and i32 %6, 2047
%8 = icmp sgt i32 %7, %0
%9 = zext i1 %8 to i32
%10 = tail call i32 @ASSERT(i32 %9)
%11 = shl nuw i32 1, %0
store volatile i32 %11, i32* inttoptr (i64 1074458704 to i32*)
ret void
}
double max(double a, double b) { return (a < b) ? b : a; }


x86 assembly (clang, -O0):
<max>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1131 <max+0x31>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    113b <max+0x3b>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @max(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = select i1 %3, double %1, double %0
ret double %4
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ decoder_getData(int /*<<< orphan*/, void *, int);
uint64_t SSP_Decoder_GetData(uint32_t handle, void *buffer, int length) {
  return decoder_getData(handle, buffer, length);
}


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

x86 assembly (clang, -O2):
<SSP_Decoder_GetData>:
jmp    1030 <decoder_getData@plt>

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

LLVM IR (-O2):
define i32 @SSP_Decoder_GetData(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @decoder_getData(i32 %0, i8* %1, i32 %2)
ret i32 %4
}
/* Variables and functions */
int lengthOfLongestSubstring(char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  char *s = "multimonial";
  if (argc >= 2)
    s = argv[1];
  printf("%d", lengthOfLongestSubstring(s));
  return 0;
}


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)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jl     1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <lengthOfLongestSubstring@plt>
mov    %eax,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jl     112c <main+0xc>
mov    0x8(%rsi),%rdi
jmp    1133 <main+0x13>
lea    0xecd(%rip),%rdi
call   1040 <lengthOfLongestSubstring@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"multimonial\00"
@.str.1 = [3 x i8] c"%d\00"
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* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 2
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
store i8* %12, i8** %6
br label %13
13: ; preds = %9, %2
%14 = load i8*, i8** %6
%15 = call i32 @lengthOfLongestSubstring(i8* %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"multimonial\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @lengthOfLongestSubstring(i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ MAP_PRIVATE;
int /*<<< orphan*/ PROT_NONE;
int /*<<< orphan*/ access(char *, int);
int /*<<< orphan*/ getuid();
int /*<<< orphan*/ mmap(void *, int, int /*<<< orphan*/, int /*<<< orphan*/,
                        int, int /*<<< orphan*/);
int /*<<< orphan*/ setuid(int);
void ignoredReturnValue(void *addr, int fd) {
  mmap(addr, 255, PROT_NONE, MAP_PRIVATE, fd, 0);
  setuid(42);
  getuid();
  access("filename", 1);
}


x86 assembly (clang, -O0):
<ignoredReturnValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e96(%rip),%rax
mov    (%rax),%edx
mov    0x2e75(%rip),%rax
mov    (%rax),%ecx
mov    -0xc(%rbp),%r8d
mov    $0xff,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    $0x2a,%edi
call   1060 <setuid@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
lea    0xe72(%rip),%rdi
mov    $0x1,%esi
call   1050 <access@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ignoredReturnValue>:
push   %rax
mov    %esi,%r8d
mov    0x2ea5(%rip),%rax
mov    (%rax),%edx
mov    0x2e84(%rip),%rax
mov    (%rax),%ecx
mov    $0xff,%esi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    $0x2a,%edi
call   1060 <setuid@plt>
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xe85(%rip),%rdi
mov    $0x1,%esi
pop    %rax
jmp    1050 <access@plt>

LLVM IR (-O0):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
@.str = [9 x i8] c"filename\00"
define void @ignoredReturnValue(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* @PROT_NONE
%7 = load i32, i32* @MAP_PRIVATE
%8 = load i32, i32* %4
%9 = call i32 @mmap(i8* %5, i32 255, i32 %6, i32 %7, i32 %8, i32 0)
%10 = call i32 @setuid(i32 42)
%11 = call i32 (...) @getuid()
%12 = call i32 @access(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@PROT_NONE = global i32 0
@MAP_PRIVATE = global i32 0
@.str = [9 x i8] c"filename\00"
define void @ignoredReturnValue(i8* %0, i32 %1) {
%3 = load i32, i32* @PROT_NONE
%4 = load i32, i32* @MAP_PRIVATE
%5 = tail call i32 @mmap(i8* %0, i32 255, i32 %3, i32 %4, i32 %1, i32 0)
%6 = tail call i32 @setuid(i32 42)
%7 = tail call i32 (...) @getuid()
%8 = tail call i32 @access(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int write(int /*<<< orphan*/, char *, int);
int term_show_cursor() { return write(stdout, "\x1b[?25h", 6) != 6; }


x86 assembly (clang, -O0):
<term_show_cursor>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
cmp    $0x6,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<term_show_cursor>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
xor    %ecx,%ecx
cmp    $0x6,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25h\00"
define i32 @term_show_cursor() {
%1 = load i32, i32* @stdout
%2 = call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp ne i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [7 x i8] c"\1B[?25h\00"
define i32 @term_show_cursor() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @write(i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%3 = icmp ne i32 %2, 6
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ add_scriptb(int);
void add_scriptc(int a) {
  while (a >= 0x40) {
    add_scriptb((a & 0x3f) | 0x40);
    a = (a - 0x40) >> 6;
  }
  add_scriptb(a & 0x3f);
}


x86 assembly (clang, -O0):
<add_scriptc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x40,-0x4(%rbp)
jl     1144 <add_scriptc+0x34>
mov    -0x4(%rbp),%edi
and    $0x3f,%edi
or     $0x40,%edi
call   1030 <add_scriptb@plt>
mov    -0x4(%rbp),%eax
sub    $0x40,%eax
sar    $0x6,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <add_scriptc+0xb>
mov    -0x4(%rbp),%edi
and    $0x3f,%edi
call   1030 <add_scriptb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_scriptc>:
push   %rbx
mov    %edi,%ebx
cmp    $0x40,%edi
jl     1141 <add_scriptc+0x31>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
and    $0x3f,%edi
or     $0x40,%edi
call   1030 <add_scriptb@plt>
add    $0xffffffc0,%ebx
mov    %ebx,%edi
shr    $0x6,%edi
cmp    $0xfff,%ebx
mov    %edi,%ebx
ja     1120 <add_scriptc+0x10>
jmp    1143 <add_scriptc+0x33>
mov    %ebx,%edi
and    $0x3f,%edi
pop    %rbx
jmp    1030 <add_scriptb@plt>

LLVM IR (-O0):
define void @add_scriptc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 64
br i1 %5, label %6, label %14
6: ; preds = %3
%7 = load i32, i32* %2
%8 = and i32 %7, 63
%9 = or i32 %8, 64
%10 = call i32 @add_scriptb(i32 %9)
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 64
%13 = ashr i32 %12, 6
store i32 %13, i32* %2
br label %3
14: ; preds = %3
%15 = load i32, i32* %2
%16 = and i32 %15, 63
%17 = call i32 @add_scriptb(i32 %16)
ret void
}

LLVM IR (-O2):
define void @add_scriptc(i32 %0) {
%2 = icmp sgt i32 %0, 63
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = and i32 %4, 63
%6 = or i32 %5, 64
%7 = tail call i32 @add_scriptb(i32 %6)
%8 = add nsw i32 %4, -64
%9 = lshr i32 %8, 6
%10 = icmp ugt i32 %8, 4095
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ %0, %1 ], [ %9, %3 ]
%13 = and i32 %12, 63
%14 = tail call i32 @add_scriptb(i32 %13)
ret void
}
/* Type definitions */
typedef size_t uint32_t;

/* Variables and functions */
void initZero(uint32_t t, uint32_t *A) {
  uint32_t i;
  for (i = 0; i < t; i++) {
    A[i] = 0x0;
  }
}


x86 assembly (clang, -O0):
<initZero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x8(%rbp),%rax
jae    1143 <initZero+0x43>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <initZero+0x14>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initZero>:
test   %rdi,%rdi
je     112b <initZero+0x1b>
push   %rax
mov    %rdi,%rdx
shl    $0x3,%rdx
mov    %rsi,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @initZero(i64 %0, i64* nocapture writeonly %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = bitcast i64* %1 to i8*
%6 = shl nuw i64 %0, 3
br label %7
7: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hook(char *);
void init(void) { hook("init() called inside weak-import."); }


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"init() called inside weak-import.\00"
define void @init() {
%1 = call i32 @hook(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"init() called inside weak-import.\00"
define void @init() {
%1 = tail call i32 @hook(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ handOpen(int /*<<< orphan*/);
void handClose() { handOpen(0); }


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

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

LLVM IR (-O0):
define void @handClose() {
%1 = call i32 @handOpen(i32 0)
ret void
}

LLVM IR (-O2):
define void @handClose() {
%1 = tail call i32 @handOpen(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void ADCSequenceOverflowClear(unsigned long ulBase,
                              unsigned long ulSequenceNum) {
  DEBUG_ASSERT((ulBase == 0x40038000) || (ulBase == 0x40039000));
  DEBUG_ASSERT(ulSequenceNum < 4);
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 1 << ulSequenceNum;
}


x86 assembly (clang, -O0):
<ADCSequenceOverflowClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%al
cmpq   $0x40038000,-0x8(%rbp)
40
mov    %al,-0x11(%rbp)
je     1141 <ADCSequenceOverflowClear+0x31>
cmpq   $0x40039000,-0x8(%rbp)
40
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x4,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x10(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceOverflowClear>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rdi,%rax
and    $0xffffffffffffefff,%rax
xor    %edi,%edi
cmp    $0x40038000,%rax
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x4,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
cltq
mov    %rax,0x10(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @ADCSequenceOverflowClear(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1073971200
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i64, i64* %3
%9 = icmp eq i64 %8, 1073975296
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @DEBUG_ASSERT(i32 %12)
%14 = load i64, i64* %4
%15 = icmp ult i64 %14, 4
%16 = zext i1 %15 to i32
%17 = call i32 @DEBUG_ASSERT(i32 %16)
%18 = load i64, i64* %4
%19 = trunc i64 %18 to i32
%20 = shl i32 1, %19
%21 = sext i32 %20 to i64
%22 = load i64, i64* %3
%23 = add i64 %22, 16
%24 = inttoptr i64 %23 to i64*
store volatile i64 %21, i64* %24
ret void
}

LLVM IR (-O2):
define void @ADCSequenceOverflowClear(i64 %0, i64 %1) {
%3 = and i64 %0, -4097
%4 = icmp eq i64 %3, 1073971200
%5 = zext i1 %4 to i32
%6 = tail call i32 @DEBUG_ASSERT(i32 %5)
%7 = icmp ult i64 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 @DEBUG_ASSERT(i32 %8)
%10 = trunc i64 %1 to i32
%11 = shl nuw i32 1, %10
%12 = sext i32 %11 to i64
%13 = add i64 %0, 16
%14 = inttoptr i64 %13 to i64*
store volatile i64 %12, i64* %14
ret void
}
/* Variables and functions */
int EOF;
int getchar();
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("%d\n", EOF);
  int c;
  c = getchar();
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EOF = global i32 0
define i32 @main() {
%1 = load i32, i32* @EOF
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getchar()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
void FanChannelEnable(unsigned long ulBase, unsigned long ulChannel) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000004))) |= 1 << ulChannel;
}


x86 assembly (clang, -O0):
<FanChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelEnable>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rax,0x4(%rdi)
ret

LLVM IR (-O0):
define void @FanChannelEnable(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 4
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @FanChannelEnable(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = add i64 %0, 4
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
void gdk_pixbuf_get_from_image() {}


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

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

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

LLVM IR (-O2):
define void @gdk_pixbuf_get_from_image() {
ret void
}
float my_fabs(float x) {
  if (x < 0)
    return -x;
  else
    return x;
}


x86 assembly (clang, -O0):
<my_fabs>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1132 <my_fabs+0x32>
movss  -0x8(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    113c <my_fabs+0x3c>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_fabs>:
movaps 0xef9(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
movaps %xmm0,%xmm1
cmpltss %xmm3,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @my_fabs(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load float, float* %3
%8 = fneg float %7
store float %8, float* %2
br label %11
9: ; preds = %1
%10 = load float, float* %3
store float %10, float* %2
br label %11
11: ; preds = %9, %6
%12 = load float, float* %2
ret float %12
}

LLVM IR (-O2):
define float @my_fabs(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_DETACH;
scalar_t__ ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int,
                  int /*<<< orphan*/);
bool sm_detach(pid_t target) {
  return ptrace(PTRACE_DETACH, target, 1, 0) == 0;
}


x86 assembly (clang, -O0):
<sm_detach>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sm_detach>:
push   %rax
mov    %edi,%esi
mov    0x2ece(%rip),%rax
mov    (%rax),%edi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@PTRACE_DETACH = global i32 0
define i32 @sm_detach(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_DETACH
%4 = load i32, i32* %2
%5 = call i64 @ptrace(i32 %3, i32 %4, i32 1, i32 0)
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
@PTRACE_DETACH = global i32 0
define i32 @sm_detach(i32 %0) {
%2 = load i32, i32* @PTRACE_DETACH
%3 = tail call i64 @ptrace(i32 %2, i32 %0, i32 1, i32 0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
int __attribute__((no)) test(int __attribute__((unused)) b, int a) {
  if (!(a & 2))
    link_error();
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1134 <test+0x24>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
test   $0x2,%sil
jne    1122 <test+0x12>
push   %rax
xor    %eax,%eax
call   1030 <link_error@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define i32 @test(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = and i32 %6, 2
%8 = icmp ne i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 (...) @link_error()
br label %11
11: ; preds = %9, %2
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @test(i32 %0, i32 %1) {
%3 = and i32 %1, 2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @link_error()
br label %7
7: ; preds = %5, %2
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ TestArray_test_fold();
int main() {
  TestArray_test_fold();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @TestArray_test_fold()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  if (n % 3 == 0 && n % 7 == 0) {
    printf("MULTIPLO\n");
  } else {
    printf("NAO E MULTIPLO\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1178 <main+0x58>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1178 <main+0x58>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    1184 <main+0x64>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
imul   $0xffffffff92492493,%rax,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%esi
shr    $0x1f,%esi
sar    $0x2,%edx
add    %esi,%edx
lea    0x0(,%rdx,8),%esi
sub    %esi,%edx
add    %eax,%edx
sub    %ecx,%eax
or     %eax,%edx
lea    0xe8e(%rip),%rax
lea    0xe81(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@str = [15 x i8] c"NAO E MULTIPLO\00"
@str.3 = [9 x i8] c"MULTIPLO\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = srem i32 %4, 3
%6 = srem i32 %4, 7
%7 = or i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0)
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ decorate(char *, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strlen(char *);
int main() {
  char buffer[16];
  scanf("%s", buffer);
  decorate(buffer, strlen(buffer));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1050 <decorate@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1050 <decorate@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [16 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = call i32 @strlen(i8* %6)
%8 = call i32 @decorate(i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = call i32 @decorate(i8* %2, i32 %4)
ret i32 0
}
void gtk_tree_view_column_set_resizable() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_column_set_resizable() {
ret void
}
/* Variables and functions */
int overlap(void *r1, void *r2, size_t len) {
  return (size_t)r1 <= (size_t)r2 && (size_t)r2 < (size_t)(r1 + len);
}


x86 assembly (clang, -O0):
<overlap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0x19(%rbp)
ja     113b <overlap+0x3b>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    -0x18(%rbp),%rcx
cmp    %rcx,%rax
setb   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<overlap>:
cmp    %rsi,%rdi
setbe  %al
add    %rdi,%rdx
cmp    %rsi,%rdx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @overlap(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = icmp ule i64 %8, %10
br i1 %11, label %12, label %20
12: ; preds = %3
%13 = load i8*, i8** %5
%14 = ptrtoint i8* %13 to i64
%15 = load i8*, i8** %4
%16 = load i64, i64* %6
%17 = getelementptr i8, i8* %15, i64 %16
%18 = ptrtoint i8* %17 to i64
%19 = icmp ult i64 %14, %18
br label %20
20: ; preds = %12, %3
%21 = phi i1 [ false, %3 ], [ %19, %12 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @overlap(i8* readnone %0, i8* readnone %1, i64 %2) {
%4 = icmp ule i8* %0, %1
%5 = getelementptr i8, i8* %0, i64 %2
%6 = icmp ugt i8* %5, %1
%7 = and i1 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ print_uart0(char *);
int c_entry() {
  print_uart0("What is up, fam\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"What is up, fam\0A\00"
define i32 @c_entry() {
%1 = call i32 @print_uart0(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"What is up, fam\0A\00"
define i32 @c_entry() {
%1 = tail call i32 @print_uart0(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void foo() {
  unsigned int frame, focus;
  (struct bar *)focus == (focus ? ((struct bar *)frame) : 0);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    -0x8(%rbp),%eax
cmpl   $0x0,-0x8(%rbp)
je     111d <foo+0x1d>
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
jmp    1128 <foo+0x28>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    1128 <foo+0x28>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bar = type opaque
define void @foo() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.bar*
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %1
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.bar*
br label %13
12: ; preds = %0
br label %13
13: ; preds = %12, %8
%14 = phi %struct.bar* [ %11, %8 ], [ null, %12 ]
%15 = icmp eq %struct.bar* %5, %14
%16 = zext i1 %15 to i32
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
void NMI_Handler(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ abort();
scalar_t__ malloc(int);
void *alloc_XExtData(void) {
  XExtData *_p = (XExtData *)malloc(sizeof(XExtData));
  if (_p == NULL)
    abort();
  return (void *)_p;
}


x86 assembly (clang, -O0):
<alloc_XExtData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <alloc_XExtData+0x28>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_XExtData>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1132 <alloc_XExtData+0x12>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i8* @alloc_XExtData() {
%1 = tail call i64 @malloc(i32 4)
%2 = icmp eq i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = inttoptr i64 %1 to i8*
ret i8* %6
}
void report_gesture_data(struct ssp_data *data, struct sensor_value *gesdata) {}


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

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

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

LLVM IR (-O2):
%struct.ssp_data = type opaque
%struct.sensor_value = type opaque
define void @report_gesture_data(%struct.ssp_data* nocapture %0, %struct.sensor_value* nocapture %1) {
ret void
}
/* Variables and functions */
double floor(double);
double floormul(double x, double y) { return (floor(x / y) * y); }


x86 assembly (clang, -O0):
<floormul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1030 <floor@plt>
mulsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<floormul>:
push   %rax
movsd  %xmm1,(%rsp)
divsd  %xmm1,%xmm0
call   1030 <floor@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @floormul(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fdiv double %5, %6
%8 = call double @llvm.floor.f64(double %7)
%9 = load double, double* %4
%10 = fmul double %8, %9
ret double %10
}

LLVM IR (-O2):
define double @floormul(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call double @llvm.floor.f64(double %3)
%5 = fmul double %4, %1
ret double %5
}
unsigned char inb(unsigned short int port) {
  unsigned char value;
  __asm__ __volatile__("inb %w1,%0" : "=a"(value) : "Nd"(port));
  return value;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @inb(i16 zeroext %0) {
%2 = tail call i8 asm sideeffect "inb ${1:w},$0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}