xunge/DecIR huggingface dataset:
/* Variables and functions */
size_t shl_htable_rehash_str(const void *elem, void *priv) {
  const char *str = *(char **)elem;
  size_t hash = 5381;
  for (; *str; ++str)
    hash = (hash << 5) + hash + (size_t)*str;
  return hash;
}


x86 assembly (clang, -O0):
<shl_htable_rehash_str>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movq   $0x1505,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1158 <shl_htable_rehash_str+0x58>
mov    -0x20(%rbp),%rax
shl    $0x5,%rax
add    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111f <shl_htable_rehash_str+0x1f>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<shl_htable_rehash_str>:
mov    (%rdi),%rcx
mov    (%rcx),%dl
test   %dl,%dl
je     113d <shl_htable_rehash_str+0x3d>
add    $0x1,%rcx
mov    $0x1505,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rax,%rsi
shl    $0x5,%rsi
add    %rax,%rsi
movsbq %dl,%rax
add    %rsi,%rax
movzbl (%rcx),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1120 <shl_htable_rehash_str+0x20>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @shl_htable_rehash_str(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %5, %2 ]
%9 = phi i64 [ %13, %7 ], [ 5381, %2 ]
%10 = phi i8* [ %14, %7 ], [ %4, %2 ]
%11 = mul i64 %9, 33
%12 = sext i8 %8 to i64
%13 = add i64 %11, %12
%14 = getelementptr inbounds i8, i8* %10, i64 1
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %2
%18 = phi i64 [ 5381, %2 ], [ %13, %7 ]
ret i64 %18
}
void glutMenuStatusFunc(void (*func)(int status, int x, int y)) {}


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

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

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

