xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int CosmError(char *str) {
  fprintf(stderr, "%s\n", str);
  fprintf(stderr, "%s\n", "Exiting...");
  exit(1);
}


x86 assembly (clang, -O0):
<CosmError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
lea    0xea8(%rip),%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<CosmError>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rbx
mov    (%rbx),%edi
lea    0xec9(%rip),%r14
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xebc(%rip),%rdx
mov    %r14,%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"Exiting...\00"
define i32 @CosmError(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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"Exiting...\00"
define i32 @CosmError(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num = 2;
  switch (num + 2) {
  case 1:
    printf("Case1: Value is: %d", num);
  case 2:
    printf("Case2: Value is: %d", num);
  case 3:
    printf("Case3: Value is: %d", num);
  default:
    printf("Default: Value is: %d", num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     115f <main+0x4f>
jmp    113d <main+0x2d>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
je     116e <main+0x5e>
jmp    114e <main+0x3e>
mov    -0xc(%rbp),%eax
sub    $0x3,%eax
je     117d <main+0x6d>
jmp    118c <main+0x7c>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.3 = [22 x i8] c"Default: Value is: %d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ notify_pvcall(char *);
int pvGetDeviceInfo(char byBoardNum, short *pDeviceID, char *pRevisionID,
                    char *pBoardID) {
  notify_pvcall("f");
  return (0);
}


x86 assembly (clang, -O0):
<pvGetDeviceInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
lea    0xecf(%rip),%rdi
call   1030 <notify_pvcall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define i32 @pvGetDeviceInfo(i8 signext %0, i16* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = tail call i32 @notify_pvcall(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void num_dump_word32(void *dst, unsigned src) {
  *((unsigned char *)dst + 0) = (src >> 24) & 0xff;
  *((unsigned char *)dst + 1) = (src >> 16) & 0xff;
  *((unsigned char *)dst + 2) = (src >> 8) & 0xff;
  *((unsigned char *)dst + 3) = src & 0xff;
}


x86 assembly (clang, -O0):
<num_dump_word32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @num_dump_word32(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 = lshr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = lshr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @num_dump_word32(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getCard();
int main(int argc, const char *argv[]) {
  getCard();
  return 0;
}


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   1030 <getCard@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getCard@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**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getCard()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getCard()
ret i32 0
}
void charsetProcessorDone(struct stCharsetProcessor *this) {}


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

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

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

LLVM IR (-O2):
%struct.stCharsetProcessor = type opaque
define void @charsetProcessorDone(%struct.stCharsetProcessor* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_init();
int FIPS_mode(void) {
  OPENSSL_init();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @FIPS_mode() {
%1 = call i32 (...) @OPENSSL_init()
ret i32 0
}

LLVM IR (-O2):
define i32 @FIPS_mode() {
%1 = tail call i32 (...) @OPENSSL_init()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char **readNodes();
int main(int argc, char **argv) {
  char msg[4096];
  int s;
  int dstport;
  char *dsthost;
  char **nodes = readNodes();
  printf("%s\n", nodes[0]);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <readNodes@plt>
mov    (%rax),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8** (...) @readNodes()
%4 = load i8*, i8** %3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int is_kdump_kernel(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @is_kdump_kernel() {
ret i32 0
}

LLVM IR (-O2):
define i32 @is_kdump_kernel() {
ret i32 0
}
/* Type definitions */
struct timespec {
  int tv_nsec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
void normalize_timespec(struct timespec *t) {
  while (t->tv_nsec >= 1000000000) {
    t->tv_nsec -= 1000000000;
    t->tv_sec++;
  }
}


x86 assembly (clang, -O0):
<normalize_timespec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x3b9aca00,(%rax)
jl     1138 <normalize_timespec+0x38>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x3b9aca00,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
add    $0x1,%ecx
mov    %ecx,0x4(%rax)
jmp    1108 <normalize_timespec+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<normalize_timespec>:
mov    (%rdi),%eax
cmp    $0x3b9aca00,%eax
jl     1148 <normalize_timespec+0x48>
mov    0x4(%rdi),%ecx
cmp    $0x773593ff,%eax
mov    $0x773593ff,%edx
cmovl  %eax,%edx
neg    %edx
add    %eax,%edx
add    $0x3b9ac9ff,%edx
shr    $0x9,%edx
imul   $0x44b83,%rdx,%rdx
shr    $0x27,%rdx
imul   $0xc4653600,%edx,%esi
add    %esi,%eax
add    $0xc4653600,%eax
add    %edx,%ecx
add    $0x1,%ecx
mov    %eax,(%rdi)
mov    %ecx,0x4(%rdi)
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
define void @normalize_timespec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = icmp sge i32 %6, 1000000000
br i1 %7, label %8, label %17
8: ; preds = %3
%9 = load %struct.timespec*, %struct.timespec** %2
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sub nsw i32 %11, 1000000000
store i32 %12, i32* %10
%13 = load %struct.timespec*, %struct.timespec** %2
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %13, i32 0, i32 1
%15 = load i32, i32* %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %14
br label %3
17: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
define void @normalize_timespec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 999999999
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%7 = load i32, i32* %6
%8 = add nuw i32 %3, 999999999
%9 = call i32 @llvm.smin.i32(i32 %3, i32 1999999999)
%10 = sub nuw i32 %8, %9
%11 = udiv i32 %10, 1000000000
%12 = mul nsw i32 %11, -1000000000
%13 = add i32 %7, %11
%14 = add nsw i32 %3, -1000000000
%15 = add nsw i32 %12, %14
%16 = add i32 %13, 1
store i32 %15, i32* %2
store i32 %16, i32* %6
br label %17
17: ; preds = %5, %1
ret void
}
/* Variables and functions */
bool nrf53_errata_79(void) { return false; }


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

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

LLVM IR (-O0):
define i32 @nrf53_errata_79() {
ret i32 0
}

LLVM IR (-O2):
define i32 @nrf53_errata_79() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ regmatch_t;
typedef int /*<<< orphan*/ regex_t;

/* Variables and functions */
int regexec(int /*<<< orphan*/ *, char const *, int const, int /*<<< orphan*/ *,
            int /*<<< orphan*/);
bool match_regex(regex_t *r, const char *to_match) {
  const char *p = to_match;
  const int n_matches = 10;
  regmatch_t m[n_matches];
  int nomatch = regexec(r, p, n_matches, m, 0);
  if (nomatch) {
    return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<match_regex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0xa,-0x24(%rbp)
mov    %rsp,%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0xa,%edx
lea    -0x60(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <regexec@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
je     116f <match_regex+0x5f>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x38(%rbp)
jmp    117d <match_regex+0x6d>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x38(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_regex>:
sub    $0x28,%rsp
mov    %rsp,%rcx
mov    $0xa,%edx
xor    %r8d,%r8d
call   1030 <regexec@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @match_regex(i32* %0, i8* %1) {
%3 = alloca [10 x i32]
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%5 = call i32 @regexec(i32* %0, i8* %1, i32 10, i32* %4, i32 0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
void drawscreen(void) { return; }


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

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

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

LLVM IR (-O2):
define void @drawscreen() {
ret void
}
/* Variables and functions */
bool my_isdigit(char c) { return (c >= '0') && (c <= '9'); }


x86 assembly (clang, -O0):
<my_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <my_isdigit+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_isdigit>:
add    $0xd0,%dil
xor    %eax,%eax
cmp    $0xa,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @my_isdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @my_isdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
void f(void) {
#pragma css start
}


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

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

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

LLVM IR (-O2):
define void @f() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Inst_Printf(char *, char *, int);
void Move_Ret_To_Foreign_D(int index) {
  Inst_Printf("addis",
              "r"
              "4"
              ",0,"
              "ha16("
              "_"
              "pl_foreign_double+%d"
              ")",
              index * 8);
  Inst_Printf("stfd",
              "f"
              "1"
              ","
              "lo16("
              "_"
              "pl_foreign_double+%d"
              ")"
              "("
              "r"
              "4"
              ")",
              index * 8);
}


x86 assembly (clang, -O0):
<Move_Ret_To_Foreign_D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
lea    0xed8(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <Inst_Printf@plt>
mov    -0x4(%rbp),%edx
shl    $0x3,%edx
lea    0xee6(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1030 <Inst_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Move_Ret_To_Foreign_D>:
push   %rbx
lea    0x0(,%rdi,8),%ebx
lea    0xee1(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    %ebx,%edx
call   1030 <Inst_Printf@plt>
lea    0xef3(%rip),%rdi
lea    0xef1(%rip),%rsi
mov    %ebx,%edx
pop    %rbx
jmp    1030 <Inst_Printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"addis\00"
@.str.1 = [33 x i8] c"r4,0,ha16(_pl_foreign_double+%d)\00"
@.str.2 = [5 x i8] c"stfd\00"
@.str.3 = [35 x i8] c"f1,lo16(_pl_foreign_double+%d)(r4)\00"
define void @Move_Ret_To_Foreign_D(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 8
%5 = call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = mul nsw i32 %6, 8
%8 = call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"addis\00"
@.str.1 = [33 x i8] c"r4,0,ha16(_pl_foreign_double+%d)\00"
@.str.2 = [5 x i8] c"stfd\00"
@.str.3 = [35 x i8] c"f1,lo16(_pl_foreign_double+%d)(r4)\00"
define void @Move_Ret_To_Foreign_D(i32 %0) {
%2 = shl nsw i32 %0, 3
%3 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @Inst_Printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ i2c_ClearTXDone(int /*<<< orphan*/);
void i2c0_ClearTXDone(void) { i2c_ClearTXDone(0); }


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

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

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

LLVM IR (-O2):
define void @i2c0_ClearTXDone() {
%1 = tail call i32 @i2c_ClearTXDone(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ system(char *);
void raext512() {
  printf("\nChanging Read Ahead Cache size for External sdcard to 512kb\n");
  char buf[256];
  sprintf(buf, "/system/bin/sh -c %s",
          "'echo 512 > /sys/block/mmcblk1/queue/read_ahead_kb'");
  system(buf);
}


x86 assembly (clang, -O0):
<raext512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
lea    0xee9(%rip),%rsi
lea    0xef7(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<raext512>:
push   %rbx
sub    $0x100,%rsp
lea    0xf0a(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb5(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [62 x i8] c"\0AChanging Read Ahead Cache size for External sdcard to 512kb\0A\00"
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 512 > /sys/block/mmcblk1/queue/read_ahead_kb'\00"
define void @raext512() {
%1 = alloca [256 x i8]
%2 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 @system(i8* %5)
ret void
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"/system/bin/sh -c %s\00"
@.str.2 = [52 x i8] c"'echo 512 > /sys/block/mmcblk1/queue/read_ahead_kb'\00"
@str = [61 x i8] c"\0AChanging Read Ahead Cache size for External sdcard to 512kb\00"
define void @raext512() {
%1 = alloca [256 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @system(i8* %3)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int bit_test(uint8_t v, uint8_t bit) { return (v & bit) > 0; }


x86 assembly (clang, -O0):
<bit_test>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    -0x8(%rbp),%eax
cmp    $0x0,%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_test>:
xor    %eax,%eax
test   %edi,%esi
setg   %al
ret

LLVM IR (-O0):
define i32 @bit_test(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 = and i32 %5, %6
%8 = icmp sgt i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @bit_test(i32 %0, i32 %1) {
%3 = and i32 %1, %0
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef scalar_t__ int64_t;

/* Variables and functions */
scalar_t__ UINT16_MAX;
int QCBOR_Int64UToInt16(int64_t src, uint16_t *dest) {
  if (src > UINT16_MAX || src < 0) {
    return -1;
  } else {
    *dest = (uint16_t)src;
  }
  return 0;
}


x86 assembly (clang, -O0):
<QCBOR_Int64UToInt16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ec9(%rip),%rcx
cmp    (%rcx),%rax
jg     112b <QCBOR_Int64UToInt16+0x2b>
cmpq   $0x0,-0x10(%rbp)
jge    1137 <QCBOR_Int64UToInt16+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    1149 <QCBOR_Int64UToInt16+0x49>
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<QCBOR_Int64UToInt16>:
mov    $0xffffffff,%eax
test   %rdi,%rdi
js     111b <QCBOR_Int64UToInt16+0x1b>
mov    0x2ecf(%rip),%rcx
cmp    %rdi,(%rcx)
jl     111b <QCBOR_Int64UToInt16+0x1b>
mov    %rdi,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@UINT16_MAX = global i64 0
define i32 @QCBOR_Int64UToInt16(i64 %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* @UINT16_MAX
%4 = icmp slt i64 %3, %0
%5 = icmp slt i64 %0, 0
%6 = or i1 %5, %4
br i1 %6, label %8, label %7
7: ; preds = %2
store i64 %0, i64* %1
br label %8
8: ; preds = %2, %7
%9 = phi i32 [ 0, %7 ], [ -1, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ CG_Argv(int);
int /*<<< orphan*/ CG_Printf(char *, int /*<<< orphan*/);
void CG_Print_f(void) { CG_Printf("%s", CG_Argv(1)); }


x86 assembly (clang, -O0):
<CG_Print_f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1040 <CG_Printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<CG_Print_f>:
push   %rax
mov    $0x1,%edi
call   1030 <CG_Argv@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <CG_Printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @CG_Print_f() {
%1 = call i32 @CG_Argv(i32 1)
%2 = call i32 @CG_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @CG_Print_f() {
%1 = tail call i32 @CG_Argv(i32 1)
%2 = tail call i32 @CG_Printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void s3c_pm_arch_prepare_irqs(void) {}


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

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

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

LLVM IR (-O2):
define void @s3c_pm_arch_prepare_irqs() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void handle(const char *string, int error) {
  if (error) {
    perror(string);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<handle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1150 <handle+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle>:
test   %esi,%esi
jne    1125 <handle+0x5>
ret
push   %rax
call   1030 <perror@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @handle(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 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @perror(i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @handle(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %0)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_key_t;

/* Variables and functions */
int errno;
void *pthread_getspecific(int /*<<< orphan*/);
void *tosTLS_getValue(pthread_key_t key) {
  int res = 0;
  void *val = ((void *)0);
  val = pthread_getspecific(key);
  if (res) {
    errno = res;
    val = ((void *)0);
  }
  return val;
}


x86 assembly (clang, -O0):
<tosTLS_getValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <pthread_getspecific@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1154 <tosTLS_getValue+0x44>
mov    -0x8(%rbp),%ecx
mov    0x2e96(%rip),%rax
mov    %ecx,(%rax)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tosTLS_getValue>:
jmp    1030 <pthread_getspecific@plt>

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

LLVM IR (-O2):
@errno = global i32 0
define i8* @tosTLS_getValue(i32 %0) {
%2 = tail call i8* @pthread_getspecific(i32 %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
main() { printf("%s\n", "hi"); }


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

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

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

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


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

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

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

LLVM IR (-O2):
define i32 @evt_split_exist() {
ret i32 undef
}
/* Variables and functions */
char *canonicalize_abspath(char *);
char *canonicalize_relpath(char *, char *);
char *canonicalize_path(char *path, char *relpath_base) {
  if (((path) && path[0] == '/')) {
    return canonicalize_abspath(path);
  } else {
    return canonicalize_relpath(path, relpath_base);
  }
}


x86 assembly (clang, -O0):
<canonicalize_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115d <canonicalize_path+0x3d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    115d <canonicalize_path+0x3d>
mov    -0x10(%rbp),%rdi
call   1030 <canonicalize_abspath@plt>
mov    %rax,-0x8(%rbp)
jmp    116e <canonicalize_path+0x4e>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <canonicalize_relpath@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canonicalize_path>:
test   %rdi,%rdi
je     112f <canonicalize_path+0xf>
cmpb   $0x2f,(%rdi)
jne    112f <canonicalize_path+0xf>
jmp    1030 <canonicalize_abspath@plt>
jmp    1040 <canonicalize_relpath@plt>

LLVM IR (-O0):
define i8* @canonicalize_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 47
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = load i8*, i8** %4
%16 = call i8* @canonicalize_abspath(i8* %15)
store i8* %16, i8** %3
br label %21
17: ; preds = %8, %2
%18 = load i8*, i8** %4
%19 = load i8*, i8** %5
%20 = call i8* @canonicalize_relpath(i8* %18, i8* %19)
store i8* %20, i8** %3
br label %21
21: ; preds = %17, %14
%22 = load i8*, i8** %3
ret i8* %22
}

LLVM IR (-O2):
define i8* @canonicalize_path(i8* %0, i8* %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 47
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i8* @canonicalize_abspath(i8* %0)
br label %11
9: ; preds = %4, %2
%10 = tail call i8* @canonicalize_relpath(i8* %0, i8* %1)
br label %11
11: ; preds = %9, %7
%12 = phi i8* [ %8, %7 ], [ %10, %9 ]
ret i8* %12
}
/* Type definitions */
struct udev_queue {
  int dummy;
};
struct udev_list_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
__attribute__((visibility("default"))) struct udev_list_entry *
udev_queue_get_failed_list_entry(struct udev_queue *udev_queue) {
  errno = ENOSYS;
  return NULL;
}


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

x86 assembly (clang, -O2):
<udev_queue_get_failed_list_entry>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.udev_list_entry = type { i32 }
%struct.udev_queue = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define %struct.udev_list_entry* @udev_queue_get_failed_list_entry(%struct.udev_queue* %0) {
%2 = alloca %struct.udev_queue*
store %struct.udev_queue* %0, %struct.udev_queue** %2
%3 = load i32, i32* @ENOSYS
store i32 %3, i32* @errno
ret %struct.udev_list_entry* null
}

LLVM IR (-O2):
%struct.udev_list_entry = type { i32 }
%struct.udev_queue = type { i32 }
@ENOSYS = global i32 0
@errno = global i32 0
define noalias %struct.udev_list_entry* @udev_queue_get_failed_list_entry(%struct.udev_queue* nocapture readnone %0) {
%2 = load i32, i32* @ENOSYS
store i32 %2, i32* @errno
ret %struct.udev_list_entry* null
}
/* Variables and functions */
char getchar();
int limpiar_stdin() {
  while (getchar() != '\n')
    ;
  return 1;
}


x86 assembly (clang, -O0):
<limpiar_stdin>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <limpiar_stdin+0x9>
mov    $0x0,%al
call   1030 <getchar@plt>
movsbl %al,%eax
cmp    $0xa,%eax
je     1131 <limpiar_stdin+0x21>
jmp    1119 <limpiar_stdin+0x9>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<limpiar_stdin>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%al
jne    1120 <limpiar_stdin+0x10>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @limpiar_stdin() {
br label %1
1: ; preds = %5, %0
%2 = call signext i8 (...) @getchar()
%3 = sext i8 %2 to i32
%4 = icmp ne i32 %3, 10
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
ret i32 1
}

LLVM IR (-O2):
define i32 @limpiar_stdin() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 10
br i1 %3, label %4, label %1
4: ; preds = %1
ret i32 1
}
void alrm_handler(int sig) {}


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

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

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

LLVM IR (-O2):
define void @alrm_handler(i32 %0) {
ret void
}
/* Variables and functions */
scalar_t__ InlineFunc();
int /*<<< orphan*/ abort();
int FooBar(void) {
  int i;
  int var1 = InlineFunc() ? 2046 : 1023;
  int var2 = InlineFunc() ? 512 : 1024;
  for (i = 0; i < var1; i++)
    ;
  if (InlineFunc() && var2 != 512)
    abort();
  return 0;
}


x86 assembly (clang, -O0):
<FooBar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <InlineFunc@plt>
mov    %rax,%rdx
mov    $0x3ff,%eax
mov    $0x7fe,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <InlineFunc@plt>
mov    %rax,%rdx
mov    $0x400,%eax
mov    $0x200,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118a <FooBar+0x6a>
jmp    117c <FooBar+0x5c>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    116b <FooBar+0x4b>
mov    $0x0,%al
call   1040 <InlineFunc@plt>
cmp    $0x0,%rax
je     11af <FooBar+0x8f>
cmpl   $0x200,-0xc(%rbp)
je     11af <FooBar+0x8f>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FooBar>:
push   %rbx
xor    %eax,%eax
call   1040 <InlineFunc@plt>
xor    %eax,%eax
call   1040 <InlineFunc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <InlineFunc@plt>
test   %rax,%rax
je     1143 <FooBar+0x23>
test   %rbx,%rbx
je     1147 <FooBar+0x27>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @FooBar() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i64 (...) @InlineFunc()
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 2046, i32 1023
store i32 %7, i32* %2
%8 = call i64 (...) @InlineFunc()
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i64
%11 = select i1 %9, i32 512, i32 1024
store i32 %11, i32* %3
store i32 0, i32* %1
br label %12
12: ; preds = %17, %0
%13 = load i32, i32* %1
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %1
br label %12
20: ; preds = %12
%21 = call i64 (...) @InlineFunc()
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %3
%25 = icmp ne i32 %24, 512
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 (...) @abort()
unreachable
28: ; preds = %23, %20
ret i32 0
}

LLVM IR (-O2):
define i32 @FooBar() {
%1 = tail call i64 (...) @InlineFunc()
%2 = tail call i64 (...) @InlineFunc()
%3 = icmp eq i64 %2, 0
%4 = tail call i64 (...) @InlineFunc()
%5 = icmp ne i64 %4, 0
%6 = select i1 %5, i1 %3, i1 false
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 (...) @abort()
unreachable
9: ; preds = %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int tty_init();
int x11h_init();
int xenv_init(void) {
  int ret;
  ret = x11h_init();
  if (ret == 0)
    return 0;
  ret = tty_init();
  if (ret == 0)
    return 0;
  fprintf(stderr, "xenv: "
                  "error: both x11h_init and tty_init failed\n");
  return -1;
}


x86 assembly (clang, -O0):
<xenv_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <x11h_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1158 <xenv_init+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1194 <xenv_init+0x64>
mov    $0x0,%al
call   1030 <tty_init@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1178 <xenv_init+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1194 <xenv_init+0x64>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xenv_init>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <x11h_init@plt>
test   %eax,%eax
je     1165 <xenv_init+0x35>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <tty_init@plt>
test   %eax,%eax
je     1165 <xenv_init+0x35>
mov    0x2e8e(%rip),%rax
mov    (%rax),%edi
lea    0xea5(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [49 x i8] c"xenv: error: both x11h_init and tty_init failed\0A\00"
define i32 @xenv_init() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @x11h_init()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %15
7: ; preds = %0
%8 = call i32 (...) @tty_init()
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
store i32 0, i32* %1
br label %15
12: ; preds = %7
%13 = load i32, i32* @stderr
%14 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %1
br label %15
15: ; preds = %12, %11, %6
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [49 x i8] c"xenv: error: both x11h_init and tty_init failed\0A\00"
define i32 @xenv_init() {
%1 = tail call i32 (...) @x11h_init()
%2 = icmp eq i32 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @tty_init()
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %3, %0, %6
%10 = phi i32 [ -1, %6 ], [ 0, %0 ], [ 0, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *whoami) {
  fprintf(stderr, "usage: %s [options] file [file ....]\n", whoami);
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s [options] file [file ....]\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [38 x i8] c"usage: %s [options] file [file ....]\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_F3int64_highword_reg(long long val) {
  return ((val >> 32) & (0xF3 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F3int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 243
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_F3int64_highword_reg(i64 %0) {
%2 = and i64 %0, 1043677052928
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
size_t get_next_chunk_size(int length, size_t chunk_size) {
  size_t remaining = length - chunk_size;
  if (remaining > chunk_size) {
    return chunk_size;
  }
  return remaining;
}


x86 assembly (clang, -O0):
<get_next_chunk_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
movslq -0xc(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    1132 <get_next_chunk_size+0x32>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    113a <get_next_chunk_size+0x3a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_next_chunk_size>:
movslq %edi,%rax
sub    %rsi,%rax
cmp    %rsi,%rax
cmova  %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @get_next_chunk_size(i32 %0, i64 %1) {
%3 = sext i32 %0 to i64
%4 = sub i64 %3, %1
%5 = icmp ugt i64 %4, %1
%6 = select i1 %5, i64 %1, i64 %4
ret i64 %6
}