LLVM IR (-O2):
define void @glutMenuStatusFunc(void (i32, i32, i32)* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void grpcsharp_request_call_context_deadline() {
  fprintf(stderr, "Should never reach here");
  abort();
}


x86 assembly (clang, -O0):
<grpcsharp_request_call_context_deadline>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<grpcsharp_request_call_context_deadline>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_deadline() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Should never reach here\00"
define void @grpcsharp_request_call_context_deadline() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int SIGINT;
int /*<<< orphan*/ clientExit();
int /*<<< orphan*/ disconnect();
int /*<<< orphan*/ printf(char *);
void sigHandler_1(int signumber) {
  if (signumber == SIGINT) {
    printf("\n{SIGNAL}\n");
    if (1)
      printf("    [DEBUG] SIGINT catched\n");
    printf("{/SIGNAL}\n");
    disconnect();
    clientExit();
  }
  return;
}


x86 assembly (clang, -O0):
<sigHandler_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
jne    117f <sigHandler_1+0x4f>
lea    0xeac(%rip),%rdi
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <disconnect@plt>
mov    $0x0,%al
call   1030 <clientExit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigHandler_1>:
push   %rax
mov    0x2eb0(%rip),%rax
cmp    %edi,(%rax)
jne    116f <sigHandler_1+0x3f>
lea    0xebd(%rip),%rdi
call   1040 <puts@plt>
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeca(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <disconnect@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <clientExit@plt>
pop    %rax
ret

LLVM IR (-O0):
@SIGINT = global i32 0
@.str = [11 x i8] c"\0A{SIGNAL}\0A\00"
@.str.1 = [28 x i8] c" [DEBUG] SIGINT catched\0A\00"
@.str.2 = [11 x i8] c"{/SIGNAL}\0A\00"
define void @sigHandler_1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @SIGINT
%5 = icmp eq i32 %3, %4
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (...) @disconnect()
%11 = call i32 (...) @clientExit()
br label %12
12: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@SIGINT = global i32 0
@str = [10 x i8] c"\0A{SIGNAL}\00"
@str.3 = [27 x i8] c" [DEBUG] SIGINT catched\00"
@str.4 = [10 x i8] c"{/SIGNAL}\00"
define void @sigHandler_1(i32 %0) {
%2 = load i32, i32* @SIGINT
%3 = icmp eq i32 %2, %0
br i1 %3, label %4, label %10
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.3, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.4, i64 0, i64 0))
%8 = tail call i32 (...) @disconnect()
%9 = tail call i32 (...) @clientExit()
br label %10
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void _rtc_handler(int argc, char **argv) {
  (void)argc;
  (void)argv;
  puts("not implemented");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"not implemented\00"
define void @_rtc_handler(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = load i8**, i8*** %4
%7 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"not implemented\00"
define void @_rtc_handler(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
char fn_test1(int ia) {
  printf("fn_test1: %d\n", ia);
  return 'A';
}


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

x86 assembly (clang, -O2):
<fn_test1>:
push   %rax
mov    %edi,%esi
lea    0xee6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x41,%al
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [14 x i8] c"fn_test1: %d\0A\00"
define signext i8 @fn_test1(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i8 65
}
/* Variables and functions */
int /*<<< orphan*/ outw_local(unsigned short, unsigned short);
void x_outw(unsigned short port, unsigned short val) { outw_local(port, val); }


x86 assembly (clang, -O0):
<x_outw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzwl -0x4(%rbp),%esi
call   1030 <outw_local@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x_outw>:
jmp    1030 <outw_local@plt>

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

LLVM IR (-O2):
define void @x_outw(i16 zeroext %0, i16 zeroext %1) {
%3 = tail call i32 @outw_local(i16 zeroext %0, i16 zeroext %1)
ret void
}
int houseToChar(int house) {
  switch (house) {
  case 0:
    return 'A';
    break;
  case 1:
    return 'D';
    break;
  case 2:
    return 'H';
    break;
  case 3:
    return 'J';
    break;
  case 4:
    return 'L';
    break;
  case 5:
    return 'M';
    break;
  }
  return 'z';
}


x86 assembly (clang, -O0):
<houseToChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x5,%rax
ja     1174 <houseToChar+0x74>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x41,-0x4(%rbp)
jmp    117b <houseToChar+0x7b>
movl   $0x44,-0x4(%rbp)
jmp    117b <houseToChar+0x7b>
movl   $0x48,-0x4(%rbp)
jmp    117b <houseToChar+0x7b>
movl   $0x4a,-0x4(%rbp)
jmp    117b <houseToChar+0x7b>
movl   $0x4c,-0x4(%rbp)
jmp    117b <houseToChar+0x7b>
movl   $0x4d,-0x4(%rbp)
jmp    117b <houseToChar+0x7b>
movl   $0x7a,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @houseToChar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
i32 4, label %9
i32 5, label %10
]
5: ; preds = %1
store i32 65, i32* %2
br label %12
6: ; preds = %1
store i32 68, i32* %2
br label %12
7: ; preds = %1
store i32 72, i32* %2
br label %12
8: ; preds = %1
store i32 74, i32* %2
br label %12
9: ; preds = %1
store i32 76, i32* %2
br label %12
10: ; preds = %1
store i32 77, i32* %2
br label %12
11: ; preds = %1
store i32 122, i32* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@switch.table.houseToChar = [6 x i32] [i32 65, i32 68, i32 72, i32 74, i32 76, i32 77]
define i32 @houseToChar(i32 %0) {
%2 = icmp ult i32 %0, 6
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.houseToChar, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 122, %1 ]
ret i32 %8
}
int test1(int a, int b) { return (a & b) ^ a; }


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

x86 assembly (clang, -O2):
<test1>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
ret

LLVM IR (-O0):
define i32 @test1(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 = load i32, i32* %3
%9 = xor i32 %7, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test1(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
ret i32 %4
}
/* Type definitions */
typedef unsigned int uint32_t;

/* Variables and functions */
uint32_t CLOCK_SYS_GetLpoClockFreq(void) { return 1000U; }


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

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

LLVM IR (-O0):
define i32 @CLOCK_SYS_GetLpoClockFreq() {
ret i32 1000
}

LLVM IR (-O2):
define i32 @CLOCK_SYS_GetLpoClockFreq() {
ret i32 1000
}
int test() {
  int a = 4, b = 2;
  int c = 1, *ptr;
  int x;
  ptr = &c;
  x = a / b + *ptr;
  return x - 3;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x4,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32 4, i32* %1
store i32 2, i32* %2
store i32 1, i32* %3
store i32* %3, i32** %4
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = sdiv i32 %6, %7
%9 = load i32*, i32** %4
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = sub nsw i32 %12, 3
ret i32 %13
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
void ff_hevc_put_hevc_epel_hv48_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_epel_hv48_10_sse4() {
ret void
}
void tests_config_setup(void) {}


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

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

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

LLVM IR (-O2):
define void @tests_config_setup() {
ret void
}
int main(int argc, char *argv[]) {
  unsigned int i;
  unsigned int a;
  unsigned int l;
  l = 10;
  for (i = 0; i < l; i++) {
    a++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x1c(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jae    1143 <main+0x43>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1120 <main+0x20>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
scalar_t__ IsAlpha(int);
int IsIdStart(int C) { return IsAlpha(C) || C == '_'; }


x86 assembly (clang, -O0):
<IsIdStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <IsAlpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    113f <IsIdStart+0x2f>
cmpl   $0x5f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsIdStart>:
push   %rbx
mov    %edi,%ebx
call   1030 <IsAlpha@plt>
test   %rax,%rax
setne  %al
cmp    $0x5f,%ebx
sete   %cl
or     %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @IsIdStart(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @IsAlpha(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 95
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ true, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @IsIdStart(i32 %0) {
%2 = tail call i64 @IsAlpha(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp eq i32 %0, 95
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int access(char *);
int /*<<< orphan*/ *fopen(char *, char *);
int checkfile(char *fn) {
  FILE *fp;
  fp = fopen(fn, "r");
  if (fp == NULL) {
    return -1;
  } else {
    return 1;
  }
  return access(fn);
}


x86 assembly (clang, -O0):
<checkfile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1147 <checkfile+0x37>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <checkfile+0x3e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkfile>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <fopen@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
define i32 @checkfile(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %11
10: ; preds = %1
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
define i32 @checkfile(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
%4 = select i1 %3, i32 -1, i32 1
ret i32 %4
}
int sys$lckpag(struct _va_range *inadr, struct _va_range *retadr,
               unsigned int acmode) {
  return ({
    unsigned long resultvar;
    register long int _a3 asm("rdx") = (long)(acmode);
    register long int _a2 asm("rsi") = (long)(retadr);
    register long int _a1 asm("rdi") = (long)(inadr);
    asm volatile("movq %1, %%rax\n\t"
                 "int $0x81\n\t"
                 : "=a"(resultvar)
                 : "i"(59), "r"(_a1), "r"(_a2), "r"(_a3)
                 : "memory", "cc", "r11", "cx");
    (long)resultvar;
  });
}


x86 assembly (clang, -O0):
<sys$lckpag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    $0x3b,%rax
int    $0x81
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys$lckpag>:
mov    %edx,%edx
mov    $0x3b,%rax
int    $0x81
ret

LLVM IR (-O0):
%struct._va_range = type opaque
define i32 @"sys$lckpag"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = alloca %struct._va_range*
%5 = alloca %struct._va_range*
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store %struct._va_range* %0, %struct._va_range** %4
store %struct._va_range* %1, %struct._va_range** %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = zext i32 %12 to i64
store i64 %13, i64* %8
%14 = load %struct._va_range*, %struct._va_range** %5
%15 = ptrtoint %struct._va_range* %14 to i64
store i64 %15, i64* %9
%16 = load %struct._va_range*, %struct._va_range** %4
%17 = ptrtoint %struct._va_range* %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = load i64, i64* %9
%20 = load i64, i64* %8
%21 = call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 59, i64 %18, i64 %19, i64 %20)
store i64 %21, i64* %7
%22 = load i64, i64* %7
store i64 %22, i64* %11
%23 = load i64, i64* %11
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct._va_range = type opaque
define i32 @"sys$lckpag"(%struct._va_range* %0, %struct._va_range* %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = ptrtoint %struct._va_range* %1 to i64
%6 = ptrtoint %struct._va_range* %0 to i64
%7 = tail call i64 asm sideeffect "movq $1, %rax\0A\09int $$0x81\0A\09", "={ax},i,{rdi},{rsi},{rdx},~{memory},~{cc},~{r11},~{cx},~{dirflag},~{fpsr},~{flags}"(i32 59, i64 %6, i64 %5, i64 %4)
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int check(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x = 1, y = 2;
  printf("%d\n", check(x, y));
  printf("%d\n", check(x, y));
  printf("%d\n", check(x, y));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <check@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <check@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <check@plt>
mov    %eax,%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <check@plt>
lea    0xec9(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <check@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <check@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"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @check(i32 %3, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @check(i32 %7, i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = call i32 @check(i32 %11, i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @check(i32 1, i32 2)
%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 @check(i32 1, i32 2)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @check(i32 1, i32 2)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
double log10(double);
double WToDB(double x) { return (10.0 * log10(x)); }


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

x86 assembly (clang, -O2):
<WToDB>:
push   %rax
call   1030 <log10@plt>
mulsd  0xee2(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @WToDB(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @log10(double %3)
%5 = fmul double 1.000000e+01, %4
ret double %5
}

LLVM IR (-O2):
define double @WToDB(double %0) {
%2 = tail call double @log10(double %0)
%3 = fmul double %2, 1.000000e+01
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ hash(int);
void test() {
  int i, j, k;
  for (i = 0; i <= 1; i++) {
    if ((i + 1) % 2 == 0) {
      j = (-i + 3) / 2;
      k = (i + 9) / 2;
      {
        hash(1);
        hash(i);
        hash((-i + 3) / 2);
        hash((i + 9) / 2);
      };
    }
  }
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     11b5 <test+0xa5>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a2 <test+0x92>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
add    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    $0x1,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
add    $0x3,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
mov    -0x4(%rbp),%eax
add    $0x9,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <hash@plt>
jmp    11a7 <test+0x97>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <test+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x1,%edi
call   1030 <hash@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <hash@plt>

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %33, %0
%5 = load i32, i32* %1
%6 = icmp sle i32 %5, 1
br i1 %6, label %7, label %36
7: ; preds = %4
%8 = load i32, i32* %1
%9 = add nsw i32 %8, 1
%10 = srem i32 %9, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %32
12: ; preds = %7
%13 = load i32, i32* %1
%14 = sub nsw i32 0, %13
%15 = add nsw i32 %14, 3
%16 = sdiv i32 %15, 2
store i32 %16, i32* %2
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 9
%19 = sdiv i32 %18, 2
store i32 %19, i32* %3
%20 = call i32 @hash(i32 1)
%21 = load i32, i32* %1
%22 = call i32 @hash(i32 %21)
%23 = load i32, i32* %1
%24 = sub nsw i32 0, %23
%25 = add nsw i32 %24, 3
%26 = sdiv i32 %25, 2
%27 = call i32 @hash(i32 %26)
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 9
%30 = sdiv i32 %29, 2
%31 = call i32 @hash(i32 %30)
br label %32
32: ; preds = %12, %7
br label %33
33: ; preds = %32
%34 = load i32, i32* %1
%35 = add nsw i32 %34, 1
store i32 %35, i32* %1
br label %4
36: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = tail call i32 @hash(i32 1)
%2 = tail call i32 @hash(i32 1)
%3 = tail call i32 @hash(i32 1)
%4 = tail call i32 @hash(i32 5)
ret void
}
int isascii(int c) { return ((unsigned int)c <= 0177); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x7f,-0x4(%rbp)
setbe  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%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 ule i32 %3, 127
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ wordArray;
typedef int /*<<< orphan*/ string;

/* Variables and functions */
void *emalloc(int);
int /*<<< orphan*/ strcpy(void *, char *);
void *flexarray_append(void **wordArray, char *string) {
  int capacity = (sizeof(wordArray) / sizeof(wordArray[0][0]));
  int itemcount = 0;
  char **items;
  wordArray[capacity - 1] = emalloc(sizeof(string) + 1);
  strcpy(wordArray[capacity - 1], string);
  return wordArray;
}


x86 assembly (clang, -O0):
<flexarray_append>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    $0x9,%edi
call   1040 <emalloc@plt>
mov    %rax,%rdx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flexarray_append>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x9,%edi
call   1040 <emalloc@plt>
mov    %rax,0x38(%rbx)
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @flexarray_append(i8** writeonly %0, i8* %1) {
%3 = tail call i8* @emalloc(i32 9)
%4 = getelementptr inbounds i8*, i8** %0, i64 7
store i8* %3, i8** %4
%5 = tail call i32 @strcpy(i8* %3, i8* %1)
%6 = bitcast i8** %0 to i8*
ret i8* %6
}
int fun722() { return 722; }


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

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

LLVM IR (-O0):
define i32 @fun722() {
ret i32 722
}

LLVM IR (-O2):
define i32 @fun722() {
ret i32 722
}
int loop3(int m) {
  int i = 0;
  while (*&i < m) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<loop3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <loop3+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <loop3+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<loop3>:
xor    %eax,%eax
test   %edi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @loop3(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @loop3(i32 %0) {
%2 = call i32 @llvm.smax.i32(i32 %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int simple_add(int, int, int *);
int simple_square(int);
int main(void) {
  int result = simple_square(7);
  printf("7^2=%d\n", result);
  int result2 = 0;
  result = simple_add(9, 7, &result2);
  printf("res=%d, res2=%d\n", result, result2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1050 <simple_square@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    $0x9,%edi
mov    $0x7,%esi
lea    -0xc(%rbp),%rdx
call   1040 <simple_add@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <simple_square@plt>
lea    0xebe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x9,%edi
mov    $0x7,%esi
call   1040 <simple_add@plt>
mov    0x4(%rsp),%edx
lea    0xe96(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"7^2=%d\0A\00"
@.str.1 = [17 x i8] c"res=%d, res2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @simple_square(i32 7)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 0, i32* %3
%7 = call i32 @simple_add(i32 9, i32 7, i32* %3)
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"7^2=%d\0A\00"
@.str.1 = [17 x i8] c"res=%d, res2=%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @simple_square(i32 7)
%3 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = call i32 @simple_add(i32 9, i32 7, i32* %1)
%6 = load i32, i32* %1
%7 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ log_msg;

/* Variables and functions */
int /*<<< orphan*/ log_event(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, int);
void log_error(const char *msg, int error_code) {
  char log_msg[512];
  snprintf(log_msg, sizeof(log_msg), "[ERROR] %s [e:%d]", msg, error_code);
  log_event(log_msg);
}


x86 assembly (clang, -O0):
<log_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    $0x200,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x210(%rbp),%rdi
call   1040 <log_event@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_error>:
push   %rbx
sub    $0x200,%rsp
mov    %esi,%r8d
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <log_event@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"[ERROR] %s [e:%d]\00"
define void @log_error(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %6, i32 512, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%11 = call i32 @log_event(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"[ERROR] %s [e:%d]\00"
define void @log_error(i8* %0, i32 %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i32 @log_event(i8* %4)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
void write_le32(uint8_t *out, uint32_t value) {
  *out++ = value & 0xFF;
  *out++ = (value >> 8) & 0xFF;
  *out++ = (value >> 16) & 0xFF;
  *out++ = (value >> 24) & 0xFF;
}


x86 assembly (clang, -O0):
<write_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x8(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_le32>:
mov    %esi,%eax
movzbl %al,%ecx
mov    %ecx,(%rdi)
movzbl %ah,%ecx
mov    %ecx,0x4(%rdi)
mov    %esi,%ecx
shr    $0x10,%ecx
movzbl %cl,%ecx
mov    %ecx,0x8(%rdi)
shr    $0x18,%eax
mov    %eax,0xc(%rdi)
ret

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

LLVM IR (-O2):
define void @write_le32(i32* nocapture writeonly %0, i32 %1) {
%3 = and i32 %1, 255
%4 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %3, i32* %0
%5 = lshr i32 %1, 8
%6 = and i32 %5, 255
%7 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %6, i32* %4
%8 = lshr i32 %1, 16
%9 = and i32 %8, 255
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %9, i32* %7
%11 = lshr i32 %1, 24
store i32 %11, i32* %10
ret void
}
/* Variables and functions */
uintptr_t tag2(void *ptr) { return (uintptr_t)ptr | 2; }


x86 assembly (clang, -O0):
<tag2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
or     $0x2,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag2>:
mov    %rdi,%rax
or     $0x2,%rax
ret

LLVM IR (-O0):
define i64 @tag2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = or i64 %4, 2
ret i64 %5
}

LLVM IR (-O2):
define i64 @tag2(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = or i64 %2, 2
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
scalar_t__ isupper(int);
scalar_t__ isxdigit(int);
void test_isxdigit(int x) {
  if (isxdigit(x) && isupper(x)) {
    clang_analyzer_eval(x >= 'A');
    clang_analyzer_eval(x <= 'F');
  }
}


x86 assembly (clang, -O0):
<test_isxdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <isxdigit@plt>
cmp    $0x0,%rax
je     1181 <test_isxdigit+0x51>
mov    -0x4(%rbp),%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
je     1181 <test_isxdigit+0x51>
cmpl   $0x41,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
cmpl   $0x46,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <clang_analyzer_eval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isxdigit>:
push   %rbx
mov    %edi,%ebx
call   1040 <isxdigit@plt>
test   %rax,%rax
je     1166 <test_isxdigit+0x36>
mov    %ebx,%edi
call   1030 <isupper@plt>
test   %rax,%rax
je     1166 <test_isxdigit+0x36>
xor    %edi,%edi
cmp    $0x41,%ebx
setge  %dil
call   1050 <clang_analyzer_eval@plt>
xor    %edi,%edi
cmp    $0x47,%ebx
setl   %dil
pop    %rbx
jmp    1050 <clang_analyzer_eval@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @test_isxdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isxdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @isupper(i32 %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i32, i32* %2
%12 = icmp sge i32 %11, 65
%13 = zext i1 %12 to i32
%14 = call i32 @clang_analyzer_eval(i32 %13)
%15 = load i32, i32* %2
%16 = icmp sle i32 %15, 70
%17 = zext i1 %16 to i32
%18 = call i32 @clang_analyzer_eval(i32 %17)
br label %19
19: ; preds = %10, %6, %1
ret void
}

LLVM IR (-O2):
define void @test_isxdigit(i32 %0) {
%2 = tail call i64 @isxdigit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = tail call i64 @isupper(i32 %0)
%6 = icmp eq i64 %5, 0
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = icmp sgt i32 %0, 64
%9 = zext i1 %8 to i32
%10 = tail call i32 @clang_analyzer_eval(i32 %9)
%11 = icmp slt i32 %0, 71
%12 = zext i1 %11 to i32
%13 = tail call i32 @clang_analyzer_eval(i32 %12)
br label %14
14: ; preds = %7, %4, %1
ret void
}
unsigned short(readw)(void const volatile *addr) {
  unsigned short volatile *mem_2;
  {
    mem_2 = (unsigned short volatile *)addr;
    return ((unsigned short)(*mem_2));
  }
}


x86 assembly (clang, -O0):
<readw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readw>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @readw(i8* %0) {
%2 = alloca i8*
%3 = alloca i16*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i16*
store i16* %5, i16** %3
%6 = load i16*, i16** %3
%7 = load volatile i16, i16* %6
ret i16 %7
}

LLVM IR (-O2):
define zeroext i16 @readw(i8* %0) {
%2 = bitcast i8* %0 to i16*
%3 = load volatile i16, i16* %2
ret i16 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ xcb_window_t;
typedef int /*<<< orphan*/ xcb_get_property_cookie_t;
typedef int /*<<< orphan*/ xcb_connection_t;
typedef int /*<<< orphan*/ xcb_atom_t;

/* Variables and functions */
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ XCB_ATOM_ATOM;
int /*<<< orphan*/
xcb_get_property_unchecked(int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
xcb_get_property_cookie_t
xcb_icccm_get_wm_protocols_unchecked(xcb_connection_t *c, xcb_window_t window,
                                     xcb_atom_t wm_protocol_atom) {
  return xcb_get_property_unchecked(c, 0, window, wm_protocol_atom,
                                    XCB_ATOM_ATOM, 0, UINT_MAX);
}


x86 assembly (clang, -O0):
<xcb_icccm_get_wm_protocols_unchecked>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    0x2eb5(%rip),%rax
mov    (%rax),%r8d
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %eax,(%rsp)
call   1030 <xcb_get_property_unchecked@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcb_icccm_get_wm_protocols_unchecked>:
push   %rax
mov    %edx,%ecx
mov    %esi,%edx
mov    0x2ecc(%rip),%rax
mov    (%rax),%r8d
mov    0x2eba(%rip),%rax
mov    (%rax),%eax
mov    %eax,(%rsp)
xor    %esi,%esi
xor    %r9d,%r9d
call   1030 <xcb_get_property_unchecked@plt>
pop    %rcx
ret

LLVM IR (-O0):
@XCB_ATOM_ATOM = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_protocols_unchecked(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = load i32, i32* @XCB_ATOM_ATOM
%11 = load i32, i32* @UINT_MAX
%12 = call i32 @xcb_get_property_unchecked(i32* %7, i32 0, i32 %8, i32 %9, i32 %10, i32 0, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
@XCB_ATOM_ATOM = global i32 0
@UINT_MAX = global i32 0
define i32 @xcb_icccm_get_wm_protocols_unchecked(i32* %0, i32 %1, i32 %2) {
%4 = load i32, i32* @XCB_ATOM_ATOM
%5 = load i32, i32* @UINT_MAX
%6 = tail call i32 @xcb_get_property_unchecked(i32* %0, i32 0, i32 %1, i32 %2, i32 %4, i32 0, i32 %5)
ret i32 %6
}
int filho_esquerda(int n) { return 2 * n; }


x86 assembly (clang, -O0):
<filho_esquerda>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @filho_esquerda(i32 %0) {
%2 = shl nsw i32 %0, 1
ret i32 %2
}